/* The one font the server-side renderer can draw with (GD + FreeType against
   these exact files), so the canvas preview uses it too and the export matches
   what was on screen. Two cuts is what DejaVu ships. */
@font-face {
  font-family: 'ZynoSans';
  src: url('../fonts/DejaVuSans.ttf') format('truetype');
  font-weight: 100 599;
  font-display: swap;
}

@font-face {
  font-family: 'ZynoSans';
  src: url('../fonts/DejaVuSans-Bold.ttf') format('truetype');
  font-weight: 600 900;
  font-display: swap;
}

/* ZynoCut — one stylesheet, no framework. */

/*
 * Theme.
 *
 * Dark is the default because the editor is a dark tool. Light is opted into
 * with data-theme="light" on <html>, and the system preference applies when the
 * reader has expressed no choice — hence the :not([data-theme]) guard, which
 * keeps an explicit choice winning over the OS.
 *
 * Every colour is a token; nothing below this block hard-codes one, so the two
 * themes stay in step by construction.
 */
:root {
  --bg-0: #0b0d10;
  --bg-1: #14171c;
  --bg-2: #1b1f26;
  --bg-3: #232833;
  --bg-hover: #2a3140;
  --line: #2c323d;
  --line-strong: #3a4250;

  --text-0: #f2f5f9;
  --text-1: #a8b2c1;
  --text-2: #6e7889;

  --accent: #4c8dff;
  --accent-dim: #2f5fb3;
  --accent-2: #b06bff;
  --accent-3: #34c98b;
  --success: #34c98b;
  --danger: #e5484d;
  --warning: #f5b23a;

  --clip-video: #2f5fb3;
  --clip-audio: #1f7a5c;
  --clip-image: #7a4fb3;
  --clip-text: #b3742f;
  --clip-effect: #8b5cf6;
  --clip-effect-bg: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #ec4899 100%);

  --glass: rgba(255, 255, 255, 0.04);
  --glass-line: rgba(255, 255, 255, 0.09);
  --header-bg: rgba(20, 23, 28, 0.72);
  --menu-bg: rgba(27, 31, 38, 0.94);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.75);
  --shadow-card: 0 26px 60px -32px rgba(76, 141, 255, 0.6);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --radius: 8px;
  --radius-sm: 5px;
  --ruler-h: 28px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg-0: #f4f6fa;
  --bg-1: #ffffff;
  --bg-2: #f8fafc;
  --bg-3: #eef1f6;
  --bg-hover: #e4e9f1;
  --line: #dfe4ec;
  --line-strong: #c3cbd8;

  --text-0: #10151c;
  --text-1: #4a5567;
  --text-2: #7d879a;

  --accent: #2f6fe4;
  --accent-dim: #b9cdf7;
  --accent-2: #8b3fe0;
  --accent-3: #1a9e6c;
  --success: #1a9e6c;
  --danger: #d32f34;
  --warning: #b57516;

  --glass: rgba(16, 21, 28, 0.04);
  --glass-line: rgba(16, 21, 28, 0.10);
  --header-bg: rgba(255, 255, 255, 0.78);
  --menu-bg: rgba(255, 255, 255, 0.97);
  --shadow-lg: 0 24px 60px -22px rgba(16, 21, 28, 0.28);
  --shadow-card: 0 20px 44px -26px rgba(47, 111, 228, 0.45);
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg-0: #f4f6fa;
    --bg-1: #ffffff;
    --bg-2: #f8fafc;
    --bg-3: #eef1f6;
    --bg-hover: #e4e9f1;
    --line: #dfe4ec;
    --line-strong: #c3cbd8;

    --text-0: #10151c;
    --text-1: #4a5567;
    --text-2: #7d879a;

    --accent: #2f6fe4;
    --accent-dim: #b9cdf7;
    --accent-2: #8b3fe0;
    --accent-3: #1a9e6c;
    --success: #1a9e6c;
    --danger: #d32f34;
    --warning: #b57516;

    --glass: rgba(16, 21, 28, 0.04);
    --glass-line: rgba(16, 21, 28, 0.10);
    --header-bg: rgba(255, 255, 255, 0.78);
    --menu-bg: rgba(255, 255, 255, 0.97);
    --shadow-lg: 0 24px 60px -22px rgba(16, 21, 28, 0.28);
    --shadow-card: 0 20px 44px -26px rgba(47, 111, 228, 0.45);
    color-scheme: light;
  }
}

/* The editor stays dark whatever the site theme: judging colour and exposure
   against a light chrome is actively misleading, which is why every editing
   tool ships dark. The toggle still applies everywhere else. */
:root[data-theme="light"] body.page-editor,
:root:not([data-theme]) body.page-editor {
  --bg-0: #0b0d10;
  --bg-1: #14171c;
  --bg-2: #1b1f26;
  --bg-3: #232833;
  --bg-hover: #2a3140;
  --line: #2c323d;
  --line-strong: #3a4250;
  --text-0: #f2f5f9;
  --text-1: #a8b2c1;
  --text-2: #6e7889;
  --glass: rgba(255, 255, 255, 0.04);
  --glass-line: rgba(255, 255, 255, 0.09);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

/* The `hidden` attribute is only a UA rule (`display: none`), so ANY author
   rule that sets `display` outranks it and the element stays on screen. Several
   panels here are laid out with grid/flex and toggled by `.hidden = true`, so
   without this they could never actually hide. Author-level + !important puts
   the attribute back in charge: `hidden` means hidden, whatever the layout. */
[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg-0);
  color: var(--text-0);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  margin: 0 0 8px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 28px;
}

p {
  margin: 0 0 10px;
}

/* ------------------------------------------------------------------ forms */

button,
.button {
  font: inherit;
  /* Labels are short and self-contained; wrapping one mid-phrase ("New" /
     "project") reads as a layout fault rather than a line break. */
  white-space: nowrap;
  color: var(--text-0);
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.12s, border-color 0.12s;
  text-decoration: none;
}

button:hover:not(:disabled),
.button:hover:not(:disabled) {
  background: var(--bg-hover);
  text-decoration: none;
}

button:disabled,
.button:disabled {
  opacity: 0.45;
  cursor: default;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.button.primary:hover:not(:disabled) {
  background: #5f9aff;
}

.button.danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

.button.danger:hover:not(:disabled) {
  background: rgba(229, 72, 77, 0.12);
}

.button.small {
  padding: 5px 10px;
  font-size: 13px;
}

.button.tiny {
  padding: 4px 8px;
  font-size: 11px;
}

.button.large {
  padding: 12px 22px;
  font-size: 15px;
}

.button.block {
  width: 100%;
}

.button.is-active {
  background: var(--accent-dim);
  border-color: var(--accent);
}

.icon-button {
  padding: 6px 9px;
  background: transparent;
  border-color: transparent;
  line-height: 1;
}

.icon-button:hover:not(:disabled) {
  background: var(--bg-3);
}

.icon-button.danger {
  color: var(--text-2);
}

.icon-button.danger:hover {
  color: var(--danger);
  background: rgba(229, 72, 77, 0.1);
}

.icon-button.is-active {
  background: var(--accent-dim);
}

input,
select,
textarea {
  font: inherit;
  color: var(--text-0);
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
}

textarea {
  resize: vertical;
}

input[type='range'] {
  padding: 0;
  background: transparent;
  border: none;
  accent-color: var(--accent);
}

input[type='color'] {
  padding: 2px;
  height: 34px;
  cursor: pointer;
}

input[type='checkbox'],
input[type='radio'] {
  width: auto;
}

.field {
  margin-bottom: 14px;
}

.field>label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-1);
  margin-bottom: 5px;
}

.field>label .value {
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.field-row {
  display: flex;
  gap: 10px;
}

.field-row>.field {
  flex: 1;
}

.field-error {
  display: block;
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
}

.field.has-error input,
.field.has-error select {
  border-color: var(--danger);
}

.hint {
  font-size: 12px;
  color: var(--text-2);
  margin: 0;
}

.checkbox,
.radio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-1);
  margin-bottom: 10px;
}

.radio span strong {
  color: var(--text-0);
  font-weight: 600;
}

.search {
  max-width: 260px;
}

.select {
  max-width: 180px;
}

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

/* A floating bar rather than a full-width strip: it sits inset from the top,
   stays transparent over the hero, and condenses into frosted glass once the
   page scrolls under it. */
.header-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 16px 0;
  pointer-events: none;
  /* only the bar itself is interactive */
}

.site-header {
  pointer-events: auto;
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 9px 10px 9px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  transition: background 0.28s var(--ease-out), border-color 0.28s,
    box-shadow 0.28s, backdrop-filter 0.28s;
}

.site-header.is-stuck {
  background: var(--header-bg);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-color: var(--glass-line);
  box-shadow: 0 14px 40px -18px rgba(0, 0, 0, 0.8);
}

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

.brand:hover {
  text-decoration: none;
}

.brand-word {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.03em;
  color: var(--text-0);
}

.brand-word span {
  color: var(--accent);
}

/* Mark: gradient tile with a play glyph punched out of it. */
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  position: relative;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px -6px rgba(76, 141, 255, 0.9);
}

.brand-mark::after {
  content: '';
  position: absolute;
  left: 10px;
  top: 8px;
  border-left: 8px solid #fff;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: auto;
}

.site-nav a {
  position: relative;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-1);
  transition: color 0.15s, background 0.15s;
}

.site-nav a:hover {
  color: var(--text-0);
  background: var(--glass);
  text-decoration: none;
}

.site-nav a.is-current {
  color: var(--text-0);
}

.site-nav a.is-current::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

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

.nav-link-plain {
  font-size: 14px;
  color: var(--text-1);
  padding: 7px 6px;
}

.nav-link-plain:hover {
  color: var(--text-0);
  text-decoration: none;
}

/* ---------------------------------------------------------------- account */

.account {
  position: relative;
}

.account-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 10px 4px 4px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  color: var(--text-1);
  font-size: 13px;
}

.account-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-0);
}

.account-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Gradient ring around the avatar, drawn as padding on the wrapper. */
.avatar {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  padding: 1.5px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
}

.avatar img,
.avatar-initial {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.avatar-initial {
  display: grid;
  place-items: center;
  background: var(--bg-2);
  color: var(--text-0);
  font-weight: 600;
  font-size: 12px;
}

.chevron {
  width: 7px;
  height: 7px;
  margin-left: 1px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s var(--ease-out);
}

.account-toggle[aria-expanded="true"] .chevron {
  transform: translateY(1px) rotate(-135deg);
}

.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 230px;
  padding: 6px;
  background: var(--menu-bg);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.8);
  transform-origin: top right;
  animation: menu-in 0.16s var(--ease-out);
  z-index: 60;
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .account-menu {
    animation: none;
  }
}

.account-head {
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.account-head strong {
  display: block;
  font-size: 14px;
}

.account-head span {
  font-size: 12px;
  color: var(--text-2);
}

.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--text-1);
  background: transparent;
  border: none;
}

.menu-item:hover {
  background: var(--bg-3);
  color: var(--text-0);
  text-decoration: none;
}

.menu-item.is-danger {
  color: #ff9ea1;
}

.menu-item.is-danger:hover {
  background: rgba(229, 72, 77, 0.12);
  color: var(--danger);
}

/* ----------------------------------------------------------- mobile menu */

.nav-toggle {
  display: none;
  /* align-items:center matters: without it the fixed-width bars stretch-align
     to the left and the two halves of the X don't meet. */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 38px;
  height: 38px;
  padding: 0;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 11px;
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--text-0);
  transition: transform 0.22s var(--ease-out), opacity 0.15s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

@media (max-width: 760px) {
  .nav-toggle {
    display: flex;
  }

  .account-name {
    display: none;
  }

  .site-header {
    gap: 10px;
    padding-left: 12px;
  }

  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 10px);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px;
    background: var(--menu-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
  }

  .site-nav:not(.is-open) {
    display: none;
  }

  .site-nav a {
    padding: 11px 14px;
  }

  .site-nav a.is-current::after {
    display: none;
  }
}

/* Top padding is small because the sticky header sits above this in flow. */
.site-main {
  padding: 20px 24px 60px;
  max-width: 1180px;
  margin: 0 auto;
}

.page-editor .site-main,
.page-image-editor .site-main {
  padding: 0;
  max-width: none;
}

/* -------------------------------------------------------------- marketing */

.hero {
  text-align: center;
  padding: 60px 0 40px;
}

.hero h1 {
  font-size: 44px;
  margin-bottom: 14px;
}

.hero p {
  color: var(--text-1);
  font-size: 17px;
  max-width: 560px;
  margin: 0 auto 26px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 50px;
}

.features article {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.features p {
  color: var(--text-1);
  margin: 0;
  font-size: 14px;
}

.warning-banner {
  margin: 26px auto 0;
  max-width: 620px;
  padding: 12px 16px;
  background: rgba(245, 178, 58, 0.1);
  border: 1px solid rgba(245, 178, 58, 0.4);
  border-radius: var(--radius);
  color: var(--warning);
  font-size: 13px;
}

.warning-banner code,
.config-hint code {
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ------------------------------------------------------------------- auth */

.page-auth .site-main {
  max-width: 420px;
}

.auth-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 30px;
}

.auth-card h1 {
  font-size: 24px;
}

.auth-sub {
  color: var(--text-1);
  margin-bottom: 22px;
}

.auth-switch {
  text-align: center;
  color: var(--text-1);
  font-size: 13px;
  margin: 18px 0 0;
}

.google-button {
  width: 100%;
  background: #fff;
  color: #1f2328;
  border-color: #fff;
  font-weight: 500;
}

.google-button:hover:not(:disabled) {
  background: #f1f3f5;
}

.or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-2);
  font-size: 12px;
  margin: 18px 0;
}

.or-divider::before,
.or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.form-notice {
  background: rgba(229, 72, 77, 0.1);
  border: 1px solid rgba(229, 72, 77, 0.4);
  color: #ff9ea1;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
}

.config-hint {
  margin-bottom: 18px;
}

/* ------------------------------------------------------------- dashboards */

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.page-sub {
  color: var(--text-1);
  margin: 0;
  font-size: 14px;
}

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

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}

.tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--text-2);
  padding: 9px 14px;
}

.tab.is-active {
  color: var(--text-0);
  border-bottom-color: var(--accent);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: border-color 0.12s, transform 0.12s;
  display: flex;
  flex-direction: column;
}

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

.template-card {
  cursor: default;
}

.template-categories {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 16px;
  margin-bottom: 8px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.category-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface-1, rgba(255, 255, 255, 0.04));
  color: var(--text-muted, #94a3b8);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.category-chip:hover {
  border-color: var(--line-strong, rgba(255, 255, 255, 0.2));
  color: var(--text, #f8fafc);
  background: var(--surface-2, rgba(255, 255, 255, 0.08));
}

.category-chip.is-active {
  background: var(--primary, #4c8dff);
  border-color: var(--primary, #4c8dff);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(76, 141, 255, 0.35);
}

.card-thumb {
  aspect-ratio: 16 / 9;
  background: var(--bg-0);
  display: grid;
  place-items: center;
}

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

.card-thumb-empty {
  font-size: 30px;
  opacity: 0.35;
}

.card-body {
  padding: 12px 14px;
  flex: 1;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-title {
  font-size: 15px;
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-desc {
  font-size: 13px;
  color: var(--text-1);
  margin: 0 0 6px;
}

.card-meta {
  font-size: 12px;
  color: var(--text-1);
  margin: 0;
}

.card-meta.dim {
  color: var(--text-2);
  margin-top: 2px;
}

.card-footer {
  display: flex;
  gap: 8px;
  padding: 0 14px 14px;
  align-items: center;
}

.card-footer .button {
  flex: none;
}

.card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0;
  transition: opacity 0.12s;
}

.card:hover .card-actions {
  opacity: 1;
}

.card-actions .icon-button {
  background: rgba(0, 0, 0, 0.6);
}

.badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--bg-3);
  color: var(--text-2);
}

.badge-public {
  background: rgba(52, 201, 139, 0.16);
  color: var(--success);
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-2);
}

.empty h3 {
  color: var(--text-1);
}

.loading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 50px;
  color: var(--text-2);
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ----------------------------------------------------------------- modals */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: grid;
  place-items: center;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.16s;
}

.modal-backdrop.is-in {
  opacity: 1;
}

.modal {
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.modal-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
}

.modal-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dialog-text {
  color: var(--text-1);
  margin: 0;
}

.dialog-form .field:last-child {
  margin-bottom: 0;
}

.progress-track {
  height: 6px;
  background: var(--bg-0);
  border-radius: 3px;
  overflow: hidden;
  margin: 14px 0 8px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.25s;
}

.error-text {
  color: var(--danger);
  font-size: 13px;
}

.export-status:empty {
  display: none;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.history-item:last-child {
  border-bottom: none;
}

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

.history-meta {
  font-size: 12px;
  color: var(--text-2);
}

.history-item.is-current .history-main strong {
  color: var(--accent);
}

/* ----------------------------------------------------------------- toasts */

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
}

.toast {
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  padding: 11px 15px;
  font-size: 13px;
  max-width: 340px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
}

.toast.is-in {
  opacity: 1;
  transform: none;
}

.toast-success {
  border-left-color: var(--success);
}

.toast-error {
  border-left-color: var(--danger);
}

.toast-info {
  border-left-color: var(--accent);
}

/* ----------------------------------------------------------------- errors */

.page-error {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.error-card {
  text-align: center;
}

.error-status {
  font-size: 56px;
  font-weight: 700;
  color: var(--accent);
  margin: 0;
}

.error-card h1 {
  font-size: 19px;
  color: var(--text-1);
  font-weight: 400;
  margin: 6px 0 22px;
}

/* ----------------------------------------------------------------- editor */

.page-editor,
.page-editor body,
.page-image-editor,
.page-image-editor body {
  overflow: hidden;
}

.editor {
  display: grid;
  grid-template-rows: 46px minmax(0, 1fr) minmax(0, 1fr);
  grid-template-columns: 260px minmax(0, 1fr) 270px;
  grid-template-areas:
    'toolbar toolbar toolbar'
    'panel preview inspector'
    'timeline timeline timeline';
  height: 100vh;
  gap: 1px;
  background: var(--line);
}

.editor-loading {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  display: grid;
  place-items: center;
  gap: 12px;
  color: var(--text-2);
  text-align: center;
}

.editor-loading .button {
  margin-top: 10px;
}

/* One lamp for "the app is doing something". Small and beside the save status,
   because the answer to "is it working?" belongs where you already look to find
   out whether your work is safe. */
.busy-dot {
  width: 11px;
  height: 11px;
  flex: none;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  animation: spin 0.7s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .busy-dot {
    animation: none;
    border-color: var(--accent);
    opacity: 0.6;
  }
}

.editor-toolbar {
  grid-area: toolbar;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: linear-gradient(180deg, rgba(35, 40, 51, 0.85), var(--bg-2));
  border-bottom: 1px solid var(--line);
}

.editor-toolbar .spacer {
  flex: 1;
}

.brand-compact {
  padding: 0;
}

.brand-compact .brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 8px;
}

.brand-compact .brand-mark::after {
  left: 9px;
  top: 7px;
  border-left-width: 7px;
  border-top-width: 5px;
  border-bottom-width: 5px;
}

/* Adjacent controls that act as one unit share a single outline. */
.button-group {
  display: flex;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}

.button-group .icon-button {
  border-radius: 0;
  border: none;
  padding: 6px 10px;
}

.button-group .icon-button+.icon-button {
  border-left: 1px solid var(--line);
}

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

.project-title {
  width: 190px;
  background: transparent;
  border-color: transparent;
  font-weight: 600;
  font-size: 13px;
  padding: 6px 8px;
}

.project-title:hover {
  background: var(--bg-1);
  border-color: var(--line);
}

.project-title:focus {
  background: var(--bg-1);
}

/* Dot plus label, so save state is legible at a glance without reading it. */
.save-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
}

.save-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  transition: background 0.2s;
}

.save-status.is-dirty {
  color: var(--warning);
}

.save-status.is-dirty::before {
  background: var(--warning);
}

.panel {
  grid-area: panel;
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}

.panel-tabs .tab {
  flex: 1;
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 20px 12px;
  text-align: center;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.dropzone:hover,
.dropzone.is-over {
  border-color: var(--accent);
  background: rgba(76, 141, 255, 0.06);
  color: var(--text-1);
}

.dropzone-plus {
  font-size: 20px;
  margin-bottom: 4px;
}

.upload-list:not(:empty) {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-row {
  font-size: 11px;
  color: var(--text-2);
}

.upload-row.is-processing .upload-name::after {
  content: ' — processing…';
}

.upload-name {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.upload-bar {
  height: 4px;
  background: var(--bg-0);
  border-radius: 2px;
  overflow: hidden;
}

.upload-bar-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.15s;
}

.asset-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.asset {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px solid transparent;
  cursor: grab;
  position: relative;
}

.asset:hover {
  border-color: var(--line-strong);
}

.asset:active {
  cursor: grabbing;
}

.asset-thumb {
  width: 54px;
  height: 34px;
  flex: none;
  border-radius: 3px;
  background: var(--bg-0) center/cover no-repeat;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: var(--text-2);
}

.asset-meta {
  min-width: 0;
  flex: 1;
}

.asset-name {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-sub {
  font-size: 11px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.asset-remove {
  opacity: 0;
}

.asset:hover .asset-remove {
  opacity: 1;
}

.preview-area {
  grid-area: preview;
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
  /* The full screen controls are positioned against this. */
  position: relative;
  min-height: 0;
}

.preview-stage {
  flex: 1;
  display: grid;
  /* minmax(0, 1fr) rather than the implicit auto row: against an auto-sized row
     the canvas's max-height: 100% is indefinite and gets ignored, so a 16:9
     canvas overflows a shorter stage and the bottom of the frame is clipped. */
  grid-template-rows: minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  background: var(--bg-0);
  padding: 12px;
  min-height: 0;
}

/* The frame holds the project's aspect ratio (set from the render plan) so the
   safe-area overlay insets against the picture, not the letterboxing. */
.preview-frame {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.preview-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
}

.preview-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 4px;
  text-align: center;
  padding: 20px;
  pointer-events: none;
}

.preview-empty-title {
  margin: 0;
  color: var(--text-1);
  font-size: 14px;
}

.preview-empty .hint {
  margin: 0;
  max-width: 34ch;
}

.preview-buffering {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-1);
  background: rgba(18, 22, 28, 0.88);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.safe-guides {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.safe-area {
  position: absolute;
  border: 1px dashed rgba(255, 255, 255, 0.45);
}

.safe-area.action {
  inset: 5%;
}

.safe-area.title {
  inset: 10%;
  border-color: rgba(255, 214, 0, 0.5);
}

.safe-cross {
  position: absolute;
  inset: 0;
}

.safe-cross::before,
.safe-cross::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.25);
}

.safe-cross::before {
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
}

.safe-cross::after {
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
}

.icon-button.is-on {
  color: var(--accent);
}

.transport .spacer {
  flex: 1;
}

.transport {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}

.transport-play {
  min-width: 46px;
}

.timecode {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--text-1);
  margin-left: 6px;
}

/* --- full screen preview --------------------------------------------------
   Two ways in: the browser's own full screen, or — where it refuses, which is
   every iPhone and any iframe without allowfullscreen — a fixed overlay that
   covers the window. `is-fullscreen` is set for both, so nothing below has to
   know which one it got. Keying off `:fullscreen` instead would be a trap: a
   selector list containing a pseudo-class the browser does not recognise is
   dropped whole, taking the styling for everyone else with it. */

.preview-area.is-faux-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 95;
}

/* Below the modal (100) and the toasts (200) deliberately: those still have to
   be readable, and a confirmation you cannot see is worse than one you can. */
.has-faux-fullscreen,
.has-faux-fullscreen body {
  overflow: hidden;
}

.preview-area.is-fullscreen {
  background: #000;
}

.preview-area.is-fullscreen .preview-stage {
  padding: 0;
  background: #000;
}

.preview-area.is-fullscreen .preview-frame {
  box-shadow: none;
}

/* Off the flow and over the picture, so the frame gets the whole screen rather
   than the screen minus a strip of controls. */
.preview-area.is-fullscreen .preview-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding-top: 34px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
  transition: opacity 0.18s var(--ease-out);
}

/* Controls fade with the cursor after a few still seconds — you came here to
   watch the cut, not the buttons. Any movement brings them back. */
.preview-area.is-fullscreen.is-idle .preview-overlay {
  opacity: 0;
  pointer-events: none;
}

.preview-area.is-fullscreen.is-idle {
  cursor: none;
}

.preview-area.is-fullscreen .transport {
  background: transparent;
  border-top: 0;
  padding: 6px 16px 14px;
}

.preview-area.is-fullscreen .transport .icon-button,
.preview-area.is-fullscreen .transport .timecode {
  color: rgba(255, 255, 255, 0.82);
}

.preview-area.is-fullscreen .transport .icon-button:hover:not(:disabled) {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.preview-area.is-fullscreen .transport .icon-button.is-on {
  color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .preview-overlay {
    transition: none;
  }
}

/* The seek bar only exists full screen. Below, the timeline ruler is right
   there and a second scrubber would just be another thing to keep in step. */
.preview-scrub {
  display: none;
}

.preview-area.is-fullscreen .preview-scrub {
  display: block;
  position: relative;
  height: 4px;
  margin: 0 18px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  touch-action: none;
}

/* A 4px-high target is a 4px-high target however good your aim is, so the
   grabbable area is taller than the bar that is drawn. */
.preview-scrub::before {
  content: '';
  position: absolute;
  inset: -10px 0;
}

.preview-scrub-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--accent);
  border-radius: 3px;
}

.preview-scrub-knob {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  transition: opacity 0.12s var(--ease-out);
  pointer-events: none;
}

.preview-area.is-fullscreen .preview-overlay:hover .preview-scrub-knob,
.preview-scrub.is-dragging .preview-scrub-knob {
  opacity: 1;
}

.inspector {
  grid-area: inspector;
  background: var(--bg-1);
  overflow-y: auto;
  min-height: 0;
}

.inspector-section {
  border-bottom: 1px solid var(--line);
  padding: 14px;
}

.inspector-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  margin-bottom: 12px;
}

.empty-note {
  padding: 30px 16px;
  text-align: center;
  color: var(--text-2);
  font-size: 12px;
}

/* Text style presets. Two columns keeps the swatch wide enough that the look,
   not the label, is what you pick from. */
.preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.preset {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.preset:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

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

.preset-swatch {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 6px;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* A fixed dark bed rather than a themed one: these are looks for footage,
     and most footage is not the colour of the light-theme panel. */
  background-color: #14171d;
}

.preset-name {
  padding: 0 6px 6px;
  font-size: 10px;
  color: var(--text-2);
  text-align: center;
}

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

.swatch-row input[type="color"] {
  flex: 1;
}

.ghost-btn {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-2);
  cursor: pointer;
}

.ghost-btn:hover:not(:disabled) {
  color: var(--text-1);
  border-color: var(--accent);
}

.ghost-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Canvas shape picker. Each tile is drawn at the ratio it stands for, so the
   row is readable without anyone parsing "9:16". */
.aspect-row {
  display: flex;
  gap: 6px;
}

.aspect {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 4px;
  cursor: pointer;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text-2);
  font-size: 10px;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.aspect:hover {
  border-color: var(--accent);
  color: var(--text-1);
}

.aspect.is-on {
  border-color: var(--accent);
  color: var(--text-1);
}

.aspect-box {
  display: block;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.aspect.is-on .aspect-box {
  background: color-mix(in srgb, var(--accent) 35%, transparent);
}

.aspect-name {
  font-variant-numeric: tabular-nums;
}

.segmented {
  display: flex;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.segment {
  flex: 1;
  padding: 5px 0;
  cursor: pointer;
  font-size: 11px;
  background: transparent;
  border: 0;
  color: var(--text-2);
}

.segment+.segment {
  border-left: 1px solid var(--line);
}

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

.segment.is-on {
  background: var(--accent);
  color: #fff;
}

/* Filters. Each tile previews the SELECTED clip through that grade, so the
   grid answers "what does this do to my shot" rather than "what colour is it". */
.filter-panel {
  overflow-y: auto;
  padding: 10px;
}

.filter-family+.filter-family {
  margin-top: 16px;
}

.filter-family-name {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-2);
  margin-bottom: 7px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.filter-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 0 4px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  cursor: pointer;
  color: var(--text-2);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.filter-tile:hover {
  border-color: var(--accent);
  color: var(--text-1);
}

.filter-tile.is-on {
  border-color: var(--accent);
  color: var(--text-1);
}

.filter-tile.is-on .filter-swatch {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.filter-swatch {
  display: block;
  width: 100%;
  height: auto;
  background: var(--bg-3);
}

.filter-name {
  font-size: 10px;
  text-align: center;
  padding: 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* A still cannot show a shake, so effects that animate carry a mark saying so
   rather than looking identical to the ones that do not. */
.swatch-wrap {
  position: relative;
  display: block;
}

.moves {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 9px;
  line-height: 1;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
}

.filter-tile.is-previewing {
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 10px rgba(99, 102, 241, 0.45);
  transform: translateY(-1px) scale(1.02);
  z-index: 2;
}

.effect-badge {
  position: absolute;
  right: 3px;
  bottom: 3px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  pointer-events: none;
  transition: all 0.15s ease;
}

.effect-badge.is-live {
  background: rgba(16, 185, 129, 0.95);
  color: #fff;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.5);
}

.live-dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
  animation: live-dot-pulse 0.8s infinite alternate ease-in-out;
}

@keyframes live-dot-pulse {
  from { opacity: 0.3; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1.3); }
}

.effects-guide {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-2);
  background: var(--bg-2);
  padding: 7px 10px;
  border-radius: 6px;
  margin: 0 0 12px;
  border: 1px solid var(--line);
}

.effects-guide-icon {
  font-size: 13px;
  line-height: 1;
}

/* --- CapCut-style Effects Panel --- */
.effect-panel {
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden !important;
  height: 100%;
  background: var(--bg-1);
}

.effects-header {
  padding: 10px 12px 6px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.effects-subtabs {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

.effects-subtab {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  padding: 4px 2px 8px;
  position: relative;
  transition: color 0.15s ease;
}

.effects-subtab:hover {
  color: var(--text-1);
}

.effects-subtab.is-active {
  color: #fff;
}

.effects-subtab.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 2.5px;
  background: #06b6d4;
  border-radius: 2px;
}

.effects-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.effects-search-icon {
  position: absolute;
  left: 10px;
  font-size: 11px;
  color: var(--text-2);
  pointer-events: none;
}

.effects-search-input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 26px 6px 28px;
  font-size: 11px;
  color: var(--text-0);
  outline: none;
  transition: border-color 0.15s ease;
}

.effects-search-input:focus {
  border-color: #06b6d4;
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}

.effects-search-clear {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
}

.effects-pills-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0 2px;
  scrollbar-width: none;
}

.effects-pills-bar::-webkit-scrollbar {
  display: none;
}

.effect-pill {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  border-radius: 14px;
  font-size: 11px;
  padding: 3px 10px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.effect-pill:hover {
  background: var(--bg-hover);
  color: var(--text-1);
}

.effect-pill.is-active {
  background: #27272a;
  border-color: #06b6d4;
  color: #fff;
  font-weight: 600;
}

.effects-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.effects-cat-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.effects-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.effects-cat-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-0);
  display: flex;
  align-items: center;
  gap: 5px;
}

.effects-view-all {
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.15s ease;
}

.effects-view-all:hover {
  color: #06b6d4;
}

.effects-scroll-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.effects-scroll-row::-webkit-scrollbar {
  height: 4px;
}

.effects-scroll-row::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}

.effects-grid-layout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.effect-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 72px;
  flex-shrink: 0;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-align: center;
  transition: transform 0.15s ease;
}

.effect-card:hover {
  transform: translateY(-2px);
}

.effect-thumb-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 9px;
  overflow: hidden;
  background: #18181b;
  border: 1.5px solid transparent;
  transition: all 0.15s ease;
}

.effect-card:hover .effect-thumb-wrap,
.effect-card.is-previewing .effect-thumb-wrap {
  border-color: #06b6d4;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 10px rgba(6, 182, 212, 0.4);
}

.effect-card.is-on .effect-thumb-wrap {
  border-color: #06b6d4;
  outline: 2px solid #06b6d4;
  outline-offset: 1px;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
}

.effect-thumb-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.effect-card-badge {
  position: absolute;
  top: 3px;
  left: 3px;
  font-size: 10px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
  pointer-events: none;
}

.effect-card-live {
  position: absolute;
  bottom: 3px;
  right: 3px;
  background: rgba(16, 185, 129, 0.95);
  color: #fff;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.3px;
  padding: 1px 4px;
  border-radius: 3px;
  display: none;
  align-items: center;
  gap: 2px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  pointer-events: none;
}

.effect-card.is-previewing .effect-card-live {
  display: flex;
}

.effect-card-label {
  font-size: 11px;
  color: var(--text-1);
  margin-top: 4px;
  max-width: 72px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.effect-card.is-on .effect-card-label {
  color: #06b6d4;
  font-weight: 600;
}

/* Captions. A list of rows rather than a timeline view: getting the words and
   the order right comes first, and the timing is either imported, tapped in, or
   dragged on the timeline afterwards. */
.captions-panel {
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.caption-input {
  width: 100%;
  resize: vertical;
  font-size: 12px;
}

.caption-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.caption-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.caption-toolbar .spacer {
  flex: 1;
}

.caption-count {
  font-size: 11px;
  color: var(--text-2);
}

.caption-sync {
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 8px;
}

.caption-mark {
  width: 100%;
  margin-top: 6px;
}

.caption-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.caption-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 24px;
  gap: 6px;
  align-items: start;
  padding: 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.caption-row.is-next {
  border-color: var(--accent);
}

.caption-times {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.caption-time {
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  padding: 3px 2px;
  background: var(--bg-3);
  border: 0;
  border-radius: 4px;
  color: var(--text-1);
  cursor: pointer;
}

.caption-time:hover {
  color: var(--accent);
}

.caption-here {
  font-size: 11px;
  padding: 1px;
}

.caption-text {
  width: 100%;
  resize: vertical;
  font-size: 12px;
  line-height: 1.35;
}

.caption-existing {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* Dubbing. The overrun list is the point of the panel: a line that will not fit
   its caption is the thing that quietly ruins a dub, so it is shown as work to
   do rather than left to drift. */
.dub-panel {
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dub-start {
  width: 100%;
  margin-top: 8px;
}

.dub-done {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dub-overruns {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.overrun-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.overrun {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 6px;
  text-align: left;
  cursor: pointer;
  font-size: 11px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text-1);
}

.overrun:hover {
  border-color: var(--warning, #ffb020);
}

.overrun-time {
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  font-size: 10px;
}

.overrun-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overrun-over {
  color: var(--warning, #ffb020);
  font-variant-numeric: tabular-nums;
}

/* Markers sit on the ruler rather than on a clip, because they mark the edit:
   they stay put when the clip under them is replaced. */
.marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 4;
}

.marker::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 1px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 7px solid var(--warning, #ffb020);
}

.marker::after {
  content: '';
  position: absolute;
  left: -1px;
  top: 7px;
  bottom: 0;
  width: 1px;
  background: var(--warning, #ffb020);
  opacity: 0.5;
}

.marker:hover::before {
  border-top-color: #fff;
}

.marker-label {
  position: absolute;
  left: 6px;
  top: 0;
  font-size: 9px;
  line-height: 10px;
  white-space: nowrap;
  color: var(--warning, #ffb020);
  pointer-events: none;
}

/* Shortcuts, grouped by what you are doing rather than by key — that is how
   someone arrives at the list. */
.shortcut-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
}

.shortcut-group-name {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-2);
  margin-bottom: 6px;
}

.shortcut-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  margin: 0;
}

.shortcut-list dt {
  display: flex;
  gap: 3px;
  align-items: center;
}

.shortcut-list dd {
  margin: 0;
  font-size: 12px;
  color: var(--text-1);
  align-self: center;
}

kbd {
  display: inline-block;
  min-width: 17px;
  text-align: center;
  padding: 2px 5px;
  font-size: 10px;
  font-family: inherit;
  line-height: 1.3;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--text-1);
}

@media (max-width: 600px) {
  .shortcut-groups {
    grid-template-columns: 1fr;
  }
}

/* Keyframes. The diamond sits beside the slider it animates, and the strip
   below it is the clip's own timeline — 0% is the clip's start, not the
   project's, which is where the keys are actually stored. */
.kf-field {
  position: relative;
  padding-right: 24px;
}

.kf-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 20px;
  padding: 0;
  line-height: 1;
  font-size: 11px;
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: var(--text-3, var(--text-2));
  opacity: 0.5;
  cursor: pointer;
}

.kf-toggle:hover:not(:disabled) {
  opacity: 1;
  background: var(--bg-3);
}

.kf-toggle:disabled {
  opacity: 0.2;
  cursor: default;
}

.kf-toggle.is-animated {
  opacity: 1;
  color: var(--accent);
}

.kf-toggle.is-on {
  background: var(--accent);
  color: #fff;
  opacity: 1;
}

.kf-track {
  position: relative;
  height: 12px;
  margin: -4px 0 8px;
}

.kf-track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 5px;
  height: 1px;
  background: var(--line);
}

.kf-dot {
  position: absolute;
  top: 2px;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: var(--accent);
  transform: rotate(45deg);
  border-radius: 1px;
}

.kf-dot:hover {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}

.kf-dot.is-on {
  background: #fff;
}

.timeline-area {
  grid-area: timeline;
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.timeline-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}

.timeline-toolbar .divider {
  width: 1px;
  height: 18px;
  background: var(--line);
}

.timeline-toolbar .spacer {
  flex: 1;
}

.zoom {
  width: 110px;
}

.timeline-scroll {
  flex: 1;
  overflow: auto;
  position: relative;
}

.timeline-grid {
  display: flex;
  min-width: min-content;
}

.track-headers {
  position: sticky;
  left: 0;
  z-index: 3;
  flex: none;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
}

.track-header-spacer {
  height: var(--ruler-h);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--bg-2);
  z-index: 1;
}

.track-header {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--text-1);
}

.track-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-toggle {
  padding: 2px 4px;
  font-size: 10px;
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}

.track-toggle:hover {
  background: var(--bg-3);
}

.track-toggle.is-on {
  color: var(--accent);
}

.track-remove {
  padding: 2px 4px;
  font-size: 11px;
  background: transparent;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  border-radius: 3px;
  line-height: 1;
  opacity: 0.65;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.track-remove:hover {
  opacity: 1;
  color: var(--danger, #ff5c5c);
  background: rgba(255, 92, 92, 0.15);
}

.track-header.is-effects {
  background: rgba(124, 58, 237, 0.12);
  border-bottom: 1px solid rgba(124, 58, 237, 0.22);
}

.track-header.is-effects .track-name {
  color: #c084fc;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.track-header.is-effects .track-fx-badge {
  font-size: 11px;
}

.track-header.is-effects .track-toggle,
.track-header.is-effects .track-remove {
  padding: 1px 3px;
  font-size: 9px;
}

.track-add {
  padding: 6px;
  display: flex;
  gap: 4px;
}

.track-add .button {
  flex: 1;
}

.timeline-lanes {
  position: relative;
  flex: 1;
}

.ruler {
  height: var(--ruler-h);
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.ruler-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid var(--line-strong);
  padding-left: 4px;
  font-size: 10px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.track-lane {
  position: relative;
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
}

.track-lane.is-audio {
  background: #12161b;
}

.track-lane.is-effects {
  background: rgba(124, 58, 237, 0.04);
  border-bottom: 1px solid rgba(124, 58, 237, 0.16);
}

.track-lane.is-drop-target {
  background: rgba(76, 141, 255, 0.08);
}

.clip {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: grab;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--clip-video);
  min-width: 2px;
}

.clip.kind-audio {
  background: var(--clip-audio);
}

.clip.kind-image {
  background: var(--clip-image);
}

.clip.kind-text {
  background: var(--clip-text);
}

.clip.kind-effect {
  height: 26px;
  top: 3px;
  bottom: 3px;
  background: linear-gradient(90deg, #7c3aed 0%, #9333ea 50%, #c026d3 100%);
  border: 1px solid rgba(216, 180, 254, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 6px rgba(124, 58, 237, 0.35);
  border-radius: 5px;
}

.clip.kind-effect.is-selected {
  border-color: #ffffff;
  box-shadow: 0 0 0 1.5px #ffffff, 0 0 12px rgba(168, 85, 247, 0.75);
}

.clip.kind-effect.is-drop-target {
  border-color: #ffffff !important;
  box-shadow: 0 0 0 2px #ffffff, 0 0 18px rgba(236, 72, 153, 0.9) !important;
  animation: effectDropPulse 0.7s ease-in-out infinite alternate;
}

@keyframes effectDropPulse {
  from {
    box-shadow: 0 0 0 2px #ffffff, 0 0 10px rgba(168, 85, 247, 0.7);
  }
  to {
    box-shadow: 0 0 0 2.5px #ffffff, 0 0 22px rgba(236, 72, 153, 0.95);
  }
}

.clip.kind-effect .clip-label {
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  padding: 0 8px;
}

.clip.kind-effect .clip-handle {
  width: 6px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 2px;
  transition: width 0.15s, background 0.15s;
}

.clip.kind-effect .clip-handle:hover {
  width: 8px;
  background: #ffffff;
}

.clip-effect-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 10% 50%, rgba(255, 255, 255, 0.25) 0%, transparent 45%);
}

.inspector-effect-chips {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 6px 0;
}

.inspector-effect-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 6px;
  font-size: 11px;
  color: #f3e8ff;
  transition: background 0.15s, border-color 0.15s;
}

.inspector-effect-chip:hover {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.45);
}

.inspector-effect-chip-info {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-effect-chip-icon {
  font-size: 12px;
}

.inspector-effect-chip-name {
  font-weight: 600;
  color: #ffffff;
}

.inspector-effect-chip-remove {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
}

.inspector-effect-chip-remove:hover {
  color: #ff5c5c;
  background: rgba(255, 92, 92, 0.18);
}

.clip.is-selected {
  border-color: #fff;
  box-shadow: 0 0 0 1.5px #fff, 0 2px 10px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.clip.is-dragging {
  opacity: 0.75;
  cursor: grabbing;
}

.clip.is-loading-media {
  animation: clipBufferingPulse 1.8s ease-in-out infinite;
}

@keyframes clipBufferingPulse {

  0%,
  100% {
    opacity: 0.95;
  }

  50% {
    opacity: 0.6;
  }
}

.clip-loading-indicator {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-1);
  background: rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.clip-filmstrip {
  position: absolute;
  inset: 0;
  display: flex;
  opacity: 0.65;
  pointer-events: none;
}

.clip-filmstrip img {
  height: 100%;
  object-fit: cover;
  flex: none;
}

.clip-waveform {
  position: absolute;
  inset: 0;
  opacity: 0.8;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

.clip-label {
  position: relative;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.clip-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
  z-index: 3;
}

.clip-handle:hover {
  background: rgba(255, 255, 255, 0.28);
}

.clip-handle.start {
  left: 0;
}

.clip-handle.end {
  right: 0;
}

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

.playhead::before {
  content: '';
  position: absolute;
  top: 0;
  left: -5px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--danger);
}

.snap-guide {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #f5d90a;
  pointer-events: none;
  z-index: 5;
}

/* The drawer toggles only exist on narrow screens; on a wide one both panels
   are already beside the preview and a button to reveal them would be noise. */
.drawer-toggle {
  display: none;
}

.drawer-scrim {
  display: none;
}

@media (max-width: 900px) {
  .editor {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'toolbar' 'preview' 'timeline';
  }

  /* Drawers, not display:none. Hiding them outright left a narrow window with
     no way to upload a file, add text, or reach a single clip property: the
     editor looked complete and could do almost nothing. */
  .drawer-toggle {
    display: inline-flex;
  }

  .panel,
  .inspector {
    position: fixed;
    top: 46px;
    bottom: 0;
    width: min(320px, 86vw);
    z-index: 40;
    background: var(--bg-1);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    transition: transform 0.22s ease;
    overflow-y: auto;
  }

  .panel {
    left: 0;
    transform: translateX(-102%);
    border-right: 1px solid var(--line);
  }

  .inspector {
    right: 0;
    transform: translateX(102%);
    border-left: 1px solid var(--line);
  }

  .editor.is-panel-open .panel,
  .editor.is-inspector-open .inspector {
    transform: translateX(0);
  }

  .editor.is-panel-open .drawer-scrim,
  .editor.is-inspector-open .drawer-scrim {
    display: block;
    position: fixed;
    inset: 46px 0 0;
    z-index: 39;
    background: rgba(0, 0, 0, 0.45);
  }

  /* The toolbar carries two more controls at the width with least room for
     them. Only what is marked secondary gives way: Save protects the work and
     Export is why the screen exists, so neither can be the thing that goes. */
  .editor-toolbar .title-field {
    min-width: 0;
    flex: 1;
  }

  .editor-toolbar .button.is-secondary {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {

  .panel,
  .inspector {
    transition: none;
  }
}

/* ==========================================================================
   Marketing — modern surface treatment and real 3D depth
   ========================================================================== */

.page-marketing .site-main {
  max-width: 1180px;
  padding-top: 0;
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

.gradient-text {
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 55%, var(--accent-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Reveal-on-scroll.
   Gated on `.js` so the hidden state only ever applies when there is a script
   to undo it — without that gate a failed module leaves the page blank. Under
   reduced motion the final state is the default. */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.js [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

[data-parallax] {
  transform: translate3d(0, var(--parallax-y, 0), 0);
}

/* ------------------------------------------------------------------- hero */

.hero {
  position: relative;
  padding: 72px 0 90px;
  text-align: center;
  isolation: isolate;
  overflow: hidden;
}

.hero-canvas {
  position: absolute;
  inset: -10% -20% auto;
  height: 620px;
  width: 140%;
  z-index: -2;
  opacity: 0.9;
  pointer-events: none;
  /* Fade the grid out behind the headline and toward the edges, so it frames
     the copy instead of competing with it. */
  -webkit-mask-image:
    radial-gradient(120% 90% at 50% 8%, transparent 0%, transparent 26%, #000 62%),
    linear-gradient(#000 55%, transparent 96%);
  -webkit-mask-composite: source-in;
  mask-image:
    radial-gradient(120% 90% at 50% 8%, transparent 0%, transparent 26%, #000 62%),
    linear-gradient(#000 55%, transparent 96%);
  mask-composite: intersect;
}

/* Stands in for the canvas when WebGL is unavailable, and softens it when not. */
.hero-glow {
  position: absolute;
  top: -220px;
  left: 50%;
  width: 1100px;
  height: 620px;
  transform: translateX(-50%);
  background:
    radial-gradient(closest-side, rgba(76, 141, 255, 0.20), transparent 70%),
    radial-gradient(closest-side, rgba(176, 107, 255, 0.16), transparent 72%);
  background-position: 30% 40%, 72% 30%;
  background-repeat: no-repeat;
  background-size: 70% 90%, 62% 80%;
  filter: blur(10px);
  z-index: -3;
  pointer-events: none;
}

.hero-inner {
  position: relative;
}

.hero h1 {
  font-size: clamp(34px, 5.4vw, 62px);
  line-height: 1.06;
  letter-spacing: -0.035em;
  margin-bottom: 18px;
}

.hero-lede {
  color: var(--text-1);
  font-size: clamp(15px, 1.6vw, 18px);
  max-width: 620px;
  margin: 0 auto 30px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.button.ghost {
  background: var(--glass);
  border-color: var(--glass-line);
  backdrop-filter: blur(8px);
}

.button.ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.button.primary {
  background: linear-gradient(135deg, var(--accent), #6f7bff);
  border-color: transparent;
  box-shadow: 0 10px 30px -10px rgba(76, 141, 255, 0.8);
}

.button.primary:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.button {
  transition: background .14s, border-color .14s, transform .14s var(--ease-out), filter .14s;
}

/* --------------------------------------------------- 3D editor mockup */

.stage {
  margin-top: 54px;
  /* The perspective lives on the stage, not the card, so children at different
     translateZ genuinely separate as the card rotates. */
  perspective: 1600px;
  perspective-origin: 50% 22%;
}

.mock {
  position: relative;
  max-width: 940px;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  transform-style: preserve-3d;
  transform:
    rotateX(calc(9deg + var(--tilt-x, 0deg))) rotateY(var(--tilt-y, 0deg)) translateZ(0);
  transition: transform 0.5s var(--ease-out);
  text-align: left;
}

.mock:hover {
  transition: transform 0.1s linear;
}

@media (prefers-reduced-motion: reduce) {
  .mock {
    transform: none;
  }
}

/* Follows the pointer, so the panel reads as a physical surface. */
.mock-glare {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(320px circle at var(--glare-x, 50%) var(--glare-y, 0%),
      rgba(255, 255, 255, 0.10), transparent 65%);
}

.mock-chrome {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  transform: translateZ(18px);
}

.mock-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-strong);
}

.mock-dot:first-child {
  background: #e5484d;
}

.mock-dot:nth-child(2) {
  background: #f5b23a;
}

.mock-dot:nth-child(3) {
  background: #34c98b;
}

.mock-title {
  margin-left: 10px;
  font-size: 11px;
  color: var(--text-2);
}

.mock-pill {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  padding: 3px 10px;
  border-radius: 20px;
}

.mock-body {
  display: grid;
  grid-template-columns: 128px 1fr 116px;
  gap: 1px;
  background: var(--line);
}

.mock-panel,
.mock-inspector {
  background: var(--bg-1);
  padding: 10px;
}

.mock-panel {
  transform: translateZ(10px);
}

.mock-inspector {
  display: flex;
  flex-direction: column;
  gap: 7px;
  transform: translateZ(10px);
}

.mock-tabs {
  display: flex;
  gap: 10px;
  font-size: 10px;
  color: var(--text-2);
  margin-bottom: 10px;
}

.mock-tabs .is-on {
  color: var(--text-0);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 3px;
}

.mock-asset {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
}

.swatch {
  width: 30px;
  height: 19px;
  border-radius: 3px;
  display: block;
}

.swatch-a {
  background: linear-gradient(135deg, #ff5f6d, #ff9966);
}

.swatch-b {
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
}

.swatch-c {
  background: linear-gradient(135deg, #f59e0b, #22d3ee);
}

.mock-asset span {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: var(--bg-3);
}

.mock-label {
  height: 5px;
  width: 62%;
  border-radius: 3px;
  background: var(--bg-3);
}

.mock-label.short {
  width: 40%;
}

.mock-slider {
  height: 4px;
  border-radius: 3px;
  background: var(--bg-0);
  display: block;
}

.mock-slider i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
}

.mock-preview {
  background: var(--bg-0);
  padding: 12px;
  transform: translateZ(30px);
}

.mock-frame {
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: linear-gradient(115deg, #f97316, #ef4444 45%, #a855f7);
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.8);
}

.mock-caption {
  font-weight: 800;
  font-size: clamp(14px, 2.4vw, 26px);
  letter-spacing: 0.08em;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

.mock-transport {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 9px;
}

.mock-play {
  width: 0;
  height: 0;
  border-left: 9px solid var(--accent);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.mock-time {
  font-size: 10px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.mock-timeline {
  position: relative;
  padding: 8px 10px 12px;
  background: var(--bg-1);
  border-top: 1px solid var(--line);
  transform: translateZ(22px);
}

.mock-ruler {
  height: 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
  background-image: repeating-linear-gradient(90deg, var(--line-strong) 0 1px, transparent 1px 56px);
}

.mock-track {
  position: relative;
  height: 26px;
  margin-bottom: 5px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}

.mock-track.is-audio {
  height: 20px;
}

.mock-clip {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  color: #fff;
  padding: 3px 6px;
  overflow: hidden;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.clip-v1 {
  background: linear-gradient(135deg, #ef4444, #f97316);
}

.clip-v2 {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
}

.clip-v3 {
  background: linear-gradient(135deg, #8b5cf6, #06b6d4);
}

.clip-text {
  background: linear-gradient(135deg, #b45309, #f59e0b);
}

.clip-a {
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  display: flex;
  align-items: center;
}

.wave {
  flex: 1;
  height: 60%;
  background: repeating-linear-gradient(90deg,
      rgba(255, 255, 255, 0.75) 0 2px, transparent 2px 5px);
  mask-image: repeating-linear-gradient(90deg, #000 0 2px, transparent 2px 5px);
  opacity: 0.6;
}

.mock-playhead {
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--danger);
  box-shadow: 0 0 8px rgba(229, 72, 77, 0.9);
}

/* ------------------------------------------------------------------ stats */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin: 10px 0 90px;
}

.stats>div {
  background: var(--bg-1);
  padding: 22px 18px;
  text-align: center;
}

.stats strong {
  display: block;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}

.stats span {
  font-size: 12px;
  color: var(--text-2);
}

/* --------------------------------------------------------------- sections */

.section {
  margin-bottom: 100px;
}

.section-head {
  max-width: 620px;
  margin: 0 auto 40px;
  text-align: center;
}

.section-head h2 {
  font-size: clamp(26px, 3.4vw, 38px);
  letter-spacing: -0.03em;
}

.section-lede {
  color: var(--text-1);
  margin: 0;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 18px;
}

.feature-card {
  position: relative;
  background: linear-gradient(180deg, var(--bg-1), rgba(20, 23, 28, 0.6));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform 0.4s var(--ease-out), border-color 0.2s, box-shadow 0.3s;
}

.feature-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 24px 60px -30px rgba(76, 141, 255, 0.55);
}

.feature-card h3 {
  font-size: 17px;
  margin-bottom: 8px;
}

.feature-card>p {
  color: var(--text-1);
  font-size: 14px;
}

.feature-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.feature-list li {
  position: relative;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
}

.feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.feature-card kbd {
  font-size: 11px;
}

/* Icons — small CSS-only 3D marks, no icon font. */
.feature-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(76, 141, 255, 0.18), rgba(176, 107, 255, 0.18));
  border: 1px solid var(--glass-line);
  transform: translateZ(24px);
}

.cube {
  position: relative;
  width: 18px;
  height: 18px;
  transform-style: preserve-3d;
  animation: spin-cube 9s linear infinite;
}

.cube i {
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--accent);
  background: rgba(76, 141, 255, 0.10);
}

.cube i:nth-child(1) {
  transform: translateZ(9px);
}

.cube i:nth-child(2) {
  transform: rotateY(180deg) translateZ(9px);
}

.cube i:nth-child(3) {
  transform: rotateY(90deg) translateZ(9px);
}

.cube i:nth-child(4) {
  transform: rotateY(-90deg) translateZ(9px);
}

.cube i:nth-child(5) {
  transform: rotateX(90deg) translateZ(9px);
}

.cube i:nth-child(6) {
  transform: rotateX(-90deg) translateZ(9px);
}

@keyframes spin-cube {
  to {
    transform: rotateX(360deg) rotateY(360deg);
  }
}

.layers {
  position: relative;
  width: 22px;
  height: 18px;
  transform-style: preserve-3d;
  transform: rotateX(52deg) rotateZ(-38deg);
}

.layers i {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  border: 1.5px solid var(--accent-2);
  background: rgba(176, 107, 255, 0.12);
}

.layers i:nth-child(2) {
  transform: translateZ(5px);
  border-color: var(--accent);
}

.layers i:nth-child(3) {
  transform: translateZ(10px);
  border-color: var(--accent-3);
}

.scissors,
.clock,
.spark {
  width: 20px;
  height: 20px;
  position: relative;
}

.scissors::before,
.scissors::after {
  content: '';
  position: absolute;
  left: 9px;
  top: 0;
  width: 2px;
  height: 20px;
  background: var(--accent);
  border-radius: 2px;
}

.scissors::before {
  transform: rotate(22deg);
}

.scissors::after {
  transform: rotate(-22deg);
  background: var(--accent-2);
}

.clock {
  border: 2px solid var(--accent);
  border-radius: 50%;
}

.clock::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 20%;
  width: 2px;
  height: 34%;
  background: var(--accent);
  transform-origin: bottom center;
  animation: sweep 4s linear infinite;
}

@keyframes sweep {
  to {
    transform: rotate(360deg);
  }
}

.spark::before,
.spark::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
}

.spark::after {
  width: 60%;
  height: 60%;
  opacity: 0.5;
  animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    transform: scale(1.5);
    opacity: 0.15;
  }
}

.type-glyph {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media (prefers-reduced-motion: reduce) {

  .cube,
  .clock::after,
  .spark::after {
    animation: none;
  }
}

/* ----------------------------------------------------------- split / pipe */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

.split-copy h2 {
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.03em;
}

.split-copy>p {
  color: var(--text-1);
}

.check-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
}

.check-list li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 9px;
  color: var(--text-1);
  font-size: 14px;
}

.check-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 15px;
  height: 8px;
  border-left: 2px solid var(--accent-3);
  border-bottom: 2px solid var(--accent-3);
  transform: rotate(-45deg);
}

.pipeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 24px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--bg-1), rgba(20, 23, 28, 0.5));
  border: 1px solid var(--line);
  transform: perspective(1000px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform 0.4s var(--ease-out);
  transform-style: preserve-3d;
}

.pipe-step {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 15px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}

.pipe-step.is-final {
  border-color: rgba(52, 201, 139, 0.5);
  background: rgba(52, 201, 139, 0.08);
}

.pipe-num {
  width: 25px;
  height: 25px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.pipe-step strong {
  display: block;
  font-size: 14px;
}

.pipe-step em {
  font-style: normal;
  font-size: 12px;
  color: var(--text-2);
}

/* Connector between pipeline steps: a line with a chevron at its foot, so the
   direction of flow is legible rather than implied by stacking order. */
.pipe-arrow {
  position: relative;
  width: 2px;
  height: 22px;
  margin-left: 27px;
  background: linear-gradient(var(--accent), var(--accent-2));
  opacity: 0.75;
}

.pipe-arrow::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 7px;
  height: 7px;
  transform: translateX(-50%) rotate(45deg);
  border-right: 2px solid var(--accent-2);
  border-bottom: 2px solid var(--accent-2);
}

/* -------------------------------------------------------------- shortcuts */

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

.shortcut-grid>div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg-1);
  border: 1px solid var(--line);
}

.shortcut-grid span {
  font-size: 13px;
  color: var(--text-1);
}

kbd {
  display: inline-block;
  padding: 3px 7px;
  font-size: 11px;
  font-family: inherit;
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--text-0);
}

/* -------------------------------------------------------------------- cta */

.cta {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(700px circle at 20% 0%, rgba(76, 141, 255, 0.18), transparent 60%),
    radial-gradient(600px circle at 85% 100%, rgba(176, 107, 255, 0.16), transparent 60%),
    var(--bg-1);
  padding: 56px 24px;
  text-align: center;
  margin-bottom: 40px;
}

.cta h2 {
  font-size: clamp(24px, 3.2vw, 34px);
  letter-spacing: -0.03em;
}

.cta p {
  color: var(--text-1);
  margin-bottom: 24px;
}

@media (max-width: 860px) {
  .split {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .mock-body {
    grid-template-columns: 1fr;
  }

  .mock-panel,
  .mock-inspector {
    display: none;
  }

  .hero {
    padding-top: 40px;
  }
}


/* ==========================================================================
   App pages — same visual language as the marketing surface
   ========================================================================== */

.page-app .page-head h1,
.page-auth h1 {
  letter-spacing: -0.03em;
}

/* Cards lift and pick up an accent edge on hover, and tilt toward the pointer
   where the motion layer is active. */
.card {
  transform-style: preserve-3d;
  transform:
    perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateY(0);
  transition: transform 0.35s var(--ease-out), border-color 0.2s, box-shadow 0.3s;
}

.card:hover {
  transform:
    perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateY(-3px);
  box-shadow: var(--shadow-card);
}

.card-thumb {
  position: relative;
  overflow: hidden;
}

.card-thumb::after {
  /* Subtle sheen so empty thumbnails don't read as broken images. */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.06), transparent 45%);
  pointer-events: none;
}

.card-thumb img {
  transition: transform 0.5s var(--ease-out);
}

.card:hover .card-thumb img {
  transform: scale(1.04);
}

.page-head h1 {
  font-size: clamp(24px, 3vw, 32px);
}

.search,
.select {
  transition: border-color 0.15s, background 0.15s;
}

.search:focus,
.select:focus {
  background: var(--bg-2);
}

.tab {
  position: relative;
  transition: color 0.15s;
}

.tab::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease-out);
}

.tab.is-active::after {
  transform: scaleX(1);
}

.tab.is-active {
  border-bottom-color: transparent;
}

/* Auth card gets the same lit-panel treatment as the CTA. */
.auth-card {
  position: relative;
  background:
    radial-gradient(600px circle at 50% -20%, rgba(76, 141, 255, 0.14), transparent 60%),
    var(--bg-1);
  box-shadow: var(--shadow-lg);
}

.auth-card::before {
  /* Gradient hairline along the top edge. */
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
}

.empty {
  position: relative;
}

.badge-public {
  background: linear-gradient(135deg, rgba(52, 201, 139, 0.22), rgba(52, 201, 139, 0.10));
  border: 1px solid rgba(52, 201, 139, 0.35);
}

@media (prefers-reduced-motion: reduce) {

  .card,
  .card:hover,
  .card-thumb img {
    transform: none;
    transition: none;
  }
}

/* ==========================================================================
   Feedback and bug reports
   ========================================================================== */

/* Floating launcher. Sits above page content but below modals and toasts. */
.feedback-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 13px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #6f7bff);
  border: 1px solid transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 12px 30px -10px rgba(76, 141, 255, 0.85);
  transition: transform 0.18s var(--ease-out), filter 0.15s;
}

.feedback-launcher:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.feedback-icon {
  width: 15px;
  height: 13px;
  border-radius: 3px;
  border: 1.6px solid currentColor;
  position: relative;
}

.feedback-icon::after {
  /* Speech-bubble tail. */
  content: '';
  position: absolute;
  left: 2px;
  bottom: -5px;
  border-top: 5px solid currentColor;
  border-right: 5px solid transparent;
}

/* The editor uses every pixel; keep the launcher out of the timeline's way. */
.page-editor .feedback-launcher,
.page-image-editor .feedback-launcher {
  right: 14px;
  bottom: 14px;
  padding: 9px 12px;
}

.page-editor .feedback-label,
.page-image-editor .feedback-label {
  display: none;
}

@media (max-width: 640px) {
  .feedback-label {
    display: none;
  }

  .feedback-launcher {
    padding: 12px;
  }
}

/* ------------------------------------------------------------ the form */

.feedback-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.feedback-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 11px 13px;
  text-align: left;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 11px;
  white-space: normal;
}

.feedback-tab.is-active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(76, 141, 255, 0.16), rgba(176, 107, 255, 0.10));
}

.feedback-tab-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-0);
}

.feedback-tab-sub {
  font-size: 11px;
  color: var(--text-2);
}

.star-row {
  display: flex;
  gap: 4px;
}

.star {
  background: none;
  border: none;
  padding: 2px;
  font-size: 26px;
  line-height: 1;
  color: var(--line-strong);
  transition: color 0.12s, transform 0.12s var(--ease-out);
}

.star:hover {
  transform: scale(1.12);
}

.star.is-on {
  color: #f5b23a;
}

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

.severity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 9px 6px;
  margin: 0;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12px;
  color: var(--text-1);
  cursor: pointer;
}

.severity:hover {
  border-color: var(--line-strong);
}

.severity:has(input:checked) {
  border-color: var(--accent);
  background: rgba(76, 141, 255, 0.12);
  color: var(--text-0);
}

.severity input {
  margin: 0;
}

.optional {
  font-weight: 400;
  color: var(--text-2);
  font-size: 11px;
}

.diagnostics {
  margin-top: 4px;
  padding: 10px 12px;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.diagnostics summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--text-1);
}

.diagnostics-list {
  margin: 10px 0 6px;
  padding-left: 18px;
  font-size: 12px;
  color: var(--text-2);
}

.diagnostics-list li {
  margin-bottom: 3px;
}

.diagnostics code {
  background: var(--bg-2);
  padding: 1px 5px;
  border-radius: 3px;
  word-break: break-all;
}

/* --------------------------------------------------------- report cards */

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

.report {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
}

.report.is-new {
  border-left: 3px solid var(--accent);
}

.report-head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.report-subject {
  font-size: 15px;
  margin: 0;
  flex: 1;
  min-width: 160px;
}

.report-message {
  color: var(--text-1);
  font-size: 14px;
  white-space: pre-wrap;
  margin: 0 0 8px;
}

.report-meta {
  font-size: 12px;
  color: var(--text-2);
  margin: 0;
}

.report-block {
  margin: 10px 0;
}

.report-block strong {
  display: block;
  font-size: 12px;
  color: var(--text-1);
  margin-bottom: 5px;
}

.report-block pre {
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg-0);
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-1);
}

.report-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.report-actions .select {
  max-width: 150px;
}

.note-input {
  flex: 1;
  min-width: 180px;
}

.chip {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--bg-3);
  color: var(--text-2);
  white-space: nowrap;
}

.chip.kind-bug {
  background: rgba(229, 72, 77, 0.16);
  color: #ff9ea1;
}

.chip.kind-feedback {
  background: rgba(76, 141, 255, 0.16);
  color: #9dc0ff;
}

.chip.severity-low {
  background: rgba(110, 120, 137, 0.2);
  color: var(--text-1);
}

.chip.severity-medium {
  background: rgba(245, 178, 58, 0.16);
  color: var(--warning);
}

.chip.severity-high {
  background: rgba(249, 115, 22, 0.18);
  color: #ffab70;
}

.chip.severity-critical {
  background: rgba(229, 72, 77, 0.22);
  color: #ff9ea1;
}

.chip.status-new {
  background: rgba(76, 141, 255, 0.18);
  color: #9dc0ff;
}

.chip.status-triaged {
  background: rgba(176, 107, 255, 0.16);
  color: #d3aeff;
}

.chip.status-in_progress {
  background: rgba(245, 178, 58, 0.16);
  color: var(--warning);
}

.chip.status-resolved {
  background: rgba(52, 201, 139, 0.18);
  color: var(--success);
}

.chip.status-wont_fix {
  background: var(--bg-3);
  color: var(--text-2);
}

.rating {
  display: flex;
  gap: 2px;
  margin-bottom: 8px;
}

.star-static {
  font-size: 14px;
  color: var(--line-strong);
}

.star-static.is-on {
  color: #f5b23a;
}

.diag-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  margin: 10px 0 0;
  font-size: 12px;
}

.diag-grid dt {
  color: var(--text-2);
}

.diag-grid dd {
  margin: 0;
  color: var(--text-1);
  word-break: break-all;
}

/* ==========================================================================
   Theme toggle
   ========================================================================== */

.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 11px;
  color: var(--text-1);
}

.theme-toggle:hover {
  color: var(--text-0);
  background: var(--bg-hover);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
}

/* ==========================================================================
   Admin dashboard
   ========================================================================== */

.page-admin .site-main {
  max-width: 1320px;
}

.segmented {
  display: inline-flex;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2px;
}

.segmented button {
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text-2);
}

.segmented button.is-active {
  background: var(--bg-3);
  color: var(--text-0);
}

.admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-grid.is-compact {
  margin-bottom: 0;
}

.stat-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-2);
}

.stat-value {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--text-0);
}

.stat-sub {
  font-size: 12px;
  color: var(--text-2);
}

.panel-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 18px 20px;
  margin-bottom: 22px;
}

.panel-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-card-head h2 {
  font-size: 15px;
  margin: 0;
}

.panel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.panel-row>.panel-card {
  margin-bottom: 22px;
}

/* ------------------------------------------------------------------ charts */

.chart-wrap {
  width: 100%;
}

.chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.chart-grid {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-axis {
  fill: var(--text-2);
  font-size: 11px;
  font-family: inherit;
}

.chart-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-1);
}

.legend-item i {
  width: 10px;
  height: 3px;
  border-radius: 2px;
}

.bar-list {
  display: grid;
  grid-template-columns: minmax(90px, auto) 1fr;
  gap: 9px 14px;
  margin: 0;
}

.bar-list dt {
  font-size: 13px;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-prefix {
  font-size: 15px;
  line-height: 1;
}

.bar-list dd {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bar-track {
  flex: 1;
  height: 7px;
  background: var(--bg-3);
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.bar-value {
  font-size: 12px;
  color: var(--text-2);
  min-width: 84px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ tables */

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-2);
  padding: 0 12px 9px;
  border-bottom: 1px solid var(--line);
}

.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text-1);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.cell-main {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-0);
  font-weight: 500;
}

.cell-sub {
  font-size: 12px;
  color: var(--text-2);
}

/* Two lines in one cell: the value, and what qualifies it. */
.cell-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
}

.plan-select {
  max-width: 110px;
}

@media (max-width: 860px) {
  .panel-row {
    grid-template-columns: 1fr;
  }
}

/* Restricted (administrator) sign-in. Visually distinct so it is obvious this
   is not the ordinary front door. */
.auth-card.is-restricted {
  background:
    radial-gradient(600px circle at 50% -20%, rgba(245, 178, 58, 0.12), transparent 60%),
    var(--bg-1);
}

.auth-card.is-restricted::before {
  background: linear-gradient(90deg, transparent, var(--warning), transparent);
}

.restricted-badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--warning);
  background: rgba(245, 178, 58, 0.12);
  border: 1px solid rgba(245, 178, 58, 0.35);
}

/* Confirmation shown in place of the reset form once it has been submitted. */
.sent-note {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 12px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
}

.sent-note p {
  margin: 0;
  color: var(--text-1);
  font-size: 13px;
}

.sent-tick {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  position: relative;
  background: rgba(52, 201, 139, 0.14);
  border: 1px solid rgba(52, 201, 139, 0.4);
}

.sent-tick::after {
  content: '';
  position: absolute;
  left: 11px;
  top: 9px;
  width: 9px;
  height: 15px;
  border-right: 2px solid var(--success);
  border-bottom: 2px solid var(--success);
  transform: rotate(45deg);
}

/* A queued export has no percentage to show, so the bar sweeps instead of
   sitting at zero and looking stalled. */
.progress-track.is-indeterminate {
  position: relative;
  overflow: hidden;
}

.progress-track.is-indeterminate .progress-fill {
  width: 40% !important;
  animation: progress-sweep 1.2s ease-in-out infinite;
}

@keyframes progress-sweep {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(250%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .progress-track.is-indeterminate .progress-fill {
    animation: none;
    width: 100% !important;
    opacity: 0.5;
  }
}

/* Storage usage, shown in the media panel once it is worth knowing. */
.quota:not(:empty) {
  margin-top: 12px;
}

.quota-track {
  height: 4px;
  border-radius: 3px;
  background: var(--bg-0);
  overflow: hidden;
}

.quota-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.3s var(--ease-out);
}

.quota-fill.is-tight {
  background: var(--warning);
}

.quota-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
  font-size: 11px;
  color: var(--text-2);
}

/* The plan name explains the number next to it: 100 MB is not an arbitrary
   ceiling, it is what Free includes. */
.quota-plan {
  flex: none;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--bg-0);
  color: var(--text-1);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.quota-note {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--warning);
}

/* What the total is made of. Shown always, not only when it gets tight: the
   question "why is it more than what I uploaded?" arrives long before 75%. */
.quota-split {
  display: flex;
  gap: 6px;
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-2);
}

.quota-scope {
  margin-top: 2px;
  font-size: 10px;
  color: var(--text-2);
  opacity: 0.75;
}

/* Exports already made, listed in the export dialog — the only place they can
   be seen or removed. */
.past-exports:not(:empty) {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.past-exports-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.past-exports-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-0);
}

.past-export-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.past-export {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--bg-0);
}

.past-export-meta {
  flex: 1;
  min-width: 0;
}

.past-export-name {
  font-size: 12px;
  color: var(--text-0);
}

/* The list crosses projects, so each row names its own. The frame size and
   format matter less than which edit it came from. */
.past-export-spec {
  color: var(--text-2);
}

.past-export.is-here {
  box-shadow: inset 2px 0 0 var(--accent);
}

.past-export .hint {
  font-size: 11px;
}

.past-export .icon-button {
  flex: none;
  text-decoration: none;
}

.badge-r2 {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(243, 128, 32, 0.14);
  color: #ff9838;
  border: 1px solid rgba(243, 128, 32, 0.32);
  margin-left: 6px;
  vertical-align: middle;
  line-height: 1.4;
}

.r2-storage-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: #ff9838;
  background: rgba(243, 128, 32, 0.12);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid rgba(243, 128, 32, 0.28);
}

.quota-r2 {
  color: #ff9838;
  font-weight: 500;
}

/* ===========================================================================
   Google Drive Integration
   =========================================================================== */

.gdrive-section {
  margin: 12px 0 6px 0;
}

.gdrive-card {
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.gdrive-card.is-connected {
  border-color: rgba(66, 133, 244, 0.35);
  background: rgba(66, 133, 244, 0.05);
}

.gdrive-card.is-disconnected {
  border-color: var(--line);
  background: var(--bg-1);
}

.gdrive-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gdrive-status-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.gdrive-icon-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.gdrive-text-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gdrive-badge-line {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

.gdrive-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}

.gdrive-connected-pill {
  font-size: 10px;
  font-weight: 600;
  color: #34a853;
  background: rgba(52, 168, 83, 0.14);
  border: 1px solid rgba(52, 168, 83, 0.3);
  padding: 1px 6px;
  border-radius: 999px;
  line-height: 1.2;
}

.gdrive-email-label {
  font-size: 11px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gdrive-disconnect-link {
  background: none;
  border: none;
  padding: 4px 6px;
  font-size: 11px;
  color: var(--text-3);
  cursor: pointer;
  border-radius: 4px;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
  white-space: nowrap;
}

.gdrive-disconnect-link:hover {
  color: var(--danger);
}

.gdrive-connect-btn {
  background: rgba(66, 133, 244, 0.12);
  border: 1px solid rgba(66, 133, 244, 0.35);
  color: #4285f4;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius);
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.gdrive-connect-btn:hover {
  background: rgba(66, 133, 244, 0.22);
  border-color: rgba(66, 133, 244, 0.55);
  color: #5c9eff;
}

.gdrive-checkbox-row {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(66, 133, 244, 0.15);
}

.gdrive-folder-hint {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-2);
}

.badge-gdrive {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(66, 133, 244, 0.14);
  color: #4285f4;
  border: 1px solid rgba(66, 133, 244, 0.32);
  margin-left: 6px;
  vertical-align: middle;
  line-height: 1.4;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.badge-gdrive:hover {
  background: rgba(66, 133, 244, 0.25);
  color: #5c9eff;
  text-decoration: none;
}

.icon-button.gdrive-link-btn,
.icon-button.gdrive-save-btn {
  color: #4285f4;
}

.icon-button.gdrive-link-btn:hover,
.icon-button.gdrive-save-btn:hover {
  background: rgba(66, 133, 244, 0.12);
  color: #5c9eff;
}

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

.button.gdrive-action-btn {
  background: rgba(66, 133, 244, 0.14);
  border: 1px solid rgba(66, 133, 244, 0.35);
  color: #4285f4;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius);
  transition: all 0.15s ease;
}

.button.gdrive-action-btn:hover {
  background: rgba(66, 133, 244, 0.25);
  color: #6da7ff;
}

/* ===========================================================================
   Switch Toggle Component (Modern iOS/macOS toggle)
   =========================================================================== */

.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}

.switch-input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--line-strong, #3a3f4a);
  transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 22px;
}

.switch-slider::before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.switch-input:checked + .switch-slider {
  background-color: #4285f4;
}

.switch-input:checked + .switch-slider::before {
  transform: translateX(16px);
}

.switch-input:focus-visible + .switch-slider {
  outline: 2px solid #4285f4;
  outline-offset: 2px;
}

.switch-input:disabled + .switch-slider {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ===========================================================================
   Google Drive Export Toggle & Actions
   =========================================================================== */

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

.gdrive-settings-link {
  background: none;
  border: none;
  font-size: 11px;
  color: var(--text-2);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.gdrive-settings-link:hover {
  color: var(--text-1);
  background: var(--bg-2);
}

.gdrive-toggle-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(66, 133, 244, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gdrive-toggle-meta {
  flex: 1;
  min-width: 0;
}

.gdrive-toggle-meta label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-1);
  cursor: pointer;
  display: block;
}

/* ===========================================================================
   User Settings Modal Dialog
   =========================================================================== */

.user-settings-dialog {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.settings-section-head h4 {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  color: var(--text-1);
}

.settings-card {
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--bg-1);
  border: 1px solid var(--line);
}

.settings-card.is-connected {
  border-color: rgba(66, 133, 244, 0.35);
  background: rgba(66, 133, 244, 0.04);
}

.settings-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-card-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.settings-card-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-card-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-toggle-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(66, 133, 244, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.settings-toggle-label {
  flex: 1;
  min-width: 0;
}

.settings-toggle-label label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  cursor: pointer;
  display: block;
}

/* ===========================================================================
   Admin Integrations Grid
   =========================================================================== */

.integrations-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.integration-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.integration-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* An upload that is still being processed: visible, but not yet usable. */
.asset.is-processing {
  opacity: 0.75;
  cursor: default;
}

.asset.is-processing .asset-sub {
  color: var(--accent);
}

.asset.is-failed {
  border-color: rgba(229, 72, 77, 0.4);
  cursor: default;
}

.asset.is-failed .asset-sub {
  color: var(--danger);
}

.asset-thumb .spinner {
  width: 14px;
  height: 14px;
}

/* ===========================================================================
   Landing page
   =========================================================================== */

.stage {
  position: relative;
}

.shortcut-heading {
  margin: 26px 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.shortcut-heading:first-of-type {
  margin-top: 0;
}

/* ===========================================================================
   FAQ & Footer (SEO)
   =========================================================================== */

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.faq-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.2s, transform 0.2s;
}

.faq-card:hover {
  border-color: rgba(76, 141, 255, 0.4);
  transform: translateY(-2px);
}

.faq-card h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: 10px;
  line-height: 1.4;
}

.faq-card p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-1);
  margin: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-0);
  padding: 64px 24px 32px;
  color: var(--text-1);
  font-size: 14px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

@media (max-width: 800px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 500px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
}

.footer-col h4 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-0);
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  color: var(--text-1);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  max-width: 1200px;
  margin: 48px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--text-2);
}

/* ==========================================================================
   CapCut Animations & Transitions (Inspector & Modal)
   ========================================================================== */

.btn-anim-open-modal {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(168, 85, 247, 0.15));
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-anim-open-modal:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.3), rgba(168, 85, 247, 0.3));
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

.inspector-anim-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 8px 10px;
}

.anim-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.anim-row-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn-clear-anim {
  background: transparent;
  border: none;
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.btn-clear-anim:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

.btn-anim-picker {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-1, #18181b);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--text-0, #f4f4f5);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  min-width: 0;
}

.btn-anim-picker:hover {
  border-color: #06b6d4;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.25);
  background: rgba(6, 182, 212, 0.05);
}

.anim-picker-icon {
  font-size: 14px;
}

.anim-picker-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.anim-picker-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(6, 182, 212, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.4);
}

/* Modal Layout */
.capcut-anim-modal-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 72vh;
  overflow: hidden;
}

.anim-modal-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.anim-modal-tab {
  background: transparent;
  border: none;
  color: var(--text-2, #a1a1aa);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.anim-modal-tab:hover {
  color: var(--text-0, #ffffff);
  background: rgba(255, 255, 255, 0.04);
}

.anim-modal-tab.is-active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.3);
}

/* Duration Bar */
.anim-modal-duration-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 14px;
}

.anim-duration-label-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1, #d4d4d8);
  white-space: nowrap;
}

.anim-duration-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
  color: #ffffff;
}

.anim-duration-slider {
  flex: 1;
  accent-color: #06b6d4;
  height: 6px;
  cursor: pointer;
}

.anim-duration-presets {
  display: flex;
  gap: 6px;
}

.anim-preset-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-1, #d4d4d8);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.anim-preset-chip:hover {
  background: rgba(6, 182, 212, 0.2);
  border-color: #06b6d4;
  color: #38bdf8;
}

/* Category Filter Pills */
.anim-modal-categories {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.anim-category-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-2, #a1a1aa);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.anim-category-pill:hover {
  color: var(--text-0, #f4f4f5);
  background: rgba(255, 255, 255, 0.08);
}

.anim-category-pill.is-active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(168, 85, 247, 0.25));
  border-color: #06b6d4;
  color: #38bdf8;
  font-weight: 600;
}

/* Grid of Cards */
.anim-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding: 4px 2px;
}

.anim-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: #18181b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 8px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  color: var(--text-1, #e4e4e7);
}

.anim-card:hover {
  border-color: #06b6d4;
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.2);
  transform: translateY(-2px);
  color: #ffffff;
}

.anim-card.is-active {
  border-color: #06b6d4;
  background: rgba(6, 182, 212, 0.08);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.4), 0 4px 16px rgba(6, 182, 212, 0.25);
}

.anim-card.is-active::after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #06b6d4;
  color: #000000;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Preview Box inside Card */
.anim-preview-box {
  width: 78px;
  height: 52px;
  background: #09090b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.anim-icon-placeholder {
  font-size: 20px;
  opacity: 0.6;
}

.anim-preview-icon {
  position: absolute;
  bottom: 3px;
  right: 4px;
  font-size: 12px;
  opacity: 0.8;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8));
}

.anim-card-title {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
}

.anim-card-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-2, #a1a1aa);
}

.anim-card:hover .anim-card-badge,
.anim-card.is-active .anim-card-badge {
  background: rgba(6, 182, 212, 0.2);
  color: #38bdf8;
}

/* Preview Shape inside preview box */
.anim-preview-shape {
  width: 38px;
  height: 26px;
  border-radius: 4px;
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3);
  transition: all 0.2s ease;
}

/* Hover and Active CSS Micro-Animations */
.anim-card:hover .shape-zoom-in,
.anim-card.is-active .shape-zoom-in {
  animation: animShapeZoomIn 1s ease-out infinite;
}

@keyframes animShapeZoomIn {
  0% { transform: scale(0.1); opacity: 0; }
  60% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.anim-card:hover .shape-zoom-out,
.anim-card.is-active .shape-zoom-out {
  animation: animShapeZoomOut 1s ease-out infinite;
}

@keyframes animShapeZoomOut {
  0% { transform: scale(1); opacity: 1; }
  80% { transform: scale(0.1); opacity: 0; }
  100% { transform: scale(0.1); opacity: 0; }
}

.anim-card:hover .shape-zoom-out-in,
.anim-card.is-active .shape-zoom-out-in {
  animation: animShapeZoomOutIn 1s ease-out infinite;
}

@keyframes animShapeZoomOutIn {
  0% { transform: scale(1.8); opacity: 0.2; }
  60% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.anim-card:hover .shape-slide-right,
.anim-card.is-active .shape-slide-right {
  animation: animShapeSlideRight 1.2s ease-out infinite;
}

@keyframes animShapeSlideRight {
  0% { transform: translateX(-40px); opacity: 0; }
  60% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(0); opacity: 1; }
}

.anim-card:hover .shape-slide-left,
.anim-card.is-active .shape-slide-left {
  animation: animShapeSlideLeft 1.2s ease-out infinite;
}

@keyframes animShapeSlideLeft {
  0% { transform: translateX(40px); opacity: 0; }
  60% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(0); opacity: 1; }
}

.anim-card:hover .shape-slide-up,
.anim-card.is-active .shape-slide-up {
  animation: animShapeSlideUp 1.2s ease-out infinite;
}

@keyframes animShapeSlideUp {
  0% { transform: translateY(30px); opacity: 0; }
  60% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

.anim-card:hover .shape-slide-down,
.anim-card.is-active .shape-slide-down {
  animation: animShapeSlideDown 1.2s ease-out infinite;
}

@keyframes animShapeSlideDown {
  0% { transform: translateY(-30px); opacity: 0; }
  60% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

.anim-card:hover .shape-spin-in,
.anim-card.is-active .shape-spin-in {
  animation: animShapeSpinIn 1.2s ease-out infinite;
}

@keyframes animShapeSpinIn {
  0% { transform: scale(0.2) rotate(-180deg); opacity: 0; }
  70% { transform: scale(1) rotate(0deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.anim-card:hover .shape-swing-in,
.anim-card.is-active .shape-swing-in {
  animation: animShapeSwingIn 1.4s ease-out infinite;
}

@keyframes animShapeSwingIn {
  0% { transform: rotate(-30deg); transform-origin: top center; }
  30% { transform: rotate(20deg); transform-origin: top center; }
  60% { transform: rotate(-8deg); transform-origin: top center; }
  80% { transform: rotate(3deg); transform-origin: top center; }
  100% { transform: rotate(0deg); transform-origin: top center; }
}

.anim-card:hover .shape-bounce-in,
.anim-card.is-active .shape-bounce-in {
  animation: animShapeBounceIn 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}

@keyframes animShapeBounceIn {
  0% { transform: scale(0.1); opacity: 0; }
  50% { transform: scale(1.25); opacity: 1; }
  75% { transform: scale(0.92); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.anim-card:hover .shape-flip-in,
.anim-card.is-active .shape-flip-in {
  animation: animShapeFlipIn 1.2s ease-out infinite;
}

@keyframes animShapeFlipIn {
  0% { transform: scaleX(0.05); opacity: 0.3; }
  60% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 1; }
}

.anim-card:hover .shape-shake-in,
.anim-card.is-active .shape-shake-in {
  animation: animShapeShake 0.8s ease-in-out infinite;
}

@keyframes animShapeShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-4px, 2px); }
  40% { transform: translate(4px, -2px); }
  60% { transform: translate(-3px, -1px); }
  80% { transform: translate(3px, 1px); }
}

.anim-card:hover .shape-glitch-in,
.anim-card.is-active .shape-glitch-in {
  animation: animShapeGlitch 0.9s steps(3) infinite;
}

@keyframes animShapeGlitch {
  0%, 100% { transform: translate(0, 0); filter: hue-rotate(0deg); }
  33% { transform: translate(-3px, 2px); filter: hue-rotate(90deg); }
  66% { transform: translate(3px, -2px); filter: hue-rotate(-90deg); }
}

.anim-card:hover .shape-wipe-right,
.anim-card.is-active .shape-wipe-right {
  animation: animShapeWipeRight 1.2s ease-out infinite;
}

@keyframes animShapeWipeRight {
  0% { clip-path: inset(0 100% 0 0); }
  60% { clip-path: inset(0 0 0 0); }
  100% { clip-path: inset(0 0 0 0); }
}

.anim-card:hover .shape-circle-open,
.anim-card.is-active .shape-circle-open {
  animation: animShapeCircleOpen 1.2s ease-out infinite;
}

@keyframes animShapeCircleOpen {
  0% { clip-path: circle(0% at center); }
  60% { clip-path: circle(75% at center); }
  100% { clip-path: circle(75% at center); }
}

.anim-card:hover .shape-blur-in,
.anim-card.is-active .shape-blur-in {
  animation: animShapeBlurIn 1.2s ease-out infinite;
}

@keyframes animShapeBlurIn {
  0% { filter: blur(8px); opacity: 0.2; }
  60% { filter: blur(0px); opacity: 1; }
  100% { filter: blur(0px); opacity: 1; }
}

/* Modal Footer Actions */
.anim-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
}

/* ------------------------------------------------ Admin Storage Allocation */

.storage-cell-stack {
  min-width: 150px;
}

.cell-row-flex {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.storage-allocate-btn {
  font-size: 11px;
  padding: 3px 8px;
  line-height: 1.2;
  border-radius: 4px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text-1);
  cursor: pointer;
  transition: all 0.15s ease;
}

.storage-allocate-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.chip.chip-custom-quota {
  background: rgba(168, 85, 247, 0.16);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.modal-quota-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--text-0);
}

.modal-user-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-user-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-0);
}

.modal-user-sub {
  font-size: 12px;
  color: var(--text-2);
}

.modal-quota-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-quota-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}

.modal-quota-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.modal-preset-btn {
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text-1);
  cursor: pointer;
  transition: all 0.12s ease;
}

.modal-preset-btn:hover {
  background: var(--bg-hover);
  color: var(--text-0);
  border-color: var(--line-strong);
}

.modal-preset-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.modal-quota-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-quota-num {
  flex: 1;
}

.modal-quota-unit {
  width: 90px;
}

.modal-quota-summary {
  background: rgba(76, 141, 255, 0.08);
  border: 1px solid rgba(76, 141, 255, 0.22);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-0);
  line-height: 1.4;
}

.modal-quota-summary strong {
  color: var(--accent);
}

/* ==========================================================================
   CapCut Template Flow & Template Mode Styles
   ========================================================================== */

/* Template Card Badges on Gallery */
.card-thumb {
  position: relative;
}

.card-slot-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffd400;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 212, 0, 0.35);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  letter-spacing: 0.2px;
  pointer-events: none;
}

.card-ratio-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(6px);
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

/* Template Wizard Modal */
.wizard-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wizard-header-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wizard-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.wizard-guide {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.45;
  margin: 0;
}

.batch-select-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(76, 141, 255, 0.12), rgba(255, 45, 120, 0.12));
  border: 1px solid rgba(76, 141, 255, 0.4);
  border-radius: 10px;
  color: var(--text-0);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.batch-select-btn:hover {
  background: linear-gradient(135deg, rgba(76, 141, 255, 0.2), rgba(255, 45, 120, 0.2));
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(76, 141, 255, 0.25);
}

.batch-icon {
  font-size: 22px;
}

.batch-hint {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 400;
}

.wizard-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  max-height: 290px;
  overflow-y: auto;
  padding: 2px;
  scrollbar-width: thin;
}

.wizard-slot-card {
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wizard-slot-card.is-filled {
  border-color: rgba(76, 141, 255, 0.5);
  background: rgba(76, 141, 255, 0.05);
}

.wizard-slot-card.is-empty {
  border-style: dashed;
  border-color: rgba(255, 212, 0, 0.4);
}

.wizard-slot-card:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.slot-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slot-pill {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-1);
}

.slot-remove-btn {
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  font-size: 12px;
  padding: 0 4px;
  line-height: 1;
}

.slot-remove-btn:hover {
  color: #ff4d4f;
}

.slot-thumb-wrap {
  position: relative;
  width: 100%;
  height: 72px;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slot-thumb-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slot-replace-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.slot-thumb-wrap:hover .slot-replace-overlay {
  opacity: 1;
}

.slot-empty-body {
  height: 72px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-2);
}

.slot-empty-icon {
  font-size: 20px;
}

.slot-empty-text {
  font-size: 11px;
  font-weight: 500;
}

.slot-card-label {
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wizard-text-details {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
}

.wizard-text-summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.wizard-text-badge {
  font-size: 11px;
  color: var(--text-2);
  font-weight: 400;
}

.wizard-text-inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.wizard-text-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wizard-text-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
}

.wizard-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  padding: 10px;
  background: rgba(76, 141, 255, 0.05);
  border: 1px solid rgba(76, 141, 255, 0.2);
  border-radius: 8px;
}

.wizard-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--surface-2);
  overflow: hidden;
}

.wizard-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ff2d78);
  transition: width 0.2s ease;
}

.wizard-progress-status {
  font-size: 12px;
  color: var(--text-1);
  text-align: center;
  font-weight: 500;
}

.wizard-count-badge {
  margin-right: auto;
  font-weight: 600;
}

/* ==========================================================================
   Editor Template Mode Layout & Controls
   ========================================================================== */

.editor.is-template-mode {
  grid-template-rows: 46px minmax(0, 1fr) 195px !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-areas:
    'toolbar'
    'preview'
    'template-bar' !important;
}

.editor.is-template-mode .preview {
  grid-area: preview !important;
  max-width: 100%;
  margin: 0 auto;
}

.editor.is-template-mode .template-bar {
  grid-area: template-bar !important;
}

.editor.is-template-mode > .panel:not(.template-bar),
.editor.is-template-mode > .timeline {
  display: none !important;
}

.template-active-badge {
  font-size: 11px;
  margin-left: 8px;
  letter-spacing: 0.2px;
}

.template-bar {
  background: var(--surface-1);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 18px;
  min-height: 185px;
  max-height: 220px;
  overflow: hidden;
}

.template-bar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.template-bar-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.template-bar-hint {
  font-size: 12px;
  color: var(--text-2);
}

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

.template-slots-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.template-slot-chip {
  flex: 0 0 170px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s ease;
}

.template-slot-chip.is-filled {
  border-color: rgba(76, 141, 255, 0.35);
}

.template-slot-chip.is-empty {
  border-style: dashed;
  border-color: rgba(255, 212, 0, 0.5);
}

.template-slot-chip:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.slot-chip-head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
}

.slot-chip-num {
  color: var(--accent);
}

.slot-chip-time {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 3px;
}

.slot-chip-body {
  display: flex;
  gap: 8px;
  align-items: center;
}

.slot-chip-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: #000;
  flex: none;
}

.slot-chip-icon {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex: none;
}

.slot-chip-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slot-chip-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.template-text-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 420px;
  overflow-y: auto;
  padding: 4px;
}

@media (max-width: 768px) {
  .editor.is-template-mode {
    grid-template-rows: 46px minmax(0, 1fr) 175px !important;
  }
  .template-bar {
    padding: 10px 12px;
  }
  .template-slot-chip {
    flex: 0 0 145px;
  }
}

/* ==========================================================================
   CapCut-Style Audio & SFX Library Panel
   ========================================================================== */

.audio-library-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
}

.audio-library-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: none;
}

.audio-header-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-0);
}

.audio-upload-bar {
  display: flex;
}

.audio-upload-btn {
  width: 100%;
  border-style: dashed !important;
  border-color: rgba(76, 141, 255, 0.4) !important;
  background: rgba(76, 141, 255, 0.04) !important;
  padding: 7px 12px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  justify-content: center;
  transition: all 0.15s ease;
}

.audio-upload-btn:hover {
  border-color: var(--accent) !important;
  background: rgba(76, 141, 255, 0.12) !important;
  color: var(--text-0) !important;
}

.audio-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.audio-search-input {
  width: 100%;
  font-size: 12px !important;
  padding: 8px 30px 8px 32px !important;
  border-radius: 6px !important;
}

.audio-search-icon {
  position: absolute;
  left: 10px;
  pointer-events: none;
  font-size: 12px;
  opacity: 0.6;
}

.audio-search-clear {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  font-size: 12px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s ease;
}

.audio-search-clear:hover {
  color: var(--text-0);
  background: rgba(255, 255, 255, 0.1);
}

.audio-category-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.audio-category-pills::-webkit-scrollbar {
  display: none;
}

.audio-pill {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.audio-pill:hover {
  color: var(--text-0);
  border-color: var(--line-active, rgba(255, 255, 255, 0.2));
  background: var(--surface-3);
}

.audio-pill.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(76, 141, 255, 0.35);
}

.audio-track-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.audio-track-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  transition: all 0.15s ease;
  gap: 8px;
}

.audio-track-row:hover {
  background: var(--bg-hover);
  border-color: rgba(76, 141, 255, 0.3);
}

.audio-track-row.is-playing {
  border-color: rgba(76, 141, 255, 0.6);
  background: rgba(76, 141, 255, 0.08);
}

.audio-track-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

/* Cover Art & Play Button Overlay */
.audio-thumb-wrap {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  flex: none;
  background: var(--surface-3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

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

.audio-thumb-icon {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: linear-gradient(135deg, rgba(76, 141, 255, 0.15), rgba(155, 89, 182, 0.2));
}

.audio-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.audio-thumb-wrap:hover .audio-thumb-overlay,
.audio-track-row:hover .audio-thumb-overlay,
.audio-track-row.is-playing .audio-thumb-overlay {
  opacity: 1;
}

.audio-thumb-play {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 9px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.audio-wave-bars {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  flex: none;
}

.audio-track-row.is-playing .audio-wave-bars {
  display: flex;
}

.audio-wave-bars .bar {
  width: 2px;
  background: var(--accent);
  border-radius: 1px;
  animation: audioWave 0.8s ease-in-out infinite alternate;
}

.audio-wave-bars .bar:nth-child(1) { height: 40%; animation-delay: 0.1s; }
.audio-wave-bars .bar:nth-child(2) { height: 100%; animation-delay: 0.3s; }
.audio-wave-bars .bar:nth-child(3) { height: 70%; animation-delay: 0.2s; }
.audio-wave-bars .bar:nth-child(4) { height: 50%; animation-delay: 0.4s; }

@keyframes audioWave {
  0% { height: 20%; }
  100% { height: 100%; }
}

.audio-play-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--text-0);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 11px;
  flex: none;
  transition: all 0.15s ease;
  padding: 0;
}

.audio-play-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: scale(1.08);
}

.audio-track-row.is-playing .audio-play-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 10px rgba(76, 141, 255, 0.45);
}

.audio-track-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
  cursor: pointer;
}

.audio-track-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-track-artist {
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-track-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-2);
  margin-top: 1px;
}

.audio-badge {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-1);
}

.audio-bpm {
  color: #ff9f43;
  font-weight: 600;
  font-size: 9px;
}

.audio-duration {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  color: var(--text-2);
  margin-left: auto;
}

.audio-add-btn {
  flex: none;
  font-weight: 600 !important;
  padding: 4px 10px !important;
  font-size: 11px !important;
  border-radius: 6px !important;
}

.audio-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 30px 10px;
  text-align: center;
  color: var(--text-2);
}

.audio-empty-icon {
  font-size: 28px;
  opacity: 0.6;
}

.audio-empty-msg {
  font-size: 12px;
  margin: 0;
}