/* =========================================================
   VidSlice Studio - editor-first UI
   ========================================================= */

:root {
  --bg: #f1f3f7;
  --bg-2: #e7eaf0;
  --panel: #ffffff;
  --panel-2: #f7f8fb;
  --panel-3: #eceff4;
  --text: #111318;
  --muted: #5c6472;
  --muted-2: #8a91a0;
  --line: rgba(15, 20, 30, 0.08);
  --line-2: rgba(15, 20, 30, 0.15);
  --line-3: rgba(15, 20, 30, 0.24);
  --accent: #1a1c20;
  --accent-2: #3b3f46;
  --accent-text: #1a1c20;
  --accent-ink: #ffffff;
  --accent-soft: rgba(20, 22, 26, 0.08);
  --accent-glow: rgba(20, 22, 26, 0.2);
  --timeline-accent: #f3f4f6;
  --timeline-accent-ink: #0b0d10;
  --timeline-glow: rgba(255, 255, 255, 0.28);
  --btn-bg: #16181c;
  --btn-text: #ffffff;
  --btn-hover: #2b2e34;
  --danger: #d43c3c;
  --warning: #a66a00;
  --shadow: 0 24px 70px -28px rgba(25, 33, 55, 0.34);
  --shadow-soft: 0 12px 30px -18px rgba(25, 33, 55, 0.3);
  --inset: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --field: rgba(255, 255, 255, 0.8);
  --field-2: rgba(15, 20, 30, 0.035);
  --video-bg: #e4e8ef;
  --inspector-w: 330px;
  --welcome-bg: #eef1f6;
  --welcome-glow-1: rgba(20, 22, 26, 0.22);
  --welcome-glow-2: rgba(90, 95, 105, 0.16);
  --welcome-grid: rgba(15, 20, 30, 0.06);
  --welcome-card: rgba(255, 255, 255, 0.82);
  --welcome-border: rgba(255, 255, 255, 0.95);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "Cascadia Mono", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
}

html[data-theme="dark"] {
  --bg: #050506;
  --bg-2: #0a0a0c;
  --panel: #111113;
  --panel-2: #171719;
  --panel-3: #202023;
  --text: #f3f3f4;
  --muted: #9a9aa0;
  --muted-2: #6b6b71;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --line-3: rgba(255, 255, 255, 0.22);
  --accent: #f1f1f2;
  --accent-2: #b7b7bd;
  --accent-text: #ffffff;
  --accent-ink: #08080a;
  --accent-soft: rgba(255, 255, 255, 0.1);
  --accent-glow: rgba(255, 255, 255, 0.22);
  --timeline-accent: #f1f1f2;
  --timeline-accent-ink: #08080a;
  --timeline-glow: rgba(255, 255, 255, 0.28);
  --btn-bg: #f1f1f2;
  --btn-text: #08080a;
  --btn-hover: #ffffff;
  --danger: #ff7676;
  --warning: #ffc85c;
  --shadow: 0 30px 90px -30px rgba(0, 0, 0, 0.9);
  --shadow-soft: 0 16px 40px -22px rgba(0, 0, 0, 0.85);
  --inset: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  --field: rgba(0, 0, 0, 0.4);
  --field-2: rgba(255, 255, 255, 0.05);
  --video-bg: #020203;
  --welcome-bg: #060607;
  --welcome-glow-1: rgba(255, 255, 255, 0.09);
  --welcome-glow-2: rgba(180, 180, 190, 0.07);
  --welcome-grid: rgba(255, 255, 255, 0.045);
  --welcome-card: rgba(17, 17, 19, 0.82);
  --welcome-border: rgba(255, 255, 255, 0.12);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  height: 100%;
  color-scheme: light;
}

html[data-theme="dark"] { color-scheme: dark; }

body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  top: -90px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
  text-decoration: none;
  transition: top 0.18s ease;
}

.skip-link:focus { top: 16px; }

.noscript {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  text-align: center;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

button,
input,
a { font: inherit; }

button { -webkit-tap-highlight-color: transparent; }

svg { display: block; }

kbd {
  display: inline-block;
  padding: 1px 5px;
  margin: 0 1px;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  background: var(--field-2);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.5;
}

.dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
  flex-shrink: 0;
}

/* =========================================================
   App shell
   ========================================================= */

.app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.topbar {
  height: 58px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 14px 0 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  position: relative;
  z-index: 20;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.logo__mark {
  width: 30px;
  height: 30px;
  display: block;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.18));
}

.logo__mark svg { width: 100%; height: 100%; }

.logo__word {
  font-size: 16px;
  font-weight: 720;
  letter-spacing: -0.035em;
}

.logo__word span {
  color: var(--muted-2);
}

html[data-theme="dark"] .logo__word span {
  color: var(--muted-2);
}

.logo__tag {
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: translateY(1px);
}

.project {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  max-width: 440px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.project:focus-within {
  background: var(--field);
  border-color: var(--line-2);
}

.project__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-2);
  flex-shrink: 0;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.project__dot.is-loading {
  background: var(--warning);
  box-shadow: 0 0 0 0 rgba(255, 196, 92, 0.45);
  animation: pulse-warn 1.6s ease-out infinite;
}

.project__dot.is-ready {
  background: var(--accent-2);
  box-shadow: 0 0 10px rgba(190, 195, 205, 0.7);
}

.project__dot.is-error {
  background: var(--danger);
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

@keyframes pulse-warn {
  0% { box-shadow: 0 0 0 0 rgba(255, 196, 92, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(255, 196, 92, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 196, 92, 0); }
}

.project__name {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 0;
}

.project__state {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.project__state.is-error { color: var(--danger); }

.topbar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

/* =========================================================
   Buttons
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--field-2);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  padding: 9px 14px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1), background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.btn svg { width: 17px; height: 17px; flex-shrink: 0; }

.btn:hover {
  background: var(--field);
  border-color: var(--line-3);
}

.btn:active { transform: scale(0.985); }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  background: var(--btn-bg);
  color: var(--btn-text);
  border-color: transparent;
  box-shadow: 0 10px 26px -14px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.btn--primary:hover {
  background: var(--btn-hover);
  border-color: transparent;
  box-shadow: 0 14px 32px -14px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line-2);
}

.btn--ghost:hover { background: var(--field-2); }

.btn--sm {
  padding: 7px 11px;
  font-size: 12px;
  gap: 6px;
}

.btn--sm svg { width: 15px; height: 15px; }

.btn--lg {
  padding: 11px 18px;
  font-size: 13.5px;
  border-radius: 10px;
}

.btn--xl {
  min-height: 52px;
  padding: 13px 24px;
  font-size: 15px;
  border-radius: 12px;
}

.btn--xl svg { width: 19px; height: 19px; }

.btn--wide { width: 100%; }

.btn--quiet {
  border-color: transparent;
  color: var(--muted);
  background: transparent;
}

.btn--quiet:hover {
  color: var(--text);
  background: var(--field-2);
  border-color: transparent;
}

.btn--cta {
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  border-radius: 10px;
  font-size: 14.5px;
  gap: 9px;
}

.btn--cta svg { width: 19px; height: 19px; }

.cta__meta {
  font-size: 10.5px;
  font-weight: 650;
  opacity: 0.55;
  padding-left: 9px;
  border-left: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  font-variant-numeric: tabular-nums;
}

.icon-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.icon-btn:hover {
  background: var(--field-2);
  border-color: var(--line);
  color: var(--text);
}

.icon-btn:active { transform: scale(0.94); }

.icon-btn svg { width: 17px; height: 17px; }

.icon-btn--solid {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  box-shadow: 0 6px 18px -8px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.icon-btn--solid:hover {
  background: var(--accent-2);
  color: var(--accent-ink);
}

.icon-btn--tiny {
  width: 27px;
  height: 27px;
  border-radius: 6px;
}

.icon-btn--tiny svg { width: 14px; height: 14px; }

.theme-toggle { position: relative; }
.icon--sun { display: none; }
.icon--moon { display: block; }
html[data-theme="dark"] .icon--sun { display: block; }
html[data-theme="dark"] .icon--moon { display: none; }

.icon--pause { display: none; }
.is-playing .icon--play { display: none; }
.is-playing .icon--pause { display: block; }

.icon--muted { display: none; }
.is-muted .icon--volume { display: none; }
.is-muted .icon--muted { display: block; }

/* =========================================================
   Studio layout
   ========================================================= */

.studio {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
}

.rail {
  position: relative;
  border-right: 1px solid var(--line);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 0;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}

.rail__btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 58px;
  padding: 7px 4px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.rail__btn:hover {
  background: var(--field-2);
  color: var(--text);
}

.rail__btn.is-active {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--text);
}

.rail__indicator {
  position: absolute;
  left: -8px;
  top: 0;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease;
}

.rail__indicator.is-visible { opacity: 1; }

.rail__icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}

.rail__icon svg { width: 21px; height: 21px; }

.rail__btn.is-active .rail__icon { color: var(--accent-text); }

.rail__btn--muted { color: var(--muted-2); }
.rail__spacer { flex: 1; }

.workspace {
  min-width: 0;
  min-height: 0;
  padding: 10px;
}

.workspace__main {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--inspector-w, 330px);
  grid-template-rows: minmax(0, 1fr) 238px;
  gap: 10px;
}

/* =========================================================
   Preview
   ========================================================= */

.preview {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  min-width: 0;
  min-height: 0;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--video-bg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
}

.preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 70% at 50% 0%, rgba(255, 255, 255, 0.04), transparent 65%),
    linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.35));
  pointer-events: none;
  z-index: 0;
}

.preview video {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}

.preview__empty {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 7px;
  padding: 24px;
  background:
    radial-gradient(60% 60% at 50% 42%, rgba(255, 255, 255, 0.035), transparent 70%),
    var(--video-bg);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.preview__empty.is-hidden {
  opacity: 0;
  transform: scale(0.985);
  pointer-events: none;
}

.empty__mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  border-radius: 16px;
  border: 1px solid var(--line-2);
  background: var(--field-2);
  color: var(--accent-text);
  box-shadow: 0 12px 30px -14px rgba(0, 0, 0, 0.5), var(--inset);
}

.empty__mark svg { width: 34px; height: 34px; }

.preview__empty h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: #f4f6f8;
}

.preview__empty p {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

.preview__empty .btn { margin-top: 14px; }

.empty__hint {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.32);
}

.preview__hud {
  position: absolute;
  top: 11px;
  left: 11px;
  right: 11px;
  z-index: 3;
  display: flex;
  gap: 5px;
  pointer-events: none;
}

.hud-pill {
  max-width: 62%;
  padding: 5px 9px;
  border-radius: 6px;
  background: rgba(8, 10, 14, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: rgba(255, 255, 255, 0.9);
  font-size: 10.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-pill--muted { color: rgba(255, 255, 255, 0.55); }

.preview__overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.bigplay {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(10, 12, 16, 0.44);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.bigplay svg { width: 26px; height: 26px; }
.bigplay__pause { display: none; }

.bigplay:hover {
  transform: scale(1.06);
  background: rgba(20, 24, 30, 0.58);
}

.preview.is-playing .bigplay {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
}

.preview.is-playing .bigplay__play { display: none; }
.preview.is-playing .bigplay__pause { display: block; }

.preview__controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 22px 11px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
}

.preview__controls .icon-btn {
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.18);
}

.preview__controls .icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.preview__controls .icon-btn--solid {
  color: var(--accent-ink);
  border-color: transparent;
  background: var(--accent);
}

.controls__spacer { flex: 1; }

.timecode {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.9);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.timecode__sep,
.timecode__total { color: rgba(255, 255, 255, 0.45); }

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.7);
  border-radius: 7px;
  padding: 6px 9px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.chip-btn svg { width: 13px; height: 13px; }
.chip-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.12); transform: translateY(-1px); }
.chip-btn:active { transform: scale(0.97); }

.preview:fullscreen {
  border-radius: 0;
  border: 0;
  background: #000;
}

.preview:fullscreen video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.preview:fullscreen .bigplay,
.preview:fullscreen .preview__hud,
.preview:fullscreen .preview__controls {
  display: none;
}

/* =========================================================
   Inspector
   ========================================================= */

.inspector {
  grid-column: 2;
  grid-row: 1 / span 2;
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.inspector__head {
  height: 45px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 14px;
  border-bottom: 1px solid var(--line);
}

.inspector__title {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.inspector__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.inspector__body::-webkit-scrollbar { width: 6px; }
.inspector__body::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

.panel {
  display: none;
  padding: 16px;
  animation: panel-in 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.panel.is-active { display: block; }

@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.panel__lead { margin-bottom: 18px; }

.panel__eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--accent-text);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel__lead h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 680;
  letter-spacing: -0.035em;
}

.panel__lead p {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.panel__note {
  margin: 14px 0 0;
  font-size: 11px;
  line-height: 1.55;
  color: var(--muted-2);
}

.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.media-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px;
  margin-bottom: 9px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--field-2);
}

.media-card__icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.media-card__icon svg { width: 18px; height: 18px; }

.media-card__icon--music {
  background: var(--field-2);
  color: var(--muted);
}

html[data-theme="dark"] .media-card__icon--music {
  background: var(--field-2);
  color: var(--muted);
}

.media-card__body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.media-card__body strong {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-card__body span {
  color: var(--muted-2);
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-card .btn--wide { margin-top: 2px; }

#addVideoBtn,
#addMusicBtn { margin-bottom: 9px; }

#addMusicBtn { margin-top: 1px; }

.info-strip {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 15px;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--field-2);
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.5;
}

.info-strip svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}

.info-strip--warn {
  border-color: color-mix(in srgb, var(--warning) 24%, transparent);
  background: color-mix(in srgb, var(--warning) 7%, transparent);
  color: color-mix(in srgb, var(--warning) 82%, var(--text));
}

.segment-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--field-2);
}

.segment-summary .field-label { margin-bottom: 2px; }

.segment-summary strong {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
}

.segment-summary__count {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.trim-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.field { display: block; min-width: 0; }

.field-box {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 9px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--field);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-box:focus-within {
  border-color: var(--accent-text);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.field-box input {
  width: 100%;
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  padding: 0;
}

.field-box__hint {
  display: none;
  color: var(--muted-2);
  font-size: 8px;
  white-space: nowrap;
  letter-spacing: 0.03em;
}

.length-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 12px;
  font-size: 11px;
  color: var(--muted-2);
}

.length-row strong {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.segment-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 13px 0 10px;
}

.segment-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--field-2);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.segment-item:hover { border-color: var(--line-2); }

.segment-item.is-active {
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  background: var(--accent-soft);
}

.segment-item__index {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--field-2);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
}

.segment-item.is-active .segment-item__index {
  background: var(--accent);
  color: var(--accent-ink);
}

.segment-item__body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.segment-item__body strong {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.segment-item__body span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
}

.segment-item__move {
  display: flex;
  gap: 1px;
}

.segment-item__move button {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  padding: 0;
}

.segment-item__move button:hover { background: var(--field); color: var(--text); }
.segment-item__move button:disabled { opacity: 0.25; cursor: default; }
.segment-item__move svg { width: 12px; height: 12px; }

.audio-block {
  padding: 11px;
  margin-bottom: 9px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--field-2);
}

.audio-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.audio-block__title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.audio-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.audio-icon svg { width: 16px; height: 16px; }

.audio-icon--music {
  background: var(--field-2);
  color: var(--muted);
}

html[data-theme="dark"] .audio-icon--music {
  background: var(--field-2);
  color: var(--muted);
}

.audio-block__title div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.audio-block__title strong {
  font-size: 12px;
  font-weight: 600;
}

.audio-block__title span {
  color: var(--muted-2);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toggle {
  width: 34px;
  height: 19px;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--field-2);
  padding: 2px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.toggle span {
  display: block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--muted-2);
  transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.2, 1), background 0.2s ease;
}

.toggle[aria-checked="true"] {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
}

.toggle[aria-checked="true"] span {
  transform: translateX(15px);
  background: var(--accent);
}

.range-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  font-size: 10.5px;
  color: var(--muted-2);
}

.range-row > span { flex-shrink: 0; }

.range-row strong {
  width: 34px;
  text-align: right;
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  flex: 1;
  border-radius: 999px;
  background: var(--line-2);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  cursor: pointer;
  user-select: none;
}

.check-row input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.check-row__box {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  margin-top: 1px;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  background: var(--field);
  display: grid;
  place-items: center;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.check-row__box::after {
  content: "";
  width: 7px;
  height: 4px;
  border-left: 1.6px solid var(--accent-ink);
  border-bottom: 1.6px solid var(--accent-ink);
  transform: rotate(-45deg) translateY(-1px) scale(0);
  transition: transform 0.16s ease;
}

.check-row input:checked + .check-row__box {
  background: var(--accent);
  border-color: var(--accent);
}

.check-row input:checked + .check-row__box::after { transform: rotate(-45deg) translateY(-1px) scale(1); }

.check-row input:focus-visible + .check-row__box {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

.check-row__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.check-row__text strong {
  font-size: 11.5px;
  font-weight: 600;
}

.check-row__text small {
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.4;
}

.check-row--compact { margin-top: 9px; }

.export-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-bottom: 15px;
}

.export-summary > div {
  padding: 8px 7px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--field-2);
}

.export-summary span {
  display: block;
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.export-summary strong {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.segmented {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--field-2);
  margin-bottom: 6px;
}

.segmented--wide .segmented__btn { flex: 1; }

.segmented__btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.segmented__btn:hover { color: var(--text); }

.segmented__btn.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 4px 12px -6px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.segmented__btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.mode-desc {
  margin: 0 0 13px;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.5;
}

.quality-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  padding: 3px;
  margin-bottom: 13px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--field-2);
}

.quality-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 6px 2px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.quality-btn:hover { color: var(--text); }

.quality-btn.is-active {
  background: var(--field);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), var(--inset);
}

#engineNote { text-align: center; }

/* =========================================================
   Timeline
   ========================================================= */

.timeline {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 7px 9px 6px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.timeline__toolbar {
  height: 31px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 5px;
}

.timeline__tools {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 5px 7px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.tool-btn svg { width: 14px; height: 14px; }
.tool-btn:hover { background: var(--field-2); color: var(--text); }
.tool-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.tool-btn--quiet { color: var(--muted-2); }

.timeline__divider {
  width: 1px;
  height: 16px;
  margin: 0 4px;
  background: var(--line);
}

.timeline__meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.02em;
}

.timeline__ruler {
  position: relative;
  height: 17px;
  flex-shrink: 0;
  margin: 0 0 3px 78px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  user-select: none;
  pointer-events: none;
}

.ruler__tick {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 4px;
  background: var(--line-2);
}

.ruler__tick--major { height: 7px; }

.ruler__label {
  position: absolute;
  bottom: 8px;
  transform: translateX(-50%);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  white-space: nowrap;
}

.timeline__tracks {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
}

.track {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-height: 0;
}

.track--video { flex: 1; min-height: 82px; }
.track--audio { flex-shrink: 0; height: 50px; }

.track__label {
  width: 72px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.track__icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--field-2);
  color: var(--muted);
}

.track__icon svg { width: 12px; height: 12px; }

.track__lane {
  position: relative;
  flex: 1;
  min-width: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--video-bg);
  border: 1px solid var(--line);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.track--video .track__lane {
  overflow: visible;
}

.track__lane--audio {
  height: 50px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 42%),
    var(--field-2);
  border-color: var(--line);
  overflow: visible;
}

#filmstrip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
}

.track__lane.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.06) 50%, transparent 80%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ---------- skeleton loaders ---------- */

@keyframes skeleton-sweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.skeleton {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: color-mix(in srgb, var(--text, #f4f4f5) 8%, transparent);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 10%, color-mix(in srgb, var(--text, #f4f4f5) 12%, transparent) 50%, transparent 90%);
  animation: skeleton-sweep 1.35s ease-in-out infinite;
}

.preview__skeleton {
  position: absolute;
  inset: 0;
  z-index: 4;
  padding: 14px;
  background: var(--video-bg, #06070a);
}

.preview__skeleton[hidden] { display: none; }

.preview__skeleton .skeleton--screen {
  position: absolute;
  inset: 14px;
  border-radius: 10px;
}

.preview__skeleton .skeleton--pill {
  position: absolute;
  left: 28px;
  bottom: 26px;
  width: min(210px, 42%);
  height: 22px;
  border-radius: 999px;
}

.track__lane.is-loading {
  background-image: repeating-linear-gradient(
    90deg,
    color-mix(in srgb, var(--text) 7%, transparent) 0 8%,
    transparent 8% 10%
  );
}

.media-card.is-loading .media-card__body strong,
.media-card.is-loading .media-card__body span {
  color: transparent;
  border-radius: 4px;
  background: color-mix(in srgb, var(--text) 10%, transparent);
  animation: skeleton-pulse 1.1s ease-in-out infinite alternate;
}

@keyframes skeleton-pulse {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

.project-card--skeleton {
  pointer-events: none;
  cursor: default;
}

.project-card--skeleton .project-card__body {
  width: 100%;
  align-self: stretch;
  gap: 8px;
  padding: 13px 14px 8px;
}

.project-card--skeleton .skeleton--thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
}

.project-card--skeleton .skeleton--line {
  width: 100%;
  height: 10px;
  border-radius: 999px;
}

.project-card--skeleton .skeleton--line-short {
  width: 58%;
  height: 8px;
}

.segments {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.segment-block {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-radius: 6px;
  border: 1px solid rgba(150, 156, 168, 0.24);
  background: rgba(150, 156, 168, 0.045);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  pointer-events: auto;
  cursor: grab;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
  touch-action: none;
}

.segment-block::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 38%);
  pointer-events: none;
}

.segment-block:hover {
  border-color: rgba(150, 156, 168, 0.5);
  background: rgba(150, 156, 168, 0.08);
}

.segment-block.is-active {
  border-color: var(--timeline-accent);
  background: rgba(150, 156, 168, 0.1);
  box-shadow: 0 0 0 1px rgba(243, 244, 246, 0.35), 0 0 22px -6px var(--timeline-glow);
}

.segment-block.is-dragging {
  cursor: grabbing;
  z-index: 4;
  opacity: 0.9;
  transform: scale(1.01);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--timeline-accent);
}

.segment-block.is-drop-target {
  border-color: var(--timeline-accent);
  box-shadow: 0 0 0 2px rgba(243, 244, 246, 0.35);
}

.segment-block__label {
  position: absolute;
  left: 6px;
  top: 4px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.36);
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 600;
  pointer-events: none;
}

.segment-block.is-active .segment-block__label {
  background: var(--timeline-accent);
  color: var(--timeline-accent-ink);
}

.timeline__shade {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  background: rgba(4, 6, 10, 0.55);
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
}

.timeline__selection {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 3;
  border-top: 2px solid var(--timeline-accent);
  border-bottom: 2px solid var(--timeline-accent);
  background: rgba(150, 156, 168, 0.035);
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
}

.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  margin-left: -1px;
  z-index: 6;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.65);
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  will-change: left;
}

.playhead::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 24px;
  transform: translateX(-50%);
  cursor: grab;
}

.playhead span {
  position: absolute;
  top: 0;
  left: 50%;
  width: 16px;
  height: 20px;
  border-radius: 3px 3px 6px 6px;
  background: #fff;
  transform: translateX(-50%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
  cursor: grab;
}

.playhead span::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 5px;
  left: 50%;
  width: 6px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(90deg, #23262c 0 1px, transparent 1px 3px);
  opacity: 0.75;
}

.playhead.is-scrubbing,
.playhead.is-scrubbing span,
.playhead.is-scrubbing::before { cursor: grabbing; }

.playhead--audio { z-index: 6; opacity: 0.85; }

.timeline__handle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 44px;
  border-radius: 6px;
  border: 1px solid rgba(9, 11, 15, 0.24);
  background: linear-gradient(180deg, #fff, #dfe5ef);
  color: #11141a;
  display: grid;
  place-items: center;
  cursor: ew-resize;
  z-index: 7;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.85);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  padding: 0;
  touch-action: none;
}

.timeline__handle::after {
  content: "";
  position: absolute;
  inset: -8px -6px;
}

.timeline__handle:hover,
.timeline__handle:focus-visible {
  transform: translate(-50%, -50%) scale(1.1);
  background: #fff;
  outline: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 0 3px rgba(255, 255, 255, 0.2), inset 0 0 0 1px #fff;
}

.timeline__handle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.timeline__handle span {
  width: 6px;
  height: 18px;
  border-radius: 2px;
  background: repeating-linear-gradient(90deg, rgba(12, 15, 21, 0.62) 0 1.5px, transparent 1.5px 3.5px);
  pointer-events: none;
}

.timeline__handle--start { left: 2px; }
.timeline__handle--end { left: calc(100% - 2px); }

.timeline__handle:disabled { display: none; }

.timeline__handle[data-tip]::before {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 5px 8px;
  border-radius: 6px;
  background: #0d1016;
  color: #fff;
  font-size: 10px;
  font-weight: 550;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.14s ease, transform 0.14s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
  z-index: 40;
}

.timeline__handle[data-tip]:hover::before,
.timeline__handle[data-tip]:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.track__lane.is-dragging { cursor: grabbing; }

.music-clip {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(100% - 6px);
  border-radius: 8px;
  border: 1px solid rgba(203, 211, 225, 0.5);
  background:
    linear-gradient(180deg, rgba(228, 234, 246, 0.2), rgba(150, 160, 180, 0.1)),
    rgba(102, 112, 132, 0.2);
  overflow: visible;
  touch-action: none;
  cursor: grab;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 8px 20px -14px rgba(0, 0, 0, 0.85);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.music-clip:hover {
  border-color: rgba(238, 242, 250, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 10px 24px -14px rgba(0, 0, 0, 0.95);
}

.music-clip.is-dragging {
  cursor: grabbing;
  border-color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 0 2px rgba(255, 255, 255, 0.18), 0 12px 26px -14px #000;
}

.music-clip.is-muted { opacity: 0.58; }
.music-clip.is-muted .music-clip__wave-icon { display: none; }
.music-clip__mute-icon { display: none; }
.music-clip.is-muted .music-clip__mute-icon { display: block; }

.music-clip__wave {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 7px;
  opacity: 0.9;
  pointer-events: none;
}

.music-clip.is-muted .music-clip__wave { opacity: 0.35; }

.music-clip__info {
  position: absolute;
  top: 3px;
  left: 9px;
  right: 9px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  pointer-events: none;
}

.music-clip__name {
  min-width: 0;
  max-width: 100%;
  color: #f0f3fa;
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

.music-clip__time {
  flex-shrink: 0;
  margin-left: auto;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(8, 10, 14, 0.62);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.music-clip__actions {
  position: absolute;
  right: 6px;
  bottom: 3px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 3px;
}

.music-clip__action {
  position: relative;
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  background: rgba(10, 12, 17, 0.66);
  color: #e8ecf4;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}

.music-clip__action svg { width: 13px; height: 13px; }
.music-clip__action:hover {
  background: rgba(255, 255, 255, 0.96);
  border-color: #fff;
  color: #11141a;
  transform: translateY(-1px);
}
.music-clip__action:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.music-clip__action[data-music-action="delete"]:hover { background: #ff6b6b; border-color: #ff6b6b; color: #fff; }
.music-clip.is-muted .music-clip__action--mute { background: rgba(255, 107, 107, 0.9); border-color: #ff8d8d; color: #fff; }

.music-clip__handle {
  position: absolute;
  top: -2px;
  bottom: -2px;
  z-index: 4;
  width: 18px;
  padding: 0;
  border: 1px solid rgba(9, 11, 15, 0.22);
  border-radius: 6px;
  background: linear-gradient(180deg, #fff, #dfe5ef);
  cursor: ew-resize;
  touch-action: none;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.52), inset 0 0 0 1px rgba(255, 255, 255, 0.85);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.music-clip__handle::after {
  content: "";
  position: absolute;
  inset: -8px -6px;
}

.music-clip__handle span {
  width: 6px;
  height: 18px;
  border-radius: 2px;
  background: repeating-linear-gradient(90deg, rgba(12, 15, 21, 0.62) 0 1.5px, transparent 1.5px 3.5px);
  pointer-events: none;
}

.music-clip__handle:hover,
.music-clip__handle:focus-visible {
  background: #fff;
  outline: none;
  transform: scaleX(1.1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.music-clip__handle--start { left: -7px; }
.music-clip__handle--end { right: -7px; }

.music-clip__action[data-tip]::after,
.music-clip__handle[data-tip]::before {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 5px 8px;
  border-radius: 6px;
  background: #0d1016;
  color: #fff;
  font-size: 10px;
  font-weight: 550;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.14s ease, transform 0.14s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
  z-index: 40;
}

.music-clip__action[data-tip]:hover::after,
.music-clip__action[data-tip]:focus-visible::after,
.music-clip__handle[data-tip]:hover::before,
.music-clip__handle[data-tip]:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 760px) {
  .track--audio { height: 52px; }
  .track__lane--audio { height: 52px; }
  .music-clip__action { width: 23px; height: 23px; }
  .music-clip__handle { width: 22px; }
  .music-clip__handle--start { left: -9px; }
  .music-clip__handle--end { right: -9px; }
}

.timeline__hint {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 2px 0;
  color: var(--muted-2);
  font-size: 9.5px;
}

.kbd-hint { white-space: nowrap; }

/* =========================================================
   Welcome
   ========================================================= */

.welcome {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 22px 28px 20px;
  background:
    radial-gradient(90% 70% at 50% -10%, rgba(255, 255, 255, 0.42), transparent 60%),
    var(--welcome-bg);
  transition: opacity 0.55s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0.55s ease;
}

html[data-theme="dark"] .welcome {
  background:
    radial-gradient(90% 70% at 50% -10%, rgba(255, 255, 255, 0.035), transparent 60%),
    var(--welcome-bg);
}

.welcome.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.welcome__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  opacity: 0.55;
}

.welcome__glow--1 {
  width: 48vw;
  height: 48vw;
  min-width: 420px;
  min-height: 420px;
  top: -22vw;
  left: -8vw;
  background: var(--welcome-glow-1);
  animation: welcome-drift 18s ease-in-out infinite alternate;
}

.welcome__glow--2 {
  width: 40vw;
  height: 40vw;
  min-width: 360px;
  min-height: 360px;
  right: -12vw;
  bottom: -18vw;
  background: var(--welcome-glow-2);
  animation: welcome-drift 22s ease-in-out infinite alternate-reverse;
}

@keyframes welcome-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(4vw, 3vw, 0) scale(1.1); }
}

.welcome__grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--welcome-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--welcome-grid) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 42%, #000 10%, transparent 78%);
  mask-image: radial-gradient(70% 60% at 50% 42%, #000 10%, transparent 78%);
  opacity: 0.65;
}

.welcome__top {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.welcome__brand {
  font-size: 14px;
  font-weight: 720;
  letter-spacing: -0.03em;
}

.welcome__brand em {
  margin-left: 4px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.welcome__center {
  position: relative;
  z-index: 3;
  width: min(760px, 100%);
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 22px 0 10px;
}

.welcome__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--welcome-card);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  box-shadow: var(--inset);
}

.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(190, 195, 205, 0.5);
  animation: pulse 2.4s ease-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(190, 195, 205, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(190, 195, 205, 0); }
  100% { box-shadow: 0 0 0 0 rgba(190, 195, 205, 0); }
}

.welcome h1 {
  margin: 18px 0 0;
  font-size: clamp(52px, 8vw, 94px);
  line-height: 0.92;
  letter-spacing: -0.06em;
  font-weight: 720;
}

.welcome__accent {
  color: var(--muted-2);
}

html[data-theme="dark"] .welcome__accent {
  color: var(--muted-2);
}

.welcome__lead {
  max-width: 590px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
}

.welcome__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 25px;
}

.welcome__drop {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  color: var(--muted-2);
  font-size: 11px;
}

.welcome__drop svg { width: 14px; height: 14px; }

.welcome__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 17px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
}

.welcome__preview {
  position: absolute;
  right: 3.5vw;
  bottom: 6.5vh;
  z-index: 2;
  width: min(430px, 34vw);
  transform: rotate(-2.5deg);
  opacity: 0.72;
  pointer-events: none;
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.35));
  animation: mock-float 9s ease-in-out infinite alternate;
}

@keyframes mock-float {
  from { transform: rotate(-2.5deg) translateY(0); }
  to { transform: rotate(-1.2deg) translateY(-12px); }
}

.mock-window {
  border-radius: 12px;
  border: 1px solid var(--welcome-border);
  background: var(--welcome-card);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, 0.45), var(--inset);
  overflow: hidden;
}

.mock-window__bar {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 27px;
  padding: 0 9px;
  border-bottom: 1px solid var(--line);
}

.mock-window__bar span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line-3);
}

.mock-window__bar em {
  margin-left: 6px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  font-style: normal;
}

.mock-window__stage {
  display: flex;
  gap: 7px;
  padding: 8px;
}

.mock-window__screen {
  position: relative;
  flex: 1;
  aspect-ratio: 16 / 9;
  border-radius: 7px;
  background:
    radial-gradient(60% 80% at 50% 50%, rgba(150, 156, 168, 0.18), transparent 70%),
    #0a0c10;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
}

.mock-window__play {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  position: relative;
}

.mock-window__play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border-left: 7px solid rgba(255, 255, 255, 0.8);
  border-top: 4.5px solid transparent;
  border-bottom: 4.5px solid transparent;
  transform: translate(-40%, -50%);
}

.mock-window__caption {
  position: absolute;
  left: 7px;
  bottom: 6px;
  color: rgba(255, 255, 255, 0.45);
  font-family: var(--mono);
  font-size: 7px;
}

.mock-window__side {
  width: 72px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 2px;
}

.mock-line {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: var(--line-2);
}

.mock-line--1 { width: 80%; }
.mock-line--2 { width: 58%; }
.mock-line--3 { width: 70%; }

.mock-swatch {
  display: block;
  height: 24px;
  margin-top: 3px;
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(150, 156, 168, 0.3), rgba(190, 195, 205, 0.15));
  border: 1px solid rgba(150, 156, 168, 0.2);
}

.mock-timeline {
  position: relative;
  display: flex;
  gap: 4px;
  height: 33px;
  padding: 7px 8px;
  border-top: 1px solid var(--line);
}

.mock-clip {
  display: block;
  height: 100%;
  border-radius: 3px;
  border: 1px solid rgba(150, 156, 168, 0.24);
  background: rgba(150, 156, 168, 0.1);
}

.mock-clip--1 { width: 28%; }
.mock-clip--2 { width: 38%; }
.mock-clip--3 { width: 22%; }

.mock-playhead {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 56%;
  width: 1px;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.mock-playhead::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: #fff;
  transform: translateX(-50%);
}

.welcome__footer {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.03em;
}

.welcome__footer-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}

.welcome .icon-btn { color: var(--muted); }

/* =========================================================
   Drop overlay
   ========================================================= */

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(5, 7, 10, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.drop-overlay__inner {
  width: min(480px, 86vw);
  padding: 36px 28px;
  border-radius: 18px;
  border: 1.5px dashed var(--accent);
  background: rgba(150, 156, 168, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 7px;
  color: #fff;
  box-shadow: 0 0 60px -12px var(--accent-glow);
}

.drop-overlay__inner svg {
  width: 42px;
  height: 42px;
  color: var(--accent);
  margin-bottom: 5px;
}

.drop-overlay__inner strong {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.drop-overlay__inner span {
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
}

/* =========================================================
   Modals
   ========================================================= */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 8, 0.7);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  animation: fade-in 0.25s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal__card {
  position: relative;
  width: min(500px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 26px;
  border-radius: 18px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  box-shadow: var(--shadow), var(--inset);
  animation: modal-in 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

/* Beat the generic .icon-btn { position: relative } rule for every modal X. */
.modal .modal__close {
  position: absolute;
}

.modal__card--help { width: min(560px, 100%); }

.modal__card h2 {
  margin: 8px 0 4px;
  font-size: 23px;
  font-weight: 680;
  letter-spacing: -0.035em;
}

.export-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 10px 4px 4px;
}

.progress-ring {
  position: relative;
  width: 124px;
  height: 124px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}

.progress-ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-ring circle {
  fill: none;
  stroke-width: 7;
}

.progress-ring__track { stroke: var(--line); }

.progress-ring__value-circle {
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 0.25s ease;
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.progress-ring__value {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.export-progress h2 { margin-top: 0; }

.export-progress p {
  margin: 0;
  min-height: 17px;
  color: var(--muted);
  font-size: 12px;
}

.processing__bar {
  width: min(300px, 100%);
  height: 5px;
  margin-top: 16px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.processing__bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px var(--accent-glow);
  transition: width 0.2s ease;
}

.export-progress .btn { margin-top: 18px; }

.export-error {
  width: min(360px, 100%);
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--danger) 32%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--danger) 9%, transparent);
  color: var(--danger);
  font-size: 11.5px;
  line-height: 1.45;
}

.export-error[hidden] { display: none; }
.export-error span { display: block; }
.export-error .btn { margin-top: 10px; }

.export-result {
  text-align: center;
  padding: 4px 0 0;
}

.result__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  color: var(--accent-text);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.result__badge svg { width: 13px; height: 13px; }

.result__sub {
  margin: 0;
  color: var(--muted-2);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.export-result video {
  display: block;
  width: 100%;
  max-height: 260px;
  margin: 14px 0;
  border-radius: 10px;
  background: #000;
  border: 1px solid var(--line-2);
}

.result__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.result__stats > div {
  padding: 9px 6px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--field-2);
}

.result__stats span {
  display: block;
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result__stats strong {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.result__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 15px;
}

.result__actions .btn--cta {
  width: auto;
  min-width: 210px;
  margin-top: 0;
  min-height: 44px;
  font-size: 13px;
}

.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

.help-grid > div {
  padding: 10px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--field-2);
}

.help-grid strong {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
  font-weight: 650;
}

.help-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.help-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 10.5px;
}

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

@media (max-width: 1180px) {
  .workspace__main { grid-template-columns: minmax(0, 1fr) var(--inspector-w, 310px); }
  .welcome__preview { width: min(380px, 32vw); opacity: 0.5; }
}

@media (max-width: 980px) {
  .workspace__main { grid-template-columns: minmax(0, 1fr) var(--inspector-w, 286px); }
  .rail { width: auto; }
  .studio { grid-template-columns: 68px minmax(0, 1fr); }
  .rail__btn { min-height: 54px; font-size: 9px; }
  .welcome__preview { display: none; }
}

@media (max-width: 760px) {
  body { overflow: auto; }
  .app { height: auto; min-height: 100dvh; }
  .topbar { height: 54px; gap: 10px; padding: 0 10px; }
  .logo__tag { display: none; }
  .project { max-width: none; }
  .project__state { display: none; }
  .topbar__import span { display: none; }
  .topbar__import { padding: 7px 9px; }
  .studio { display: flex; flex-direction: column; min-height: 0; }
  .rail {
    order: 2;
    flex-direction: row;
    align-items: stretch;
    gap: 2px;
    padding: 5px 7px;
    border-right: 0;
    border-top: 1px solid var(--line);
    overflow-x: auto;
    background: var(--bg);
  }
  .rail__btn {
    flex: 1;
    min-width: 62px;
    min-height: 48px;
    flex-direction: row;
    gap: 5px;
    padding: 5px 6px;
    font-size: 9.5px;
  }
  .rail__indicator { display: none; }
  .rail__spacer { display: none; }
  .rail__btn--muted { flex: 0 0 44px; min-width: 44px; }
  .rail__btn--muted span:last-child { display: none; }
  .workspace { order: 1; padding: 7px; }
  .workspace__main {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
    gap: 7px;
  }
  .preview { order: 1; }
  .timeline { order: 2; }
  .inspector { order: 3; }
  .preview {
    height: 38vh;
    min-height: 220px;
    max-height: 420px;
    flex-shrink: 0;
  }
  .preview__empty h2 { font-size: 18px; }
  .preview__empty p { font-size: 12px; }
  .preview__empty .btn--lg { min-height: 40px; padding: 9px 14px; font-size: 12px; }
  .timeline { height: 212px; flex-shrink: 0; }
  .inspector {
    max-height: 52vh;
    flex-shrink: 0;
  }
  .timeline__hint { display: none; }
  .timeline__ruler { margin-left: 66px; }
  .track__label { width: 60px; }
  .track__label span:last-child { display: none; }
  .track__label { justify-content: center; }
  .welcome { padding: 16px; overflow-y: auto; }
  .welcome__center { padding-top: 8vh; padding-bottom: 4vh; }
  .welcome h1 { font-size: clamp(44px, 13vw, 70px); }
  .welcome__lead { font-size: 13px; }
  .welcome__actions { flex-direction: column; width: 100%; max-width: 320px; }
  .welcome__actions .btn { width: 100%; }
  .welcome__footer { margin-top: auto; }
  .modal__card { padding: 20px; }
  .help-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .topbar { height: 50px; }
  .logo__word { font-size: 14px; }
  .logo__mark { width: 26px; height: 26px; }
  .project__name { font-size: 12px; }
  .topbar__actions .btn span { display: none; }
  .topbar__actions .btn { padding: 7px 9px; }
  .topbar__actions .btn svg { width: 16px; height: 16px; }
  .icon-btn { width: 30px; height: 30px; }
  .preview { height: 34vh; min-height: 190px; }
  .preview__controls { gap: 5px; padding: 18px 8px 8px; }
  .preview__controls .chip-btn { display: none; }
  .timecode { font-size: 10px; }
  .timeline { height: 204px; padding: 6px 7px 5px; }
  .timeline__meta { font-size: 8.5px; }
  .tool-btn span { display: none; }
  .tool-btn { padding: 5px 6px; }
  .timeline__ruler { margin-left: 0; }
  .track__label { display: none; }
  .segment-block__label { font-size: 7px; }
  .inspector { max-height: 58vh; }
  .export-summary strong { font-size: 10px; }
  .welcome__eyebrow { font-size: 9px; }
  .welcome__meta { font-size: 8.5px; gap: 7px; }
  .welcome__drop { font-size: 10px; }
  .result__actions .btn--cta { width: 100%; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================================================
   Launch screen - compact editor-first card
   ========================================================= */

.welcome {
  background: rgba(238, 241, 246, 0.62);
  -webkit-backdrop-filter: blur(9px) saturate(115%);
  backdrop-filter: blur(9px) saturate(115%);
}

html[data-theme="dark"] .welcome {
  background: rgba(5, 6, 9, 0.6);
}

.welcome__glow {
  opacity: 0.18;
  filter: blur(120px);
}

.welcome__grid {
  opacity: 0.2;
}

.welcome__top {
  align-items: center;
}

.welcome__brand {
  font-size: 15px;
}

.welcome__center {
  width: min(520px, 100%);
  max-height: calc(100dvh - 110px);
  margin: auto;
  padding: 30px 30px 26px;
  overflow-y: auto;
  align-items: stretch;
  text-align: left;
  border-radius: 22px;
  border: 1px solid var(--welcome-border);
  background: var(--welcome-card);
  -webkit-backdrop-filter: blur(30px) saturate(165%);
  backdrop-filter: blur(30px) saturate(165%);
  box-shadow: 0 34px 90px -34px rgba(0, 0, 0, 0.62), var(--inset);
  animation: launch-card-in 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.welcome__center::-webkit-scrollbar { width: 6px; }
.welcome__center::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

@keyframes launch-card-in {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.welcome__eyebrow {
  align-self: flex-start;
  background: var(--field-2);
  border-color: var(--line-2);
  box-shadow: none;
}

.welcome h1 {
  margin: 16px 0 0;
  font-size: clamp(30px, 4.2vw, 40px);
  line-height: 1.04;
  letter-spacing: -0.05em;
  font-weight: 720;
  text-align: left;
}

.welcome__lead {
  max-width: none;
  margin: 12px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
  text-align: left;
}

.welcome__actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 22px;
}

.welcome__actions .btn--xl {
  min-height: 48px;
  padding: 11px 18px;
  font-size: 14px;
  border-radius: 11px;
}

.welcome__actions .btn--primary {
  flex: 1 1 180px;
}

.welcome__actions .btn--ghost {
  flex: 0 1 auto;
}

.welcome__drop {
  justify-content: flex-start;
  margin-top: 14px;
}

.welcome__meta {
  justify-content: flex-start;
  margin-top: 14px;
}

.welcome__footer {
  margin-top: auto;
}

.welcome__preview {
  display: none !important;
}

@media (max-width: 860px) {
  .welcome {
    padding: 16px;
    overflow-y: auto;
  }
  .welcome__center {
    width: min(520px, 100%);
    max-height: none;
    margin: auto;
    padding: 24px 20px 22px;
    border-radius: 18px;
  }
  .welcome h1 {
    font-size: clamp(28px, 8vw, 36px);
  }
  .welcome__lead {
    font-size: 12.5px;
  }
  .welcome__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .welcome__actions .btn {
    flex: 0 0 auto;
    width: 100%;
  }
  .welcome__footer {
    justify-content: center;
    margin-top: 22px;
  }
}

@media (max-width: 520px) {
  .welcome__center {
    padding: 20px 16px 18px;
  }
  .welcome h1 {
    font-size: 27px;
  }
  .welcome__meta {
    font-size: 8.5px;
    gap: 7px;
  }
}

/* =========================================================
   Small editor refinements
   ========================================================= */

.inspector.is-hidden {
  display: none;
}

.workspace__main.is-inspector-hidden {
  grid-template-columns: minmax(0, 1fr);
}

.quality-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.segment-block {
  overflow: hidden;
}

.track__lane.is-reordering {
  cursor: grabbing;
}

.segment-block.is-dragging {
  pointer-events: none;
}

.drop-overlay {
  z-index: 150;
}



/* =========================================================
   Account / profile
   ========================================================= */

.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px 4px 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--field-2);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.account-btn:hover {
  background: var(--field);
  border-color: var(--line-2);
  transform: translateY(-1px);
}

.account-btn:active { transform: scale(0.98); }

.account-btn__avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--text);
  color: var(--panel);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.account-btn__label {
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-btn--welcome {
  background: var(--welcome-card);
  border-color: var(--welcome-border);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.welcome__top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account__lead {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.account__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account__field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.account__field em {
  color: var(--muted-2);
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.75;
}

.account__field .field-box { padding: 9px 10px; }

.account__field .field-box input {
  font-family: var(--font);
  font-size: 13px;
  font-variant-numeric: normal;
}

/* =========================================================
   Editor entrance / micro-animations
   ========================================================= */

.app.is-entered .workspace {
  animation: workspace-in 0.62s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.app.is-entered .rail {
  animation: rail-in 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes workspace-in {
  from { transform: translateY(10px) scale(0.996); }
  to { transform: none; }
}

@keyframes rail-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: none; }
}

.segment-block:hover {
  transform: translateY(-1px);
}

.segment-block.is-active:hover {
  transform: translateY(-1px);
}

.timeline__handle:active {
  transform: translate(-50%, -50%) scale(0.96);
}

.rail__btn .rail__icon {
  transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.rail__btn:hover .rail__icon {
  transform: translateY(-1px);
}

.btn--primary:hover {
  transform: translateY(-1px);
}

.btn--primary:active {
  transform: translateY(0) scale(0.985);
}

@media (max-width: 860px) {
  .account-btn__label { display: none; }
  .account-btn { padding-right: 5px; }
  .welcome__top-actions .account-btn__label { display: none; }
}


/* Launch card mini timeline */
.welcome__strip {
  position: relative;
  height: 30px;
  margin-top: 18px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0d0f13;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 8px 20px -14px rgba(0, 0, 0, 0.6);
}

.welcome__strip::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 26px);
  opacity: 0.6;
}

.welcome__strip-clip {
  position: absolute;
  top: 5px;
  bottom: 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 55%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 14px),
    rgba(255, 255, 255, 0.06);
}

.welcome__strip-clip:nth-child(2) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 55%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.09) 0 1px, transparent 1px 12px),
    rgba(255, 255, 255, 0.09);
}

.welcome__strip-clip:nth-child(3) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), transparent 55%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 16px),
    rgba(255, 255, 255, 0.05);
}

.welcome__strip-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1.5px;
  background: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
  animation: strip-play 6s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes strip-play {
  0% { left: 2%; }
  50% { left: 62%; }
  100% { left: 98%; }
}

@media (max-width: 860px) {
  .welcome__strip { margin-top: 15px; }
}


/* Mini timeline polish */
.welcome__strip {
  height: 34px;
  padding: 6px 0;
  background: #0a0c10;
}

.welcome__strip::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 1px, transparent 1px 26px);
  opacity: 0.55;
}

.welcome__strip-clip {
  top: 7px;
  bottom: 5px;
  border-color: rgba(255, 255, 255, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 58%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.11) 0 1px, transparent 1px 14px),
    rgba(255, 255, 255, 0.12);
}

.welcome__strip-clip:nth-child(2) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent 58%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.13) 0 1px, transparent 1px 12px),
    rgba(255, 255, 255, 0.17);
}

.welcome__strip-clip:nth-child(3) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 58%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px 16px),
    rgba(255, 255, 255, 0.1);
}

.welcome__strip-playhead {
  width: 2px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.95);
}

.welcome__strip-playhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: -3px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #ffffff;
}


/* =========================================================
   Empty timeline + compact viewport layout
   ========================================================= */

.track__empty {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--muted-2);
  font-size: 10.5px;
  letter-spacing: 0.01em;
  text-align: center;
  pointer-events: none;
}

.track__empty svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.7;
}

.track__lane.has-media .track__empty { display: none; }

.timeline.is-empty .timeline__ruler { opacity: 0.3; }

@media (max-width: 760px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .app {
    height: 100dvh;
    min-height: 0;
  }

  .studio {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .workspace {
    order: 1;
    flex: 1;
    min-height: 0;
    display: flex;
    padding: 7px;
  }

  .workspace__main {
    flex: 1;
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
  }

  .preview {
    order: 1;
    flex: 1 1 auto;
    height: auto;
    min-height: 140px;
    max-height: none;
  }

  .timeline {
    order: 2;
    flex: 0 0 auto;
    height: clamp(176px, 30dvh, 218px);
  }

  .rail {
    order: 2;
    flex: 0 0 auto;
  }

  .inspector {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(59px + env(safe-area-inset-bottom, 0px));
    z-index: 90;
    height: clamp(176px, 30dvh, 218px);
    max-height: none;
    border-radius: 16px;
    box-shadow: 0 -24px 64px -24px rgba(0, 0, 0, 0.7), var(--inset);
    animation: inspector-sheet-in 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  .app.is-entered .workspace {
    animation: none;
  }

  .inspector.is-hidden { display: none; }

  .inspector__head {
    height: 42px;
    padding-left: 16px;
  }

  .panel {
    padding: 12px 14px;
  }

  .panel__lead {
    margin-bottom: 10px;
  }

  .panel__lead h3,
  .panel__lead p {
    display: none;
  }

  .panel[data-panel="media"] .info-strip {
    display: none;
  }

  .welcome {
    padding: 16px;
    overflow-y: auto;
  }

  .welcome__center {
    width: 100%;
    max-height: calc(100dvh - 64px);
    padding: 24px 20px 22px;
  }

  .welcome h1 {
    font-size: clamp(34px, 9.5vw, 48px);
  }

  .welcome__actions {
    max-width: none;
  }

  .welcome__actions .btn {
    width: 100%;
  }
}

@keyframes inspector-sheet-in {
  from { opacity: 0; transform: translateY(18px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

/* =========================================================
   Feature batch: saved badge, theme morph, sheet grip,
   compression, projects library, red export CTA
   ========================================================= */

.project__saved {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  animation: saved-in 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.project__saved svg {
  width: 11px;
  height: 11px;
}

@keyframes saved-in {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: none; }
}

/* Moon turns into sun and back */
.icon-btn.is-switching svg,
.welcome__theme.is-switching svg {
  animation: theme-morph 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes theme-morph {
  0% { opacity: 0; transform: rotate(-130deg) scale(0.35); }
  55% { opacity: 1; transform: rotate(9deg) scale(1.12); }
  100% { opacity: 1; transform: rotate(0) scale(1); }
}

/* Mobile sheet grabber */
.sheet-grip { display: none; }

/* Compression controls */
.compress-toggle { margin-top: 4px; }
.compress-controls { margin-top: 2px; }
.compress-hint { margin: 2px 0 13px; }

/* Red CTA shown only after export */
.btn--red {
  background: #e5484d;
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 12px 28px -14px rgba(229, 72, 77, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn--red:hover {
  background: #d93a40;
  color: #ffffff;
  border-color: transparent;
}

.result__note {
  margin: 10px 0 0;
  text-align: center;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.45;
}

/* Projects library */
.modal__card--projects { width: min(640px, 100%); }

.projects__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 12px;
}

.projects__ttl {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.projects__ttl select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 150px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--field);
  color: var(--text);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.projects__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 46vh;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.projects__empty {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 24px 14px;
  text-align: center;
  border-radius: 12px;
  border: 1px dashed var(--line-2);
  color: var(--muted);
}

.projects__empty strong { color: var(--text); font-size: 13px; }
.projects__empty span { font-size: 11px; line-height: 1.5; }

.project-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--field-2);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.project-card:hover {
  border-color: var(--line-2);
  transform: translateY(-1px);
}

.project-card__thumb {
  width: 92px;
  height: 56px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
  background: var(--video-bg);
  color: var(--muted-2);
}

.project-card__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card__thumb svg { width: 20px; height: 20px; }

.project-card__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.project-card__body strong {
  font-size: 12.5px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card__body span {
  color: var(--muted-2);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card__expiry { color: var(--muted-2); font-size: 9.5px; }

.project-card__actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

@media (max-width: 760px) {
  .sheet-grip {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 18px;
    flex-shrink: 0;
    touch-action: none;
    cursor: grab;
  }

  .sheet-grip span {
    width: 38px;
    height: 4px;
    border-radius: 999px;
    background: var(--line-3);
    transition: background 0.18s ease;
  }

  .sheet-grip:active span { background: var(--muted-2); }
  .inspector.is-dragging { animation: none; }
  .inspector.is-dragging .sheet-grip { cursor: grabbing; }
  .topbar__projects span { display: none; }
  .project__saved { display: none; }
}

@media (max-width: 520px) {
  .project-card { grid-template-columns: 64px minmax(0, 1fr); }
  .project-card__thumb { width: 64px; height: 44px; }
  .project-card__actions { grid-column: 1 / -1; justify-content: flex-end; }
  .result__stats { grid-template-columns: repeat(2, 1fr); }
  .projects__toolbar { align-items: stretch; }
  .projects__toolbar .btn { width: 100%; }
  .projects__ttl select { width: 100%; }
}

/* Compact timeline toolbar before the mobile breakpoint */
.timeline__hint > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .tool-btn span { display: none; }
  .tool-btn { padding: 5px 6px; }
  .topbar__projects span { display: none; }
  .topbar__projects { padding: 7px 9px; }
}

/* Keep the project name readable on very narrow phones */
@media (max-width: 520px) {
  .topbar__actions { gap: 4px; }
  #saveProjectBtn { display: none; }
  .project__name { min-width: 40px; }
  .project { min-width: 0; }
}

/* =========================================================
   Light theme preview + auth feedback + entry animation
   ========================================================= */

html[data-theme="light"] .preview::before {
  background:
    radial-gradient(80% 70% at 50% 0%, rgba(15, 20, 30, 0.035), transparent 65%),
    linear-gradient(180deg, transparent 60%, rgba(15, 20, 30, 0.06));
}

html[data-theme="light"] .preview__empty {
  background:
    radial-gradient(60% 60% at 50% 42%, rgba(15, 20, 30, 0.04), transparent 70%),
    var(--video-bg);
}

html[data-theme="light"] .preview__empty h2 { color: var(--text); }
html[data-theme="light"] .preview__empty p { color: var(--muted); }
html[data-theme="light"] .empty__hint { color: var(--muted-2); }

html[data-theme="light"] .track__empty {
  color: var(--muted-2);
}

html[data-theme="light"] .hud-pill {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(15, 20, 30, 0.12);
  color: var(--text);
}

html[data-theme="light"] .hud-pill--muted { color: var(--muted); }

html[data-theme="light"] .preview__controls {
  background: linear-gradient(transparent, rgba(228, 232, 239, 0.94));
}

html[data-theme="light"] .preview__controls .icon-btn {
  color: var(--text);
  border-color: rgba(15, 20, 30, 0.12);
  background: rgba(255, 255, 255, 0.74);
}

html[data-theme="light"] .preview__controls .icon-btn:hover {
  background: #ffffff;
  color: var(--accent-text);
}

html[data-theme="light"] .timecode { color: var(--text); }
html[data-theme="light"] .timecode__sep,
html[data-theme="light"] .timecode__total { color: var(--muted-2); }

html[data-theme="light"] .bigplay {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(15, 20, 30, 0.14);
  color: var(--text);
  box-shadow: 0 18px 44px rgba(25, 33, 55, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] .bigplay:hover {
  background: #ffffff;
}

.account__error {
  margin: 0 0 12px;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--danger) 34%, transparent);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
  font-size: 11.5px;
  line-height: 1.45;
}

.account__error.is-shaking,
.modal__card.is-shaking {
  animation: auth-shake 0.36s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes auth-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.account__link {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted-2);
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.account__link:hover { color: var(--text); }

.account__help {
  margin-top: 8px;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--field-2);
}

.enter-flash {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 8, 11, 0.34);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.enter-flash.is-visible {
  opacity: 1;
}

.enter-flash__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 180px;
  padding: 22px 26px 20px;
  border-radius: 18px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  box-shadow: var(--shadow), var(--inset);
  transform: translateY(10px) scale(0.96);
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.enter-flash.is-visible .enter-flash__card {
  transform: none;
}

.enter-flash__check {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 3px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 24px -12px var(--accent-glow);
}

.enter-flash__check svg {
  width: 24px;
  height: 24px;
  stroke-dasharray: 26;
  stroke-dashoffset: 26;
  animation: enter-check 0.42s 0.08s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

@keyframes enter-check {
  to { stroke-dashoffset: 0; }
}

.enter-flash__card strong {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.enter-flash__card > span:last-child {
  color: var(--muted-2);
  font-size: 10.5px;
  text-align: center;
}

/* Inspector width handle */
.inspector-resize {
  position: absolute;
  left: -5px;
  top: 0;
  bottom: 0;
  z-index: 8;
  width: 10px;
  cursor: col-resize;
  touch-action: none;
}

.inspector-resize::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 50%;
  width: 3px;
  height: 34px;
  margin-top: -17px;
  border-radius: 999px;
  background: var(--line-2);
  opacity: 0;
  transition: opacity 0.18s ease, background 0.18s ease;
}

.inspector-resize:hover::after,
body.is-resizing .inspector-resize::after {
  opacity: 1;
  background: var(--muted-2);
}

body.is-resizing {
  cursor: col-resize;
  user-select: none;
}

@media (max-width: 760px) {
  .inspector-resize { display: none; }
}

/* =========================================================
   Discord-like motion polish
   ========================================================= */

.modal__close svg,
.icon-btn svg {
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal__close:hover svg {
  transform: rotate(90deg) scale(1.08);
}

.icon-btn:hover svg {
  transform: translateY(-1px) scale(1.06);
}

.icon-btn:active svg {
  transform: scale(0.88);
}

.rail__btn .rail__icon {
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s ease;
}

.rail__btn:hover .rail__icon {
  transform: translateY(-2px) scale(1.09);
}

.rail__btn:active .rail__icon {
  transform: scale(0.92);
}

.rail__btn.is-active .rail__icon {
  animation: rail-pop 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes rail-pop {
  0% { transform: scale(0.82); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.btn {
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease,
    border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.985); }

.tool-btn {
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease,
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.tool-btn:hover { transform: translateY(-1px); }
.tool-btn:active { transform: scale(0.96); }

.account-btn {
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.account-btn:hover { transform: translateY(-1px); }
.account-btn:active { transform: scale(0.97); }

.account-btn__avatar {
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.account-btn:hover .account-btn__avatar {
  transform: scale(1.08) rotate(-4deg);
}

.modal__card {
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.seg__btn,
.chip,
.toggle,
.tab {
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease;
}

.seg__btn:hover,
.chip:hover,
.tab:hover { transform: translateY(-1px); }

.seg__btn:active,
.chip:active,
.tab:active { transform: scale(0.97); }

/* Icon + label micro pop when a rail item is dropped in a new place */
.rail__btn.is-dropped .rail__icon {
  animation: rail-drop-pop 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes rail-drop-pop {
  0% { transform: scale(0.7) rotate(-8deg); }
  55% { transform: scale(1.14) rotate(3deg); }
  100% { transform: scale(1) rotate(0); }
}

/* =========================================================
   Account shell - dark, theme-independent (Epic-style)
   ========================================================= */

.modal.modal--account {
  padding: 24px;
}

.account-backdrop {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.08), transparent 58%),
    rgba(5, 5, 6, 0.58);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  backdrop-filter: blur(18px) saturate(120%);
  animation: account-backdrop-in 0.3s ease;
}

@keyframes account-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.account-shell {
  /* Local monochrome glass palette: readable in both app themes */
  --text: #f3f3f4;
  --text-2: #d1d1d5;
  --muted: #9a9aa0;
  --muted-2: #6b6b71;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.15);
  --line-3: rgba(255, 255, 255, 0.24);
  --field: #19191c;
  --field-2: #111113;
  --panel: #111113;
  --btn-bg: #f1f1f2;
  --btn-text: #08080a;
  --btn-hover: #ffffff;
  --danger: #ff7676;
  --accent-text: #ffffff;
  --accent-glow: rgba(255, 255, 255, 0.2);

  position: relative;
  display: flex;
  flex-direction: column;
  width: min(452px, 100%);
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(20, 20, 22, 0.94) 0%, rgba(8, 8, 10, 0.96) 100%);
  -webkit-backdrop-filter: blur(22px) saturate(120%);
  backdrop-filter: blur(22px) saturate(120%);
  color: var(--text);
  box-shadow:
    0 40px 120px -28px rgba(0, 0, 0, 0.9),
    0 2px 0 rgba(255, 255, 255, 0.05) inset,
    0 0 0 1px rgba(0, 0, 0, 0.6);
  font-family: var(--font);
  animation: account-shell-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes account-shell-in {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.modal--account .account-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  overflow: visible;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: rgba(10, 10, 12, 0.72);
  color: var(--text);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow: 0 10px 26px -16px rgba(0, 0, 0, 0.9);
  z-index: 30;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.modal--account .account-close:hover {
  border-color: var(--line-3);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  transform: rotate(90deg);
}

.modal--account .account-close:active {
  transform: rotate(90deg) scale(0.9);
}

/* ---------- Brand header ---------- */

.account-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}

.account-brand__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: #1a1a1e;
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

.account-brand__mark svg {
  width: 19px;
  height: 19px;
}

.account-brand__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.account-brand__text strong {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.account-brand__text span {
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 500;
}

.account-brand__badge {
  margin-left: auto;
  margin-right: 34px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.account-brand__badge.is-online {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

/* ---------- Screens ---------- */

.account-screens {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.account-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px;
}

.account-screen[hidden] {
  display: none !important;
}

.account-screen.is-entering {
  animation: account-screen-in 0.34s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes account-screen-in {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: none; }
}

.account-screen.is-shaking {
  animation: auth-shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.account-screen h2 {
  margin: 0 0 7px;
  color: var(--text);
  font-size: 24px;
  font-weight: 680;
  letter-spacing: -0.035em;
  line-height: 1.18;
}

.account__lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.account__lead strong {
  color: var(--text-2);
  font-weight: 650;
  word-break: break-all;
}

/* ---------- Fields / form ---------- */

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

.account__field {
  gap: 6px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.account__field em {
  margin-left: 6px;
  color: var(--muted-2);
  opacity: 0.6;
}

.account__field .field-box {
  padding: 11px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--field-2);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.account__field .field-box:hover {
  border-color: var(--line-2);
}

.account__field .field-box:focus-within {
  border-color: rgba(255, 255, 255, 0.45);
  background: #1b1b1f;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.07);
}

.account__field .field-box input {
  color: var(--text);
  font-family: var(--font);
  font-size: 13.5px;
  font-variant-numeric: normal;
  caret-color: var(--text);
}

.account__field .field-box input::placeholder {
  color: #66666e;
}

.account__submit {
  width: 100%;
  height: 44px;
  margin-top: 4px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.account__submit svg {
  width: 16px;
  height: 16px;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.account__submit:hover svg {
  transform: translateX(3px);
}

/* ---------- Links / helpers ---------- */

.account__link {
  align-self: flex-start;
  margin-top: 14px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.account__link:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.account__link:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  text-decoration: none;
}

.account__link--danger {
  color: #ff8f8f;
  margin-top: 18px;
}

.account__link--danger:hover {
  color: #ffadad;
}

.account__link--avatar {
  margin-top: -8px;
  margin-bottom: 4px;
  align-self: flex-start;
  font-size: 10.5px;
}

.account__legal {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: #70707a;
  font-size: 10px;
  line-height: 1.55;
}

.account__help {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted-2);
  font-size: 10.5px;
}

.panel__note.account__code-note {
  margin: 0;
  color: var(--muted-2);
  font-size: 10.5px;
  text-align: center;
}

/* ---------- Errors ---------- */

.account__error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 122, 122, 0.32);
  background: rgba(255, 90, 90, 0.09);
  color: var(--danger);
  font-size: 11.5px;
  line-height: 1.5;
  animation: account-error-in 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes account-error-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.account-screen.is-shaking .account__error {
  animation: none;
}

/* ---------- Back button ---------- */

.account__back {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  margin: 0 0 14px;
  padding: 5px 9px 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease,
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.account__back svg {
  width: 14px;
  height: 14px;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.account__back:hover {
  border-color: var(--line-2);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.account__back:hover svg {
  transform: translateX(-2px);
}

.account__back:active {
  transform: scale(0.97);
}

/* ---------- Code screen ---------- */

.account-screen--code h2 {
  text-align: center;
}

.account-screen--code .account__lead {
  text-align: center;
}

.code-inputs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 2px 0 4px;
}

.code-input {
  width: 52px;
  height: 62px;
  flex: 0 1 52px;
  min-width: 0;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--field-2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  caret-color: var(--text);
  outline: 0;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease,
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.code-input:hover {
  border-color: var(--line-3);
}

.code-input:focus {
  border-color: rgba(255, 255, 255, 0.7);
  background: #1e1e23;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.09);
  transform: translateY(-1px);
}

.code-input.is-filled {
  border-color: rgba(255, 255, 255, 0.34);
  background: #202025;
}

.code-input:disabled {
  opacity: 0.55;
}

.account__code-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 4px;
}

.account__code-actions .account__link {
  margin-top: 12px;
}

/* ---------- Profile screen ---------- */

.account-hero {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

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

.account-hero__body h2 {
  margin: 0;
  font-size: 21px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-hero__body p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-badge {
  align-self: flex-start;
  margin-top: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.account-avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: #f2f2f3;
  color: #0b0b0c;
  font-family: var(--font);
  font-weight: 750;
  font-size: 26px;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.account-avatar--lg {
  width: 82px;
  height: 82px;
}

.account-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.account-avatar:hover {
  transform: translateY(-1px);
  border-color: var(--line-3);
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.8);
}

.account-avatar__edit {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(10, 10, 12, 0.82);
  color: #fff;
  opacity: 0;
  transform: scale(0.75);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.account-avatar__edit svg {
  width: 12px;
  height: 12px;
}

.account-avatar:hover .account-avatar__edit,
.account-avatar:focus-visible .account-avatar__edit {
  opacity: 1;
  transform: scale(1);
}

/* ---------- Rows (email / password) ---------- */

.account__rows {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field-2);
  overflow: hidden;
}

.account__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
}

.account__row + .account__row {
  border-top: 1px solid var(--line);
}

.account__row-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.account__row-label span {
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.account__row-label strong {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account__row-note {
  color: var(--muted-2);
  font-size: 10px;
  white-space: nowrap;
}

.account__row-btn {
  flex-shrink: 0;
  padding: 6px 11px;
  border-radius: 7px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.account__row-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--line-3);
}

.account__row-btn:active {
  transform: scale(0.96);
}

/* Saved micro-pulse on the profile screen */
.account-screen.is-saved .account__submit {
  animation: account-save-pulse 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes account-save-pulse {
  0% { transform: scale(1); }
  45% { transform: scale(0.985); }
  100% { transform: scale(1); }
}

/* Busy state */
.account-shell.is-busy .account__submit {
  cursor: progress;
}

/* ---------- Mobile ---------- */

@media (max-width: 560px) {
  .modal.modal--account {
    padding: 12px;
  }

  .account-shell {
    max-height: calc(100dvh - 24px);
    border-radius: 14px;
  }

  .account-brand {
    padding: 16px 17px 13px;
  }

  .account-brand__badge {
    margin-right: 30px;
  }

  .account-screen {
    padding: 18px 17px 20px;
  }

  .account-screen h2 {
    font-size: 21px;
  }

  .code-inputs {
    gap: 6px;
  }

  .code-input {
    height: 54px;
    flex: 1 1 0;
    font-size: 21px;
  }

  .account-hero {
    gap: 13px;
  }

  .account-avatar--lg {
    width: 70px;
    height: 70px;
    font-size: 22px;
  }

  .account-hero__body h2 {
    font-size: 18px;
  }
}

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

/* =========================================================
   Account - full-screen profile, Epic-style nav
   ========================================================= */

.modal--account.is-full {
  padding: 0;
}

.account-shell.is-full {
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  border-radius: 0;
  border: 0;
}

.account-shell.is-full .account-brand {
  grid-column: 1;
  grid-row: 1;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.account-shell.is-full .account-nav {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  min-height: 0;
  overflow-y: auto;
}

.account-shell.is-full .account-screens {
  grid-column: 2;
  grid-row: 1 / span 2;
  border-left: 1px solid var(--line);
  background:
    radial-gradient(1200px 420px at 78% -10%, rgba(255, 255, 255, 0.045), transparent 60%),
    #0c0c0e;
}

.account-shell.is-full .account-screen {
  width: min(840px, 100%);
  margin: 0 auto;
  padding: clamp(26px, 5vh, 62px) clamp(24px, 5vw, 64px) 56px;
}

.account-shell.is-full .account-close {
  top: 18px;
  right: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(10, 10, 12, 0.72);
  border-color: var(--line-2);
}

.account-nav[hidden] { display: none !important; }

.account-nav {
  flex-direction: column;
  gap: 3px;
  padding: 18px 14px 16px;
  background: rgba(255, 255, 255, 0.012);
}

.account-nav__eyebrow {
  padding: 0 10px 10px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.account-nav__item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.18s ease;
}

.account-nav__item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.85;
}

.account-nav__item:hover {
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}

.account-nav__item:active { transform: scale(0.985); }

.account-nav__item.is-active {
  border-color: var(--line-2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.account-nav__item--danger {
  position: sticky !important;
  bottom: 0;
  z-index: 2;
  color: #e79a9a;
  margin-top: 4px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.account-nav__item--danger:hover {
  color: #ffb3b3;
  background: rgba(255, 90, 90, 0.1);
  border-color: rgba(255, 90, 90, 0.22);
}

.account-nav__foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
  padding: 18px 11px 10px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.account-nav__foot small {
  font-size: 9.5px;
  color: var(--muted-2);
  opacity: 0.72;
}

/* Lock screen */

.account-screen--lock {
  align-items: flex-start;
}

.account-screen--lock .account__form {
  max-width: 380px;
}

/* Password form + security note */

.account-password-form {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.account-form-title {
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.account-password-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.account-password-actions .account__link {
  margin-left: auto;
}

.account-security-note {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.account-security-note svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--text);
}

.account-security-note strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 12px;
}

.account-security-note p { margin: 0; }

/* Appearance choice */

.theme-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 6px 0 20px;
}

.theme-choice__item {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.18s ease;
}

.theme-choice__item:hover {
  border-color: var(--line-3);
  transform: translateY(-1px);
}

.theme-choice__item.is-active {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16) inset;
}

.theme-choice__preview {
  display: block;
  height: 88px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.theme-choice__preview--dark {
  background:
    linear-gradient(135deg, #17171a 0%, #0c0c0e 100%),
    #0c0c0e;
  box-shadow: inset 0 0 0 8px #121214, inset 0 0 0 9px rgba(255, 255, 255, 0.06);
}

.theme-choice__preview--light {
  background:
    linear-gradient(135deg, #f6f7fa 0%, #e5e8ee 100%),
    #e9ecf2;
  box-shadow: inset 0 0 0 8px #fdfdfe, inset 0 0 0 9px rgba(0, 0, 0, 0.08);
}

.theme-choice__item strong {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text);
}

.theme-choice__item small {
  font-size: 10px;
  color: var(--muted-2);
}

.account-appearance-rows { margin-top: 4px; }

/* Logout confirmation */

.account-confirm {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
}

.account-confirm[hidden] { display: none; }

.account-confirm__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: account-backdrop-in 0.22s ease;
}

.account-confirm__card {
  position: relative;
  width: min(380px, 100%);
  padding: 22px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #141416;
  color: #f4f4f5;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.85);
  animation: account-shell-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.account-confirm__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 90, 90, 0.28);
  background: rgba(255, 90, 90, 0.1);
  color: #ff9b9b;
}

.account-confirm__icon svg { width: 19px; height: 19px; }

.account-confirm__card h3 {
  margin: 13px 0 6px;
  font-size: 17px;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.account-confirm__card p {
  margin: 0;
  color: #a4a4ac;
  font-size: 11.5px;
  line-height: 1.6;
}

.account-confirm__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.btn--red {
  background: #f0f0f1;
  color: #2a0d0d;
  border-color: transparent;
}

.btn--red:hover { background: #ffffff; }

/* Compact account window on phones */

@media (max-width: 760px) {
  .account-shell.is-full {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .account-shell.is-full .account-brand {
    grid-column: 1;
    grid-row: 1;
  }

  .account-shell.is-full .account-nav {
    grid-column: 1;
    grid-row: 2;
    border-top: 0;
  }

  .account-shell.is-full .account-screens {
    grid-column: 1;
    grid-row: 3;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .account-nav {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 10px;
  }

  .account-nav__eyebrow,
  .account-nav__foot { display: none; }

  .account-nav__item {
    width: auto;
    flex: 1 1 40%;
    justify-content: center;
    min-height: 38px;
    font-size: 11px;
  }

  .account-nav__item svg { width: 15px; height: 15px; }

  .account-shell.is-full .account-screen {
    padding: 20px 16px 36px;
  }

  .theme-choice { gap: 8px; }
  .theme-choice__preview { height: 66px; }
}

/* =========================================================
   Editor - CapCut-style toolbar, per-clip audio, stacked panels
   ========================================================= */

.workspace__main {
  grid-template-rows: minmax(0, 1fr) 268px;
}

.timeline {
  padding: 8px 10px 7px;
}

.timeline__toolbar {
  height: 38px;
  gap: 8px;
}

.timeline__tools {
  gap: 3px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.tool-btn span {
  display: inline;
  white-space: nowrap;
}

.tool-btn {
  padding: 6px 9px;
  font-size: 11px;
}

.tool-btn svg { width: 15px; height: 15px; }

.tool-btn--accent {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}

.tool-btn--accent:hover {
  background: var(--accent);
  color: var(--accent-ink);
  filter: brightness(1.08);
}

.tool-btn--export {
  border-color: var(--line-2);
  background: var(--field-2);
  color: var(--text);
}

.tool-btn--export:hover {
  background: var(--field);
  border-color: var(--line-3);
}

.tool-btn.is-muted {
  border-color: rgba(255, 122, 122, 0.28);
  color: #e69a9a;
  background: rgba(255, 90, 90, 0.08);
}

.tool-btn .icon--muted { display: none; }
.tool-btn.is-muted .icon--volume { display: none; }
.tool-btn.is-muted .icon--muted { display: block; }

.timeline__divider {
  width: 1px;
  height: 19px;
  margin: 0 4px;
  flex-shrink: 0;
  background: var(--line);
}

/* Clip waveform + mute */

.segment-block {
  overflow: hidden;
  padding-top: 15px;
}

.segment-block__wave {
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 3px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  border-radius: 4px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.92;
  transition: opacity 0.2s ease;
}

.segment-block__wave i {
  flex: 1 1 0;
  min-width: 1px;
  max-width: 3px;
  border-radius: 1px;
  background: currentColor;
  color: rgba(214, 220, 232, 0.78);
  transition: height 0.18s ease, background 0.18s ease;
}

.segment-block__wave i.is-hot {
  color: #ff5f5f;
}

.segment-block.is-active .segment-block__wave i {
  color: var(--timeline-accent);
}

.segment-block.is-active .segment-block__wave i.is-hot {
  color: #ff6b6b;
}

.segment-block.is-muted .segment-block__wave { opacity: 0.26; }
.segment-block.is-muted .segment-block__wave i,
.segment-block.is-muted .segment-block__wave i.is-hot { height: 2px !important; color: rgba(214, 220, 232, 0.5) !important; }

.segment-block__mute {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  padding: 0;
  border-radius: 5px;
  border: 1px solid transparent;
  background: rgba(0, 0, 0, 0.22);
  color: rgba(240, 242, 246, 0.78);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.segment-block__mute svg { width: 11px; height: 11px; }

.segment-block:hover .segment-block__mute,
.segment-block.is-active .segment-block__mute,
.segment-block.is-muted .segment-block__mute { opacity: 1; }

.segment-block__mute:hover {
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
}

.segment-block.is-muted .segment-block__mute {
  color: #ff9b9b;
  border-color: rgba(255, 90, 90, 0.3);
  background: rgba(255, 90, 90, 0.14);
}

.segment-block__label {
  position: relative;
  z-index: 2;
  display: block;
  max-width: calc(100% - 22px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

/* Per-clip audio controls in the trim panel */

.clip-audio {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field-2);
}

.clip-audio__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.clip-audio__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
}

.clip-audio__title svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.clip-audio .range-row {
  margin: 0;
}

.clip-audio__bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 30px;
  margin-top: 10px;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--line);
}

.clip-audio__bars i {
  flex: 1 1 0;
  min-width: 1px;
  border-radius: 1px;
  background: var(--timeline-accent);
  opacity: 0.72;
  transition: height 0.16s ease, opacity 0.16s ease;
}

.clip-audio__bars.is-muted i {
  height: 3px !important;
  opacity: 0.33;
}

/* Stacked panel windows */

.inspector__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 240px;
  padding: 28px 22px;
  color: var(--muted-2);
  text-align: center;
}

.inspector__empty[hidden] { display: none; }

.inspector__empty svg {
  width: 30px;
  height: 30px;
  opacity: 0.55;
}

.inspector__empty strong {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 650;
}

.inspector__empty span {
  max-width: 240px;
  font-size: 11px;
  line-height: 1.5;
}

.panel.is-active {
  display: block;
  padding: 0 16px 16px;
  border-bottom: 1px solid var(--line);
}

.panel.is-active:last-child { border-bottom: 0; }

.panel__window {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 33px;
  margin: 0 -16px 14px;
  padding: 0 8px 0 12px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: default;
}

.panel__window-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.82;
}

.panel__window-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.panel__window-btn {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.panel__window-btn svg { width: 12px; height: 12px; }

.panel__window-btn:hover {
  background: var(--field-2);
  color: var(--text);
  border-color: var(--line);
}

.panel__window-btn--close:hover {
  background: rgba(255, 90, 90, 0.14);
  border-color: rgba(255, 90, 90, 0.3);
  color: #ff9b9b;
}

.panel.is-collapsed > :not(.panel__window) { display: none !important; }

.panel.is-collapsed .panel__window { border-bottom: 0; }

@media (max-width: 760px) {
  .workspace__main { grid-template-rows: minmax(0, 1fr); }
  .panel.is-active { padding: 0 14px 14px; }
  .panel__window { margin: 0 -14px 12px; }
}

/* =========================================================
   Account popover, system theme, density, preview waveform
   ========================================================= */

.account-btn.is-menu-open {
  background: var(--field-2);
  border-color: var(--line-2);
}

.account-btn.is-menu-open .account-btn__avatar {
  transform: scale(1.06) rotate(6deg);
}

.account-menu {
  position: fixed;
  z-index: 260;
  width: 258px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  background: rgba(18, 18, 21, 0.96);
  color: #f4f4f5;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.85), 0 1px 0 rgba(255, 255, 255, 0.06) inset;
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  transform-origin: top right;
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.account-menu[hidden] { display: none; }

.account-menu.is-open {
  opacity: 1;
  transform: none;
}

.account-menu__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 9px 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  margin-bottom: 6px;
}

.account-menu__avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.09);
  background-size: cover;
  background-position: center;
  font-size: 12px;
  font-weight: 700;
}

.account-menu__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.account-menu__body strong,
.account-menu__body small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu__body strong { font-size: 12.5px; font-weight: 650; }
.account-menu__body small { color: #9b9ba4; font-size: 10.5px; }

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

.account-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #d7d7dc;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.account-menu__item svg { width: 16px; height: 16px; opacity: 0.85; }

.account-menu__item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  transform: translateX(1px);
}

.account-menu__item:active { transform: scale(0.985); }

.account-menu__item--danger { color: #f09a9a; }
.account-menu__item--danger svg { opacity: 1; }
.account-menu__item--danger:hover { background: rgba(255, 70, 70, 0.12); color: #ffb1b1; }

/* Brand: only the site name in the full account sidebar */
.account-shell.is-full .account-brand__mark,
.account-shell.is-full .account-brand__text span,
.account-shell.is-full .account-brand__badge {
  display: none;
}

.account-shell.is-full .account-brand__text strong {
  font-size: 14px;
  letter-spacing: -0.01em;
}

/* System theme preview: diagonal half dark / half light */
.theme-choice--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.theme-choice__preview--system {
  background:
    linear-gradient(135deg, #17171a 0%, #0c0c0e 49.6%, #f4f6fa 50.4%, #e3e7ee 100%);
  box-shadow: inset 0 0 0 8px rgba(120, 120, 130, 0.18), inset 0 0 0 9px rgba(255, 255, 255, 0.08);
}

/* Density */
.density-choice {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 16px;
}

.density-choice__item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.density-choice__item:hover { border-color: var(--line-3); transform: translateY(-1px); }

.density-choice__item.is-active {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14) inset;
}

.density-choice__item strong { color: var(--text); font-size: 11.5px; font-weight: 650; }
.density-choice__item small { color: var(--muted-2); font-size: 9.5px; }

.density-choice__preview {
  display: flex;
  flex-direction: column;
  gap: 0;
  justify-content: center;
  height: 46px;
  padding: 6px 7px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.16);
}

.density-choice__preview i {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.4);
}

.density-choice__preview i:nth-child(1) { width: 64%; }
.density-choice__preview i:nth-child(2) { width: 92%; }
.density-choice__preview i:nth-child(3) { width: 44%; }
.density-choice__preview--compact { gap: 3px; }
.density-choice__preview--compact i { height: 2px; }
.density-choice__preview--comfortable { gap: 6px; }
.density-choice__preview--spacious { gap: 10px; }
.density-choice__preview--spacious i { height: 4px; }

.account-density-preview {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.account-density-preview__eyebrow {
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.account-density-preview strong { font-size: calc(14px * var(--density-font, 1)); font-weight: 680; }
.account-density-preview p { margin: 0; color: var(--muted); font-size: calc(11.5px * var(--density-font, 1)); }

.account-density-preview__chip {
  align-self: flex-start;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--text-2);
  font-size: calc(10px * var(--density-font, 1));
}

html[data-density="compact"] { --density-font: 0.92; --density-zoom: 0.94; }
html[data-density="comfortable"] { --density-font: 1; --density-zoom: 1; }
html[data-density="spacious"] { --density-font: 1.06; --density-zoom: 1.05; }

html[data-density="compact"] .app { zoom: 0.94; height: calc(100dvh / 0.94); }
html[data-density="spacious"] .app { zoom: 1.05; height: calc(100dvh / 1.05); }

html[data-density="compact"] .account-shell.is-full { zoom: 0.94; height: calc(100dvh / 0.94); max-height: calc(100dvh / 0.94); }
html[data-density="spacious"] .account-shell.is-full { zoom: 1.05; height: calc(100dvh / 1.05); max-height: calc(100dvh / 1.05); }

html[data-density="compact"] .timeline__toolbar { height: 34px; }
html[data-density="compact"] .rail__btn { min-height: 52px; }
html[data-density="spacious"] .timeline__toolbar { height: 42px; }
html[data-density="spacious"] .rail__btn { min-height: 64px; }

@media (max-width: 760px) {
  .theme-choice--three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .theme-choice__preview { height: 58px; }
  .density-choice { gap: 7px; }
}

.field-box--username { align-items: center; gap: 4px; }

.field-box__prefix {
  flex-shrink: 0;
  color: var(--muted-2);
  font-size: 12.5px;
  font-weight: 600;
  padding-left: 2px;
}

.field-box--username input { padding-left: 0; }

.account-username-hint {
  margin: -6px 0 14px;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.5;
}

.account-username-hint.is-locked { color: #d8b06a; }

.account-shell .field-box input:disabled {
  color: var(--muted-2);
  cursor: not-allowed;
}

/* =========================================================
   VidSlice 2.4 - appearance, gallery, glass, motion
   ========================================================= */

:root {
  --glass-blur: 18px;
  --accent-rgb: 255 255 255;
  --radius-xl: 26px;
}

/* Accent palettes */
html[data-accent="violet"] {
  --accent: #c4b5fd;
  --accent-2: #ddd6fe;
  --accent-text: #c4b5fd;
  --accent-soft: rgba(139, 92, 246, 0.16);
  --accent-glow: rgba(139, 92, 246, 0.34);
  --btn-bg: #8b5cf6;
  --btn-text: #ffffff;
  --btn-hover: #a78bfa;
  --timeline-accent: #c4b5fd;
  --timeline-glow: rgba(139, 92, 246, 0.42);
  --accent-rgb: 167 139 250;
}
html[data-accent="blue"] {
  --accent: #93c5fd;
  --accent-2: #bfdbfe;
  --accent-text: #93c5fd;
  --accent-soft: rgba(59, 130, 246, 0.16);
  --accent-glow: rgba(59, 130, 246, 0.34);
  --btn-bg: #3b82f6;
  --btn-text: #ffffff;
  --btn-hover: #60a5fa;
  --timeline-accent: #93c5fd;
  --timeline-glow: rgba(59, 130, 246, 0.42);
  --accent-rgb: 147 197 253;
}
html[data-accent="mint"] {
  --accent: #86efac;
  --accent-2: #bbf7d0;
  --accent-text: #86efac;
  --accent-soft: rgba(34, 197, 94, 0.15);
  --accent-glow: rgba(34, 197, 94, 0.32);
  --btn-bg: #22c55e;
  --btn-text: #06210f;
  --btn-hover: #4ade80;
  --timeline-accent: #86efac;
  --timeline-glow: rgba(34, 197, 94, 0.4);
  --accent-rgb: 134 239 172;
}
html[data-accent="amber"] {
  --accent: #fcd34d;
  --accent-2: #fde68a;
  --accent-text: #fcd34d;
  --accent-soft: rgba(245, 158, 11, 0.16);
  --accent-glow: rgba(245, 158, 11, 0.34);
  --btn-bg: #f59e0b;
  --btn-text: #211503;
  --btn-hover: #fbbf24;
  --timeline-accent: #fcd34d;
  --timeline-glow: rgba(245, 158, 11, 0.4);
  --accent-rgb: 252 211 77;
}
html[data-accent="rose"] {
  --accent: #fda4af;
  --accent-2: #fecdd3;
  --accent-text: #fda4af;
  --accent-soft: rgba(244, 63, 94, 0.15);
  --accent-glow: rgba(244, 63, 94, 0.32);
  --btn-bg: #f43f5e;
  --btn-text: #ffffff;
  --btn-hover: #fb7185;
  --timeline-accent: #fda4af;
  --timeline-glow: rgba(244, 63, 94, 0.4);
  --accent-rgb: 253 164 175;
}

html[data-theme="light"][data-accent="violet"] { --accent: #7c3aed; --accent-2: #6d28d9; --accent-text: #6d28d9; --btn-bg: #7c3aed; --btn-text: #fff; --timeline-accent: #7c3aed; }
html[data-theme="light"][data-accent="blue"] { --accent: #2563eb; --accent-2: #1d4ed8; --accent-text: #1d4ed8; --btn-bg: #2563eb; --btn-text: #fff; --timeline-accent: #2563eb; }
html[data-theme="light"][data-accent="mint"] { --accent: #16a34a; --accent-2: #15803d; --accent-text: #15803d; --btn-bg: #16a34a; --btn-text: #fff; --timeline-accent: #16a34a; }
html[data-theme="light"][data-accent="amber"] { --accent: #d97706; --accent-2: #b45309; --accent-text: #b45309; --btn-bg: #d97706; --btn-text: #fff; --timeline-accent: #d97706; }
html[data-theme="light"][data-accent="rose"] { --accent: #e11d48; --accent-2: #be123c; --accent-text: #be123c; --btn-bg: #e11d48; --btn-text: #fff; --timeline-accent: #e11d48; }

/* Background scenes */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
  transition: opacity 0.4s ease;
}
html[data-background="aurora"] body::before {
  background:
    radial-gradient(720px 540px at 8% -8%, rgba(var(--accent-rgb), 0.16), transparent 62%),
    radial-gradient(760px 560px at 102% 18%, rgba(99, 102, 241, 0.12), transparent 64%),
    radial-gradient(820px 640px at 50% 112%, rgba(236, 72, 153, 0.09), transparent 62%);
}
html[data-background="mesh"] body::before {
  background:
    conic-gradient(from 210deg at 18% 12%, rgba(var(--accent-rgb), 0.14), transparent 32%),
    conic-gradient(from 40deg at 82% 84%, rgba(255, 255, 255, 0.055), transparent 34%),
    radial-gradient(600px 400px at 50% 50%, rgba(255, 255, 255, 0.035), transparent 70%);
}
html[data-background="grid"] body::before {
  background-image:
    linear-gradient(rgba(var(--accent-rgb), 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 40%, #000 10%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 10%, transparent 78%);
}
html[data-background="plain"] body::before { opacity: 0; }

.app, .studio { position: relative; }
.app { z-index: 1; }
.welcome { position: fixed; z-index: 100; }

/* Icon press animation */
.btn svg,
.icon-btn svg,
.tool-btn svg,
.rail__btn svg,
.account-nav__item svg,
.account-menu__item svg,
.chip-btn svg,
.segmented__btn svg,
.quality-btn svg {
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-origin: 50% 50%;
}
.btn:active svg,
.icon-btn:active svg,
.tool-btn:active svg,
.rail__btn:active svg,
.account-nav__item:active svg,
.account-menu__item:active svg,
.chip-btn:active svg {
  transform: scale(0.78) rotate(-7deg);
}
button.is-pressing svg,
.btn.is-pressing svg,
.icon-btn.is-pressing svg {
  animation: icon-pop 0.38s cubic-bezier(0.2, 1.4, 0.3, 1);
}
@keyframes icon-pop {
  0% { transform: scale(1); }
  38% { transform: scale(0.72) rotate(-9deg); }
  70% { transform: scale(1.12) rotate(3deg); }
  100% { transform: scale(1) rotate(0); }
}

/* Buttons get a subtle press/ripple */
.btn, .icon-btn, .tool-btn, .rail__btn, .account-nav__item, .account-menu__item {
  position: relative;
  overflow: hidden;
}
.btn::after,
.icon-btn::after,
.tool-btn::after,
.rail__btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--press-x, 50%) var(--press-y, 50%), rgba(255, 255, 255, 0.22), transparent 46%);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.4s ease, transform 0.5s ease;
  pointer-events: none;
}
.btn.is-pressing::after,
.icon-btn.is-pressing::after,
.tool-btn.is-pressing::after,
.rail__btn.is-pressing::after {
  opacity: 1;
  transform: scale(1.4);
  transition: none;
}

/* Stronger glass */
.topbar {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
}
.inspector {
  background: color-mix(in srgb, var(--panel) 74%, transparent);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border-color: var(--line-2);
  box-shadow: var(--shadow), var(--inset);
}
.modal__card,
.account-shell,
.projects-gallery__search,
.avatar-cropper__card {
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(170%);
  backdrop-filter: blur(var(--glass-blur)) saturate(170%);
}
.panel {
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel-2) 62%, transparent);
  border: 1px solid var(--line);
}

/* Dark theme depth */
html[data-theme="dark"] body { background: #050608; }
html[data-theme="dark"] .topbar {
  background: color-mix(in srgb, #0a0c10 72%, transparent);
  border-bottom-color: rgba(255, 255, 255, 0.09);
}
html[data-theme="dark"] .inspector {
  background: color-mix(in srgb, #0d1015 78%, transparent);
}
html[data-theme="dark"] .panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  border-color: rgba(255, 255, 255, 0.09);
}
html[data-theme="dark"] .modal__card {
  background: linear-gradient(180deg, rgba(24, 27, 34, 0.94), rgba(13, 15, 20, 0.96));
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, 0.95), var(--inset);
}
html[data-theme="dark"] .welcome {
  background:
    radial-gradient(900px 620px at 18% 12%, rgba(var(--accent-rgb), 0.1), transparent 62%),
    radial-gradient(780px 560px at 84% 82%, rgba(255, 255, 255, 0.045), transparent 62%),
    #050609;
}
html[data-theme="dark"] .welcome__glow--1 { background: radial-gradient(circle, rgba(var(--accent-rgb), 0.22), transparent 64%); }
html[data-theme="dark"] .welcome__glow--2 { background: radial-gradient(circle, rgba(255, 255, 255, 0.09), transparent 64%); }

/* Motion preference */
html[data-motion="off"] *,
html[data-motion="off"] *::before,
html[data-motion="off"] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

/* =========================================================
   Cloudflare gate - only the widget
   ========================================================= */

.gate {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg, #07080b);
  color: var(--text, #f4f4f5);
}
.gate[hidden] { display: none; }
.gate__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: auto;
  max-width: 100%;
}
.gate__widget {
  min-height: 65px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gate__error {
  margin-top: 12px;
  max-width: 340px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 90, 90, 0.28);
  border-radius: 9px;
  background: rgba(255, 90, 90, 0.1);
  color: #ffb3b3;
  font-size: 11.5px;
  line-height: 1.5;
  text-align: center;
}
.gate__error[hidden] { display: none; }
.gate__retry { margin-top: 12px; }

/* =========================================================
   Settings controls
   ========================================================= */

.settings-block {
  margin-top: 18px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--field-2), transparent);
}
.settings-block__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 11px;
}
.settings-block__head strong { color: var(--text); font-size: 12px; font-weight: 650; }
.settings-block__head span { color: var(--muted-2); font-size: 10px; }
.settings-block__value { margin-left: auto; color: var(--accent-text); font-size: 10.5px; font-weight: 650; }
.settings-block--muted p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.settings-block--muted { background: var(--field-2); }

.accent-choice { display: flex; flex-wrap: wrap; gap: 9px; }
.accent-choice__item {
  width: 32px;
  height: 32px;
  padding: 3px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.accent-choice__item span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.accent-choice__item:hover { transform: translateY(-2px) scale(1.05); }
.accent-choice__item.is-active { border-color: var(--text); box-shadow: 0 0 0 3px var(--accent-soft); }
.accent-choice__item--mono span { background: linear-gradient(135deg, #f4f4f5, #73737d); }
.accent-choice__item--violet span { background: linear-gradient(135deg, #c4b5fd, #7c3aed); }
.accent-choice__item--blue span { background: linear-gradient(135deg, #93c5fd, #2563eb); }
.accent-choice__item--mint span { background: linear-gradient(135deg, #86efac, #16a34a); }
.accent-choice__item--amber span { background: linear-gradient(135deg, #fde68a, #d97706); }
.accent-choice__item--rose span { background: linear-gradient(135deg, #fecdd3, #e11d48); }

.bg-choice { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.bg-choice__item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--field-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.bg-choice__item:hover { transform: translateY(-2px); border-color: var(--line-2); }
.bg-choice__item strong { font-size: 10.5px; font-weight: 650; }
.bg-choice__item small { color: var(--muted-2); font-size: 8.5px; }
.bg-choice__item.is-active {
  border-color: var(--accent-text);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--accent-soft);
}
.bg-choice__preview {
  display: block;
  height: 34px;
  border-radius: 7px;
  border: 1px solid var(--line);
}
.bg-choice__preview--aurora { background: radial-gradient(circle at 25% 20%, #a78bfa, transparent 55%), radial-gradient(circle at 80% 75%, #38bdf8, transparent 55%), #0b0d12; }
.bg-choice__preview--mesh { background: conic-gradient(from 120deg at 30% 30%, #f472b6, transparent 40%), conic-gradient(from 300deg at 75% 70%, #34d399, transparent 40%), #0b0d12; }
.bg-choice__preview--grid { background-image: linear-gradient(rgba(255,255,255,.22) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.22) 1px, transparent 1px); background-size: 9px 9px; background-color: #0b0d12; }
.bg-choice__preview--plain { background: #0b0d12; }

.settings-range {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(90deg, var(--accent-text), var(--line-2));
  outline: none;
  cursor: pointer;
}
.settings-range::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--panel);
  background: var(--accent-text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.settings-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--panel);
  background: var(--accent-text);
}

.settings-rows { display: flex; flex-direction: column; margin-top: 16px; border-top: 1px solid var(--line); }
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.settings-row--static { cursor: default; }
.settings-row__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.settings-row__text strong { color: var(--text); font-size: 11.5px; font-weight: 650; }
.settings-row__text small { color: var(--muted-2); font-size: 10px; line-height: 1.4; }
.settings-row__state { color: var(--muted); font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.switch { position: relative; display: inline-flex; flex-shrink: 0; width: 42px; height: 24px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--panel-3);
  border: 1px solid var(--line-2);
  transition: background 0.22s ease, border-color 0.22s ease;
  pointer-events: none;
}
.switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.24s cubic-bezier(0.2, 0.9, 0.2, 1.2);
}
.switch input:checked + i { background: var(--btn-bg); border-color: transparent; }
.switch input:checked + i::after { transform: translateX(18px); background: var(--btn-text); }
.switch input:focus-visible + i { outline: 2px solid var(--accent-text); outline-offset: 2px; }

.shortcut-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.shortcut-grid > div {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 11px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--field-2);
  font-size: 10.5px;
  color: var(--muted);
}
.shortcut-grid kbd { margin: 0; }

.about-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--field-2);
}
.about-hero__mark { width: 52px; height: 52px; flex-shrink: 0; color: var(--text); }
.about-hero__mark svg { width: 100%; height: 100%; }
.about-hero h2 { margin: 0 0 3px; font-size: 17px; }
.about-hero p { margin: 0; color: var(--muted); font-size: 10.5px; line-height: 1.5; }

/* ---------- What's new ---------- */

.updates-hero {
  position: relative;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #08090c;
  isolation: isolate;
}

.updates-hero__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 420;
  object-fit: cover;
  opacity: 0.95;
}

.updates-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(7, 8, 11, 0.92) 0%, rgba(7, 8, 11, 0.62) 38%, rgba(7, 8, 11, 0.08) 72%, transparent 100%);
  pointer-events: none;
}

.updates-hero__body {
  position: absolute;
  left: clamp(18px, 4vw, 30px);
  top: 50%;
  z-index: 2;
  width: min(360px, 62%);
  transform: translateY(-50%);
}

.updates-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: #cfd6e4;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.updates-hero__eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.updates-hero h2 {
  margin: 0 0 6px;
  color: #f7f9fc;
  font-size: clamp(21px, 3.4vw, 30px);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.updates-hero p {
  margin: 0 0 10px;
  color: rgba(226, 231, 240, 0.72);
  font-size: 11px;
  line-height: 1.55;
}

.updates-hero__date {
  color: rgba(214, 221, 233, 0.52);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.release-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.release {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--field-2);
}

.release__head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}

.release__version {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--accent-soft);
  color: var(--text);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.release__date {
  color: var(--muted-2);
  font-size: 9.5px;
}

.release__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.release__list li {
  position: relative;
  padding-left: 15px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.release__list li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-text);
  opacity: 0.55;
}

.updates-note { margin-top: 14px; }

@media (max-width: 760px) {
  .updates-hero__body { width: 78%; }
  .updates-hero p { display: none; }
  .updates-hero__img { aspect-ratio: 1200 / 560; }
}

.account__error.is-notice {
  border-color: color-mix(in srgb, var(--accent-text) 34%, transparent);
  background: var(--accent-soft);
  color: var(--text);
}

/* =========================================================
   Avatar cropper
   ========================================================= */

.avatar-cropper { z-index: 320; }
.avatar-cropper__card {
  position: relative;
  width: min(420px, 100%);
  padding: 20px;
  border-radius: 22px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(24, 27, 34, 0.96), rgba(12, 14, 19, 0.97));
  color: #f4f4f5;
  box-shadow: 0 50px 120px -30px rgba(0, 0, 0, 0.9), var(--inset);
  animation: crop-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes crop-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.avatar-cropper__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.avatar-cropper__head h2 { margin: 2px 0 0; font-size: 18px; letter-spacing: -0.02em; }
.avatar-cropper__stage {
  position: relative;
  display: grid;
  place-items: center;
  margin: 16px 0 14px;
  padding: 10px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.06), transparent 60%),
    #090a0d;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
#avatarCropperCanvas {
  width: min(280px, 74vw);
  height: min(280px, 74vw);
  border-radius: 50%;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.9);
}
#avatarCropperCanvas.is-dragging { cursor: grabbing; }
.avatar-cropper__ring {
  position: absolute;
  width: min(280px, 74vw);
  height: min(280px, 74vw);
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.34);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}
.avatar-cropper__hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  color: #c9ccd4;
  font-size: 9.5px;
  white-space: nowrap;
  pointer-events: none;
}
.avatar-cropper__zoom {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #b7bcc6;
}
.avatar-cropper__zoom svg { width: 17px; height: 17px; flex-shrink: 0; }
.avatar-cropper__zoom input { flex: 1; accent-color: #f4f4f5; }
.avatar-cropper__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.avatar-cropper .btn--ghost { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.14); color: #f4f4f5; }

/* =========================================================
   Projects gallery (full screen)
   ========================================================= */

#projectsModal { padding: 0; place-items: stretch; background: transparent; }
#projectsModal .modal__backdrop {
  background: rgba(3, 4, 6, 0.76);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.projects-gallery {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  padding: clamp(18px, 3vw, 38px) clamp(16px, 4vw, 54px) 20px;
  overflow: hidden;
  background:
    radial-gradient(900px 620px at 12% -10%, rgba(var(--accent-rgb), 0.16), transparent 62%),
    radial-gradient(820px 600px at 96% 100%, rgba(99, 102, 241, 0.15), transparent 62%),
    linear-gradient(180deg, #08090c 0%, #0a0c11 100%);
  color: #f4f4f5;
  opacity: 0;
  transform: translateY(12px) scale(0.99);
  transition: opacity 0.28s ease, transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1);
}
#projectsModal.is-open .projects-gallery { opacity: 1; transform: none; }
.projects-gallery__glow { position: absolute; border-radius: 50%; filter: blur(90px); pointer-events: none; opacity: 0.7; }
.projects-gallery__glow--1 { width: 380px; height: 380px; top: -140px; left: -80px; background: rgba(var(--accent-rgb), 0.22); animation: gallery-drift 16s ease-in-out infinite alternate; }
.projects-gallery__glow--2 { width: 420px; height: 420px; bottom: -180px; right: -100px; background: rgba(99, 102, 241, 0.18); animation: gallery-drift 19s ease-in-out infinite alternate-reverse; }
@keyframes gallery-drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(4%, 3%, 0) scale(1.12); }
}
.projects-gallery__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
  pointer-events: none;
}
.projects-gallery__head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-shrink: 0;
}
.projects-gallery__intro { min-width: 0; }
.projects-gallery__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #9ba1ad;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.projects-gallery__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-text); box-shadow: 0 0 0 4px var(--accent-soft); }
.projects-gallery h2 {
  margin: 8px 0 4px;
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 750;
  letter-spacing: -0.04em;
}
.projects-gallery__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 24px;
  padding: 0 9px;
  margin-left: 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.06);
  color: #c9ced8;
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}
.projects-gallery__intro p { margin: 0; color: #9298a4; font-size: 12px; }
.projects-gallery__tools { display: flex; align-items: center; gap: 9px; }
.projects-gallery__search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(280px, 54vw);
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.05);
  color: #9ba1ad;
}
.projects-gallery__search svg { width: 16px; height: 16px; flex-shrink: 0; }
.projects-gallery__search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f4f4f5;
  font-size: 12px;
}
.projects-gallery__search input::placeholder { color: #6e7480; }
.projects-gallery__close { color: #c9ced8; background: rgba(255, 255, 255, 0.05); }
.projects-gallery__close:hover { background: rgba(255, 255, 255, 0.1); }
.projects-gallery .projects__toolbar { position: relative; margin: 20px 0 14px; flex-shrink: 0; }
.projects-gallery .projects__toolbar .btn { background: var(--btn-bg); color: var(--btn-text); border-color: transparent; }
.projects-gallery .projects__ttl { color: #8c929e; }
.projects-gallery .projects__ttl select { background: rgba(255, 255, 255, 0.06); color: #f4f4f5; border-color: rgba(255, 255, 255, 0.13); }
.projects-gallery .projects__list {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  align-content: start;
  gap: 14px;
  flex: 1;
  min-height: 0;
  max-height: none;
  padding: 2px 4px 20px 2px;
  overflow-y: auto;
}
.projects-gallery .project-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  box-shadow: 0 24px 60px -34px rgba(0, 0, 0, 0.9);
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  animation: card-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: calc(var(--card-index, 0) * 45ms);
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.24s ease, box-shadow 0.24s ease;
}
@keyframes card-in { to { opacity: 1; transform: none; } }
.projects-gallery .project-card:hover {
  transform: translateY(-5px);
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 34px 80px -34px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(var(--accent-rgb), 0.18);
}
.projects-gallery .project-card__thumb {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 0;
  background: #050608;
}
.projects-gallery .project-card__thumb img { transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.projects-gallery .project-card:hover .project-card__thumb img { transform: scale(1.06); }
.projects-gallery .project-card__thumb svg { width: 40px; height: 40px; color: #4c525d; }
.projects-gallery .project-card__body { padding: 13px 14px 4px; gap: 4px; }
.projects-gallery .project-card__body strong { color: #f4f4f5; font-size: 13.5px; font-weight: 680; }
.projects-gallery .project-card__body span { color: #8b919d; font-size: 10.5px; }
.projects-gallery .project-card__expiry { color: #6f7581; }
.projects-gallery .project-card__actions { padding: 8px 12px 13px; margin-top: auto; }
.projects-gallery .project-card__actions .btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.07);
  color: #f4f4f5;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.projects-gallery .project-card__actions .btn:hover { background: rgba(255, 255, 255, 0.13); }
.projects-gallery .project-card__actions .icon-btn { color: #b9bfca; }
.projects-gallery .projects__empty {
  grid-column: 1 / -1;
  padding: 70px 20px;
  border-radius: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.02);
  color: #8b919d;
}
.projects-gallery .projects__empty strong { color: #f4f4f5; font-size: 16px; }
.projects-gallery .projects__empty span { font-size: 12px; }
.projects-gallery > .panel__note { position: relative; flex-shrink: 0; margin: 8px 0 0; color: #686e7a; }

/* =========================================================
   Fullscreen preview fixes
   ========================================================= */

.preview:fullscreen,
.preview:-webkit-full-screen {
  background: #000;
  width: 100vw;
  height: 100vh;
  border-radius: 0;
}
.preview:fullscreen video { object-fit: contain; }
.preview:fullscreen .preview__controls {
  display: flex;
  opacity: 1;
  transform: none;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.72));
}
.preview:fullscreen .preview__hud { display: flex; }
.preview:fullscreen .fsBtn { display: inline-flex; }
.preview:fullscreen .bigplay { display: grid; }

/* =========================================================
   Mobile bottom sheet + layout safety
   ========================================================= */

.app { height: 100dvh; min-height: 0; }
.studio { min-height: 0; overflow: hidden; }
.workspace { min-height: 0; }

@media (max-width: 760px) {
  /* Keep the whole editor reachable on short phones: preview and timeline
     share the free space instead of pushing the rail off-screen. */
  .workspace__main { overflow: hidden; }
  .preview { min-height: 92px; }
  .timeline { height: clamp(128px, 26dvh, 200px); min-height: 128px; }
  .rail { padding-bottom: max(5px, env(safe-area-inset-bottom, 0px)); flex-shrink: 0; }

  .inspector {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    height: min(64dvh, 540px);
    max-height: calc(100dvh - 10px);
    border-radius: 22px 22px 0 0;
    border: 1px solid var(--line-2);
    border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -30px 80px -20px rgba(0, 0, 0, 0.8);
    animation: sheet-up 0.34s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .inspector.is-hidden { display: none; }
  .inspector__head { height: 44px; }
  .sheet-grip {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    touch-action: none;
    cursor: grab;
    position: relative;
  }
  .sheet-grip::before {
    content: "";
    position: absolute;
    inset: 0;
  }
  .sheet-grip span { width: 44px; height: 5px; border-radius: 999px; background: var(--line-3); }
  .inspector__body { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
  .projects-gallery { padding: 18px 16px 14px; }
  .projects-gallery__head { gap: 12px; }
  .projects-gallery__tools { width: 100%; }
  .projects-gallery__search { width: 100%; }
  .projects-gallery .projects__list { grid-template-columns: 1fr; }
  .bg-choice { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shortcut-grid { grid-template-columns: 1fr; }
}
@keyframes sheet-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Compact topbar on short screens so bottom timeline is never cut */
@media (max-height: 640px) {
  .topbar { height: 50px; }
  .timeline { height: 168px; }
}

/* Phones turned sideways have very little vertical room. Put preview and
   timeline side by side so nothing important is clipped. */
@media (max-width: 900px) and (max-height: 520px) and (orientation: landscape) {
  .topbar { height: 46px; }
  .workspace { padding: 5px; }
  .workspace__main { flex-direction: row; gap: 6px; }
  .preview { flex: 1 1 56%; min-height: 0; order: 1; }
  .timeline { flex: 1 1 44%; height: auto; min-height: 0; order: 2; }
  .rail { padding: 3px 6px; }
  .rail__btn { min-height: 40px; flex-direction: column; gap: 2px; font-size: 8.5px; }
  .inspector { height: min(82dvh, 340px); }
}

@media (max-width: 1080px) {
  .topbar__projects span,
  .topbar__import span { display: none; }
}




/* Sidebar with many sections stays scrollable */
.account-nav {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.account-nav::-webkit-scrollbar { width: 6px; }
.account-nav::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; }

/* Reduce data / calm mode */
html[data-reduce="on"] body::before,
html[data-reduce="on"] .welcome__glow,
html[data-reduce="on"] .projects-gallery__glow,
html[data-reduce="on"] .orb { animation: none !important; }
html[data-reduce="on"] .projects-gallery__grid { display: none; }
html[data-reduce="on"] .topbar,
html[data-reduce="on"] .inspector,
html[data-reduce="on"] .modal__card { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
html[data-reduce="on"] .welcome__grid { opacity: 0.4; }

/* Light theme polish for the new settings blocks */
html[data-theme="light"] .settings-block { background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(247, 248, 251, 0.4)); }
html[data-theme="light"] .settings-row__text small { color: var(--muted); }
html[data-theme="light"] .about-hero { background: linear-gradient(135deg, var(--accent-soft), transparent 70%), #ffffff; }

@media (max-width: 760px) {
  .account-nav { padding: 12px 10px; }
  .account-nav__item { min-height: 40px; font-size: 12px; }
  .account-nav__eyebrow { display: none; }
  .projects-gallery { height: 100dvh; }
  .projects-gallery .projects__list { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

/* Logout opens a focused confirmation without the profile behind it */
#accountModal.is-confirm-only .account-shell {
  opacity: 0;
  transform: scale(0.985);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
#accountModal.is-confirm-only .account-confirm__card {
  animation: confirm-pop 0.28s cubic-bezier(0.2, 0.9, 0.2, 1.15) both;
}
@keyframes confirm-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* Export panel and result: glass and depth */
.panel[data-panel="export"] {
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.07), transparent 42%),
    color-mix(in srgb, var(--panel-2) 62%, transparent);
}
.export-summary > div {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 55%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--inset);
}
.export-result {
  position: relative;
  border: 1px solid var(--line-2);
  background:
    radial-gradient(420px 220px at 50% -30%, rgba(var(--accent-rgb), 0.16), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 50%),
    var(--panel);
  box-shadow: var(--shadow), var(--inset);
  border-radius: 18px;
}
html[data-theme="dark"] .export-result {
  background:
    radial-gradient(420px 220px at 50% -30%, rgba(var(--accent-rgb), 0.18), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 48%),
    #0c0e13;
}
.export-result video {
  border-radius: 12px;
  box-shadow: 0 22px 48px -24px rgba(0, 0, 0, 0.8);
  background: #000;
}
.result__badge {
  box-shadow: 0 0 0 6px var(--accent-soft), 0 10px 26px -12px var(--accent-glow);
}
.result__actions .btn--ghost {
  background: color-mix(in srgb, var(--panel) 55%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* =========================================================
   Deeper dark theme, guest account, route 404, hotkey HUD
   ========================================================= */

html[data-theme="dark"] {
  --bg: #050506;
  --bg-2: #0a0a0c;
  --panel: #111113;
  --panel-2: #171719;
  --panel-3: #202023;
  --field: rgba(0, 0, 0, 0.4);
  --field-2: rgba(255, 255, 255, 0.05);
  --video-bg: #020203;
}
html[data-theme="dark"] body { background: #050506; }
html[data-theme="dark"] .topbar {
  background: color-mix(in srgb, #050506 76%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  backdrop-filter: blur(18px) saturate(120%);
}
html[data-theme="dark"] .rail {
  background: color-mix(in srgb, #050506 92%, transparent);
}
html[data-theme="dark"] .inspector,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .modal__card {
  background: color-mix(in srgb, #111113 82%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  backdrop-filter: blur(18px) saturate(120%);
}

/* Guest account screen */
.account-guest {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 8px 0 2px;
}
.account-guest__mark {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  margin-bottom: 10px;
  border-radius: 22px;
  border: 1px solid var(--line-2);
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.1), transparent 60%),
    color-mix(in srgb, var(--panel-2) 70%, transparent);
  color: var(--text);
  box-shadow: var(--inset), 0 18px 40px -22px rgba(0, 0, 0, 0.8);
  animation: guest-mark-in 0.5s cubic-bezier(0.2, 0.9, 0.2, 1.1) both;
}
.account-guest__mark svg { width: 42px; height: 42px; }
@keyframes guest-mark-in {
  from { opacity: 0; transform: scale(0.82) rotate(-6deg); }
  to { opacity: 1; transform: none; }
}
.account-guest__actions {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}
.account__submit--white {
  background: #ffffff;
  border-color: #ffffff;
  color: #0a0a0c;
  box-shadow: 0 16px 38px -18px rgba(255, 255, 255, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.account__submit--white:hover {
  background: #f2f2f4;
  border-color: #f2f2f4;
  color: #0a0a0c;
}
.account-guest__perks {
  display: grid;
  gap: 8px;
  margin: 18px 0 4px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--panel-2) 45%, transparent);
  text-align: left;
}
.account-guest__perks span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11.5px;
}
.account-guest__perks svg { width: 14px; height: 14px; color: var(--text); flex-shrink: 0; }

/* Settings control rows */
.settings-row--control { gap: 12px; }
.settings-select {
  appearance: none;
  min-width: 132px;
  padding: 8px 30px 8px 11px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 15px) 52% / 5px 5px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 10px) 52% / 5px 5px no-repeat,
    var(--field);
  color: var(--text);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}
.settings-select:hover, .settings-select:focus-visible { border-color: var(--line-3); outline: none; }

/* In-app 404 for a missing project link */
@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(26px, 18px, 0) scale(1.08); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
body.has-route-error { overflow: hidden; }
.route-error {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 26px;
  overflow: auto;
  background:
    radial-gradient(900px 560px at 50% -12%, rgba(255, 255, 255, 0.1), transparent 62%),
    radial-gradient(700px 460px at 92% 100%, rgba(110, 120, 255, 0.1), transparent 62%),
    #070708;
  color: #f4f4f5;
}
.route-error[hidden] { display: none; }
.route-error::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 72%);
  pointer-events: none;
}
.route-error__orb {
  position: fixed;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.42;
  pointer-events: none;
  animation: float 14s ease-in-out infinite;
}
.route-error__orb--a { top: -140px; left: -100px; background: rgba(255, 255, 255, 0.18); }
.route-error__orb--b { bottom: -160px; right: -120px; background: rgba(110, 120, 255, 0.16); animation-delay: -7s; }
.route-error__wrap {
  position: relative;
  width: min(600px, 100%);
  padding: 34px 30px 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-align: center;
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.route-error__brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  color: #f4f4f5;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}
.route-error__brand svg { width: 26px; height: 26px; padding: 5px; border-radius: 8px; background: #f4f4f5; color: #0a0a0c; }
.route-error__brand em { color: #9a9aa3; font-style: normal; font-weight: 600; }
.route-error__art { position: relative; display: grid; place-items: center; width: 168px; height: 168px; margin: 16px auto 4px; isolation: isolate; }
.route-error__ghost {
  position: absolute;
  left: 50%;
  top: 48%;
  z-index: 0;
  transform: translate(-50%, -50%);
  font-size: 218px;
  font-weight: 900;
  line-height: 0.8;
  letter-spacing: -0.07em;
  color: rgba(255, 255, 255, 0.035);
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.14);
  pointer-events: none;
  user-select: none;
  animation: ghost-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes ghost-in {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.route-error__art::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 68%);
  filter: blur(8px);
  animation: pulse 5s ease-in-out infinite;
}
.route-error__scene { display: none; }
#routeError[data-code="404"] .route-error__scene--404,
#routeError[data-code="410"] .route-error__scene--410,
#routeError[data-code="507"] .route-error__scene--507,
#routeError[data-code="offline"] .route-error__scene--offline { display: block; }
.route-error__art svg { position: relative; z-index: 1; width: 106px; height: 106px; transform: translateY(44px); color: #fff; filter: drop-shadow(0 16px 34px rgba(0, 0, 0, 0.6)); }
.route-error__ink { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.route-error__soft { fill: none; stroke: currentColor; opacity: 0.42; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.route-error__dot { fill: currentColor; }
.route-error h1 { margin: 14px 0 8px; font-size: clamp(21px, 3.6vw, 27px); font-weight: 740; letter-spacing: -0.03em; }
.route-error p { margin: 0 auto; max-width: 390px; color: #9a9aa3; font-size: 13px; line-height: 1.65; }
.route-error__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.route-error__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
  color: #f4f4f5;
  font-size: 12.5px;
  font-weight: 650;
  text-decoration: none;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}
.route-error__btn:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.22); }
.route-error__btn:active { transform: scale(0.985); }
.route-error__btn--primary { border-color: transparent; background: #f4f4f5; color: #0a0a0c; }
.route-error__btn--primary:hover { background: #fff; }
.route-error__foot { display: block; margin-top: 24px; color: #6e6e78; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }

/* Visible hotkey feedback */
.key-hud {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 800;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(12, 13, 16, 0.86);
  color: #f4f4f5;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.key-hud.is-visible { animation: key-hud-pop 0.9s cubic-bezier(0.2, 0.9, 0.2, 1) both; }
@keyframes key-hud-pop {
  0% { opacity: 0; transform: translateY(8px) scale(0.92); }
  18% { opacity: 1; transform: translateY(0) scale(1.04); }
  32% { transform: none; }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-4px); }
}

/* Hotkey cheat sheet */
.hotkey-sheet { position: fixed; inset: 0; z-index: 850; display: grid; place-items: center; padding: 20px; }
.hotkey-sheet[hidden] { display: none; }
.hotkey-sheet__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: fade-in 0.2s ease; }
.hotkey-sheet__card {
  position: relative;
  width: min(520px, 100%);
  padding: 26px 26px 22px;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.9), var(--inset);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  backdrop-filter: blur(24px) saturate(150%);
  animation: sheet-up 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hotkey-sheet__close { position: absolute; top: 14px; right: 14px; }
.hotkey-sheet__card h2 { margin: 6px 0 16px; font-size: 21px; letter-spacing: -0.02em; }
.hotkey-sheet__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 16px; }
.hotkey-sheet__grid > div { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.hotkey-sheet__grid kbd { flex-shrink: 0; }
.hotkey-sheet__grid span { margin-left: auto; text-align: right; }

/* Extra life */
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.985); }
.btn:active:not(:disabled) svg { transform: scale(0.82) rotate(-6deg); }
.rail__btn:active .rail__btn-icon svg,
.rail__btn.is-pressing .rail__btn-icon svg { animation: rail-icon-pop 0.4s cubic-bezier(0.2, 1.5, 0.3, 1); }
@keyframes rail-icon-pop {
  0% { transform: scale(1); }
  40% { transform: scale(0.78) rotate(-8deg); }
  100% { transform: scale(1) rotate(0); }
}
.panel.is-active { animation: panel-soft-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes panel-soft-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.project-card { transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.22s ease, box-shadow 0.22s ease; }
.project-card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: 0 24px 50px -30px rgba(0, 0, 0, 0.7); }

@media (max-width: 520px) {
  .route-error { padding: 16px; }
  .route-error__wrap { padding: 26px 20px 24px; border-radius: 20px; }
  .route-error__art { width: 140px; height: 140px; }
  .route-error__ghost { font-size: 158px; }
  .route-error__art svg { width: 86px; height: 86px; transform: translateY(36px); }
  .route-error__actions .route-error__btn { flex: 1 1 100%; justify-content: center; }
  .hotkey-sheet__grid { grid-template-columns: 1fr; }
  .settings-row--control { flex-direction: column; align-items: flex-start; }
  .settings-select { width: 100%; }
  .key-hud { left: 12px; bottom: 76px; }
}
@media (prefers-reduced-motion: reduce) {
  .route-error__orb, .route-error__wrap, .route-error__art::before, .route-error__ghost,
  .key-hud, .panel.is-active, .rail__btn:active .rail__btn-icon svg { animation: none !important; }
}

/* =========================================================
   Welcome launcher with two entries
   ========================================================= */

.welcome__center {
  width: min(920px, 100%);
  max-height: calc(100dvh - 104px);
  margin: auto;
  padding: 24px 26px 22px;
  overflow-y: auto;
}

.welcome h1 {
  margin-top: 12px;
  font-size: clamp(30px, 4.2vw, 44px);
}

.welcome__lead {
  max-width: 640px;
  margin-top: 10px;
}

.welcome__drop,
.welcome__meta {
  margin-top: 9px;
}

.welcome__loader,
.launch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  margin-top: 12px;
}

.launch-skeleton {
  position: relative;
  min-height: 250px;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line-2);
  background: var(--welcome-card);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  backdrop-filter: blur(30px) saturate(150%);
}

.launch-skeleton__media {
  display: block;
  height: 120px;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
}

.launch-skeleton__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
}

.launch-skeleton__line {
  display: block;
  height: 10px;
  border-radius: 5px;
}

.launch-skeleton__line--short { width: 34%; height: 8px; }
.launch-skeleton__line--title { width: 68%; height: 18px; }
.launch-skeleton__line--medium { width: 55%; }

.launch-grid.is-ready .launch-card {
  animation: launch-card-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.launch-grid.is-ready .launch-card--photo {
  animation-delay: 0.09s;
}

.launch-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line-2);
  background: var(--welcome-card);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  backdrop-filter: blur(30px) saturate(150%);
  box-shadow: 0 24px 60px -34px rgba(0, 0, 0, 0.66), var(--inset);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.25s ease, box-shadow 0.32s ease;
}

.launch-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 25%, rgba(255, 255, 255, 0.09) 48%, transparent 70%);
  transform: translateX(-130%);
  transition: transform 0.75s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.launch-card:hover {
  transform: translateY(-6px);
  border-color: var(--line);
  box-shadow: 0 34px 80px -34px rgba(0, 0, 0, 0.78), var(--inset);
}

.launch-card:hover::before {
  transform: translateX(130%);
}

.launch-card:active {
  transform: translateY(-2px) scale(0.995);
}

.launch-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.launch-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 7.4;
  overflow: hidden;
  background: #08080a;
  border-bottom: 1px solid var(--line);
}

.launch-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.4s ease;
}

.launch-card:hover .launch-card__media img {
  transform: scale(1.045);
  filter: brightness(1.08);
}

.launch-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(5, 5, 6, 0.62);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #f1f1f2;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.launch-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
  padding: 16px 17px 17px;
}

.launch-card__kicker {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.launch-card strong {
  display: block;
  font-size: 20px;
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.launch-card__text {
  display: block;
  min-height: 38px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.launch-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding-top: 12px;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}

.launch-card__cta svg {
  width: 15px;
  height: 15px;
  transition: transform 0.25s ease;
}

.launch-card:hover .launch-card__cta svg {
  transform: translateX(4px);
}

/* =========================================================
   Photo compression studio
   ========================================================= */

.photo-modal {
  z-index: 210;
}

.photo-modal .modal__card {
  width: min(760px, 100%);
  padding: 0;
  border-radius: 22px;
  overflow: hidden;
  background: var(--panel);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  backdrop-filter: blur(26px) saturate(150%);
}

.photo-studio__head {
  padding: 28px 30px 18px;
  border-bottom: 1px solid var(--line);
}

.photo-studio__badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--field-2);
  color: var(--muted);
  font-size: 10px;
}

.photo-studio__head h2 {
  margin: 13px 0 0;
  font-size: 25px;
  letter-spacing: -0.04em;
}

.photo-studio__head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.photo-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: calc(100% - 40px);
  min-height: 208px;
  margin: 20px;
  padding: 20px;
  overflow: hidden;
  border-radius: 17px;
  border: 1px dashed var(--line-2);
  background: var(--field-2);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.photo-drop::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(60% 60% at 50% 45%, rgba(255, 255, 255, 0.07), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.photo-drop:hover,
.photo-drop.is-over {
  border-color: var(--accent-2);
  background: var(--field);
  transform: translateY(-2px);
}

.photo-drop:hover::after,
.photo-drop.is-over::after {
  opacity: 1;
}

.photo-drop img {
  width: 150px;
  max-width: 60%;
  border-radius: 12px;
  opacity: 0.9;
  animation: mock-float 8s ease-in-out infinite alternate;
}

.photo-drop strong {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  font-size: 15px;
}

.photo-drop > span:not(.photo-drop__pill) {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 12px;
}

.photo-drop__pill {
  position: relative;
  z-index: 1;
  margin-top: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.photo-work {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 20px 22px;
  animation: panel-soft-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.photo-preview {
  position: relative;
  min-height: 230px;
  max-height: 330px;
  overflow: hidden;
  border-radius: 15px;
  border: 1px solid var(--line-2);
  background: #08080a;
}

.photo-preview img {
  display: block;
  width: 100%;
  max-height: 330px;
  object-fit: contain;
}

.photo-preview__skeleton {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  background: #0d0d0f;
}

.photo-preview__skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.09), transparent);
  animation: skeleton-sweep 1.3s ease-in-out infinite;
}

.photo-preview__label {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 3;
  max-width: calc(100% - 20px);
  overflow: hidden;
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(5, 5, 6, 0.66);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #e9e9eb;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-stats {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.photo-stats__cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--field-2);
}

.photo-stats__cell span {
  color: var(--muted-2);
  font-size: 10px;
}

.photo-stats__cell strong {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
}

.photo-stats__arrow {
  width: 18px;
  height: 18px;
  color: var(--muted-2);
}

.photo-stats__save {
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
}

.photo-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.photo-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--field-2);
}

.photo-control > span {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.photo-control em {
  color: var(--text);
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
}

.photo-control select {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.photo-control input[type="range"] {
  width: 100%;
  accent-color: var(--accent-2);
}

.photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.photo-actions .btn {
  min-height: 40px;
}

.photo-actions .btn--primary {
  flex: 1 1 170px;
}

.photo-error {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--danger);
  background: rgba(180, 60, 60, 0.08);
  color: var(--danger);
  font-size: 11.5px;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .welcome__center {
    max-height: calc(100dvh - 92px);
    padding: 20px 16px 18px;
  }
  .welcome__loader,
  .launch-grid {
    grid-template-columns: 1fr;
  }
  .launch-skeleton {
    min-height: 232px;
  }
  .launch-card__media {
    aspect-ratio: 16 / 7;
  }
  .photo-studio__head {
    padding: 25px 20px 16px;
  }
  .photo-stats {
    grid-template-columns: 1fr auto 1fr;
  }
  .photo-stats__save {
    grid-column: 1 / -1;
    text-align: center;
  }
  .photo-controls {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .launch-card::before,
  .photo-drop img,
  .photo-preview__skeleton::after {
    animation: none !important;
    transition: none !important;
  }
}

/* =========================================================
   Full-screen welcome and dedicated photo studio
   ========================================================= */

.welcome {
  padding: clamp(12px, 1.8vw, 22px) clamp(12px, 3vw, 38px) 12px;
  gap: 12px;
  overflow: hidden;
}

.welcome__top,
.welcome__footer {
  flex: 0 0 auto;
  padding: 0 4px;
}

.welcome__footer {
  margin: 0;
}

.welcome__center {
  flex: 1 1 auto;
  width: 100%;
  max-height: none;
  min-height: 0;
  margin: 0;
  padding: clamp(18px, 2.6vw, 34px) clamp(18px, 3vw, 42px);
  overflow-y: auto;
  align-items: stretch;
  text-align: left;
  border-radius: 24px;
  border: 1px solid var(--welcome-border);
  background: var(--welcome-card);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  backdrop-filter: blur(30px) saturate(150%);
  box-shadow: 0 34px 90px -34px rgba(0, 0, 0, 0.62), var(--inset);
}

.welcome__intro {
  flex: 0 0 auto;
}

.welcome h1 {
  margin: 10px 0 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
}

.welcome__lead {
  max-width: 760px;
  margin: 9px 0 0;
  font-size: clamp(12px, 1.2vw, 14px);
  line-height: 1.5;
}

.welcome__loader,
.launch-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.launch-skeleton {
  display: flex;
  min-height: 188px;
}

.launch-skeleton__media {
  width: 42%;
  height: auto;
  border-bottom: 0;
  border-right: 1px solid var(--line);
}

.launch-skeleton__body {
  width: 58%;
  gap: 9px;
  padding: 18px;
}

.launch-card {
  flex-direction: row;
  min-height: 188px;
}

.launch-card__media {
  width: 42%;
  aspect-ratio: auto;
}

.launch-card__body {
  width: 58%;
  gap: 5px;
  padding: 17px 18px;
}

.launch-card strong {
  font-size: 19px;
}

.launch-card__text {
  min-height: 34px;
  font-size: 11.5px;
  line-height: 1.45;
}

.launch-card__cta {
  padding-top: 8px;
}

.welcome__drop {
  justify-content: flex-start;
  margin-top: 12px;
  font-size: 11px;
}

.welcome__features {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
}

.welcome__features-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.welcome__features-head i {
  flex: 1;
  height: 1px;
  background: var(--line-2);
}

.welcome__feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.welcome__feature {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 11px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: var(--field-2);
  animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.welcome__feature:nth-child(2) { animation-delay: 0.05s; }
.welcome__feature:nth-child(3) { animation-delay: 0.1s; }
.welcome__feature:nth-child(4) { animation-delay: 0.15s; }
.welcome__feature:nth-child(5) { animation-delay: 0.2s; }
.welcome__feature:nth-child(6) { animation-delay: 0.25s; }

.welcome__feature svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--muted-2);
}

.welcome__feature div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.welcome__feature strong {
  font-size: 11px;
  font-weight: 650;
}

.welcome__feature span {
  overflow: hidden;
  color: var(--muted-2);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Dedicated full-screen photo studio */

.photo-modal.photo-screen {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  padding: clamp(10px, 1.6vw, 20px);
  background: rgba(3, 4, 6, 0.72);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  animation: fade-in 0.25s ease;
}

.photo-screen__shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  box-shadow: var(--shadow), var(--inset);
  animation: modal-in 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.photo-screen__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
  padding: 14px clamp(16px, 2vw, 26px);
  border-bottom: 1px solid var(--line);
}

.photo-back {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--field-2);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.photo-back:hover {
  background: var(--field);
  border-color: var(--line);
  transform: translateY(-1px);
}

.photo-back svg {
  width: 15px;
  height: 15px;
  transition: transform 0.2s ease;
}

.photo-back:hover svg {
  transform: translateX(-3px);
}

.photo-screen__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.photo-screen__brand em {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.photo-screen__pill {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--muted-2);
  font-size: 10px;
}

.photo-screen__main {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.photo-side {
  min-height: 0;
  overflow-y: auto;
  padding: clamp(18px, 2vw, 28px);
  border-right: 1px solid var(--line);
  background: var(--field-2);
}

.photo-side h2 {
  margin: 14px 0 0;
  font-size: clamp(24px, 2.4vw, 32px);
  letter-spacing: -0.04em;
}

.photo-side > p {
  margin: 9px 0 20px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.photo-side .photo-drop {
  width: 100%;
  min-height: 220px;
  margin: 0;
}

.photo-notes {
  display: grid;
  gap: 7px;
  margin-top: 18px;
}

.photo-notes > div {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 2px 8px;
  padding: 10px 11px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: var(--field);
}

.photo-notes span {
  grid-row: 1 / 3;
  padding-top: 2px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
}

.photo-notes strong {
  font-size: 11.5px;
}

.photo-notes small {
  color: var(--muted-2);
  font-size: 10px;
}

.photo-canvas {
  min-height: 0;
  overflow-y: auto;
  padding: clamp(18px, 2vw, 28px);
}

.photo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  text-align: center;
  animation: panel-soft-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.photo-empty__art {
  position: relative;
  width: min(260px, 50%);
  margin-bottom: 18px;
}

.photo-empty__art img {
  display: block;
  width: 100%;
  border-radius: 18px;
  opacity: 0.85;
  animation: float 7s ease-in-out infinite alternate;
}

.photo-empty__orbit {
  position: absolute;
  inset: -18px;
  border-radius: 26px;
  border: 1px solid var(--line-2);
}

.photo-empty strong {
  font-size: 16px;
}

.photo-empty > span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.photo-empty__skeleton {
  display: flex;
  gap: 8px;
  width: min(360px, 80%);
  margin-top: 24px;
}

.photo-empty__skeleton span {
  flex: 1;
  height: 8px;
  border-radius: 4px;
}

.photo-work {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: panel-soft-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.photo-preview {
  height: clamp(220px, 38vh, 420px);
  min-height: 220px;
  max-height: none;
}

.photo-preview img {
  height: 100%;
  max-height: none;
}

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

.photo-actions .btn--primary {
  flex: 1 1 200px;
}

@media (max-width: 900px) {
  .welcome__loader,
  .launch-grid {
    grid-template-columns: 1fr;
  }
  .launch-card {
    min-height: 168px;
  }
  .welcome__feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .photo-screen__main {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .photo-side {
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .photo-canvas {
    overflow: visible;
  }
}

@media (max-width: 560px) {
  .welcome {
    padding: 10px;
  }
  .welcome__center {
    padding: 18px 16px;
    border-radius: 18px;
  }
  .launch-card {
    flex-direction: column;
    min-height: 0;
  }
  .launch-card__media {
    width: 100%;
    aspect-ratio: 16 / 7;
  }
  .launch-card__body {
    width: 100%;
  }
  .welcome__feature-grid {
    grid-template-columns: 1fr;
  }
  .photo-screen__top {
    flex-wrap: wrap;
  }
  .photo-screen__brand {
    order: -1;
    width: 100%;
  }
  .photo-controls {
    grid-template-columns: 1fr;
  }
  .photo-stats {
    grid-template-columns: 1fr auto 1fr;
  }
  .photo-stats__save {
    grid-column: 1 / -1;
    text-align: center;
  }
}

@media (max-height: 700px) {
  .welcome h1 {
    font-size: clamp(30px, 4vw, 44px);
  }
  .launch-card {
    min-height: 160px;
  }
  .welcome__feature:nth-child(n + 5) {
    display: none;
  }
  .photo-empty__art {
    width: min(180px, 40%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .welcome__feature,
  .photo-empty__art img,
  .photo-screen__shell {
    animation: none !important;
  }
}

/* Cloudflare-style reactive dot field and photo crop tools */

.dot-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.photo-screen__shell {
  z-index: 1;
  background: rgba(10, 10, 12, 0.72);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
}

.photo-modes {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 18px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--field-2);
}

.photo-mode {
  flex: 1;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.photo-mode:hover {
  color: var(--text);
}

.photo-mode.is-active {
  background: var(--field);
  color: var(--text);
  box-shadow: var(--inset);
  transform: translateY(-1px);
}

.photo-preview img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.photo-crop {
  position: absolute;
  z-index: 2;
  overflow: hidden;
}

.photo-crop__box {
  position: absolute;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(0, 0, 0, 0.4);
  cursor: move;
  touch-action: none;
}

.photo-crop__grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  background:
    linear-gradient(to right, transparent 33.1%, rgba(255, 255, 255, 0.3) 33.1%, rgba(255, 255, 255, 0.3) 33.5%, transparent 33.5%, transparent 66.5%, rgba(255, 255, 255, 0.3) 66.5%, rgba(255, 255, 255, 0.3) 66.9%, transparent 66.9%),
    linear-gradient(to bottom, transparent 33.1%, rgba(255, 255, 255, 0.3) 33.1%, rgba(255, 255, 255, 0.3) 33.5%, transparent 33.5%, transparent 66.5%, rgba(255, 255, 255, 0.3) 66.5%, rgba(255, 255, 255, 0.3) 66.9%, transparent 66.9%);
}

.photo-crop__handle {
  position: absolute;
  z-index: 3;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 3px;
  background: #0a0a0c;
  touch-action: none;
}

.photo-crop__handle--nw { top: -7px; left: -7px; cursor: nwse-resize; }
.photo-crop__handle--ne { top: -7px; right: -7px; cursor: nesw-resize; }
.photo-crop__handle--sw { bottom: -7px; left: -7px; cursor: nesw-resize; }
.photo-crop__handle--se { bottom: -7px; right: -7px; cursor: nwse-resize; }

.photo-crop-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--field-2);
  animation: panel-soft-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.photo-crop-ratios {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.photo-crop-ratios button {
  padding: 6px 9px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-2);
  font: inherit;
  font-size: 10.5px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.photo-crop-ratios button:hover {
  color: var(--text);
}

.photo-crop-ratios button.is-active {
  border-color: var(--line-2);
  background: var(--field);
  color: var(--text);
}

@media (max-width: 560px) {
  .photo-crop-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .photo-crop-ratios {
    justify-content: center;
  }
}

.dot-field--welcome {
  z-index: 2;
}

.welcome__top,
.welcome__center,
.welcome__footer {
  position: relative;
  z-index: 3;
}

html[data-static="true"] [data-account-open],
html[data-static="true"] #botGate {
  display: none !important;
}

@media (min-width: 641px) and (max-width: 900px) {
  .welcome__loader,
  .launch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .launch-card {
    min-height: 170px;
  }
  .launch-card__body {
    padding: 14px;
  }
  .launch-card strong {
    font-size: 17px;
  }
  .launch-card__text {
    min-height: 0;
    font-size: 10.5px;
    line-height: 1.4;
  }
  .welcome__feature-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .welcome__feature span {
    display: none;
  }
}

/* =========================================================
   VidSlice - account gated saves and photo result polish
   ========================================================= */

.welcome__auth {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(100%, 720px);
  margin: 22px auto 0;
  padding: 14px 16px;
  border: 1px solid var(--welcome-border);
  border-radius: 18px;
  background: linear-gradient(135deg, var(--welcome-card), rgba(128, 128, 128, 0.06));
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.welcome__auth-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--field-2);
  color: var(--text);
}

.welcome__auth-mark svg { width: 20px; height: 20px; }

.welcome__auth-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.welcome__auth-text strong { font-size: 13px; font-weight: 650; }
.welcome__auth-text small { color: var(--muted); font-size: 11.5px; }

.welcome__auth-btn {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: var(--btn-bg);
  color: var(--btn-text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.welcome__auth-btn svg { width: 15px; height: 15px; }

.welcome__auth-btn:hover {
  transform: translateY(-1px);
  background: var(--btn-hover);
  box-shadow: 0 10px 24px -12px var(--accent-glow);
}

.account__note { margin: 12px 0 0; font-size: 12px; }

body.is-guest #saveProjectBtn,
body.is-guest #saveProjectBtn2 { opacity: 0.55; }

body.is-guest #saveProjectBtn:hover,
body.is-guest #saveProjectBtn2:hover { opacity: 1; }

.photo-work { position: relative; }

.photo-progress {
  position: absolute;
  z-index: 6;
  top: 0;
  left: 20px;
  right: 20px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--field-2);
}

.photo-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 14px var(--accent-glow);
  transition: width 0.35s ease;
}

.photo-result {
  position: absolute;
  z-index: 5;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(10, 10, 12, 0.72);
  color: #f5f5f6;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: photo-result-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.photo-result svg { width: 13px; height: 13px; }

@keyframes photo-result-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.94); }
  to { opacity: 1; transform: none; }
}

.photo-work.is-result .photo-preview {
  border-color: color-mix(in srgb, var(--accent-text) 45%, transparent);
  box-shadow: 0 0 0 1px var(--accent-soft), 0 24px 50px -28px var(--accent-glow);
  animation: photo-result-glow 0.8s ease-out;
}

@keyframes photo-result-glow {
  from { box-shadow: 0 0 0 0 var(--accent-glow); }
  to { box-shadow: 0 0 0 12px transparent; }
}

.photo-work.is-result .photo-stats__save {
  border-color: var(--line-2);
  background: var(--accent-soft);
  color: var(--text);
}

.photo-work.is-result .photo-stats__cell strong { font-variant-numeric: tabular-nums; }

.photo-work.is-result #photoDownloadBtn {
  animation: photo-btn-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  box-shadow: 0 12px 30px -14px var(--accent-glow);
}

@keyframes photo-btn-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.photo-preview.is-comparing::after {
  content: "оригинал";
  position: absolute;
  z-index: 4;
  top: 12px;
  right: 12px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(5, 5, 6, 0.66);
  color: #e9e9eb;
  font-size: 10px;
  letter-spacing: 0.04em;
}

@media (max-width: 720px) {
  .welcome__auth { flex-wrap: wrap; }
  .welcome__auth-btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .welcome__auth-btn,
  .photo-result,
  .photo-work.is-result .photo-preview,
  .photo-work.is-result #photoDownloadBtn {
    animation: none !important;
    transition: none !important;
  }
  .photo-progress span { transition: none !important; }
}
