/* ClipMerge's shared styles, on top of Bootstrap 5.3. */

:root {
  --cm-blue: #3a66db;
  --cm-blue-600: #2f55c4;
  --cm-blue-050: #eef3ff;
  --cm-blue-100: #dbe5ff;
  --cm-navy: #1c2a52;
  --cm-ink: #1f2937;
  /* Secondary text: at least 4.5:1 contrast on the page, white and the light blue panels. */
  --cm-muted: #5b6b82;
  --cm-line: #e4e9f2;
  --cm-bg: #f6f8fc;
  --cm-surface: #ffffff;
  --cm-green: #0f9d74;
  --cm-green-050: #e8f7f1;
  --cm-red: #d93d4a;
  --cm-red-050: #fdecee;
  --cm-amber: #a16207;
  --cm-amber-050: #fff6e5;
  /* Solid blues behind white text: the same in both themes, where --cm-blue gets lighter in dark for text. */
  --cm-fill: #3a66db;
  --cm-fill-strong: #2f55c4;
  --cm-toast: #1c2a52;
  /* Red behind white text (error messages): the same in both themes, about 5.4:1. */
  --cm-danger-fill: #c8303e;
  --cm-radius: 14px;
  --cm-radius-sm: 10px;
  --cm-shadow: 0 1px 2px rgba(28, 42, 82, 0.06), 0 8px 24px rgba(28, 42, 82, 0.06);
  --cm-shadow-lg: 0 2px 4px rgba(28, 42, 82, 0.06), 0 18px 48px rgba(28, 42, 82, 0.12);

  --bs-body-font-family: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-secondary-rgb: 91, 107, 130;
  --bs-secondary-color: #5b6b82;
  --bs-body-color: var(--cm-ink);
  --bs-body-bg: var(--cm-bg);
  --bs-link-color: var(--cm-blue);
  --bs-link-color-rgb: 58, 102, 219;
  --bs-link-hover-color: var(--cm-blue-600);
  --bs-link-hover-color-rgb: 47, 85, 196;
  --bs-primary: var(--cm-blue);
  --bs-primary-rgb: 58, 102, 219;
  --bs-border-color: var(--cm-line);
  --bs-border-radius: var(--cm-radius-sm);
}

body {
  background: var(--cm-bg);
  color: var(--cm-ink);
  font-family: var(--bs-body-font-family);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

h1,
h2,
h3,
h4,
h5,
.h1,
.h2,
.h3,
.h4 {
  color: var(--cm-navy);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1,
h2,
h3,
.lead,
.section-head p {
  text-wrap: balance;
}

p,
li,
summary {
  text-wrap: pretty;
}

::selection {
  background: rgba(58, 102, 219, 0.22);
}

:focus-visible {
  outline: 3px solid rgba(58, 102, 219, 0.45);
  outline-offset: 2px;
}

.visually-hidden-focusable:focus {
  position: fixed !important;
  top: 8px;
  left: 8px;
  z-index: 2000;
  background: var(--cm-surface);
  padding: 8px 14px;
  border-radius: 8px;
  box-shadow: var(--cm-shadow);
}

/* --- Buttons --- */

.btn {
  --bs-btn-font-weight: 600;
  --bs-btn-border-radius: var(--cm-radius-sm);
  --bs-btn-padding-x: 1.1rem;
  --bs-btn-padding-y: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-sm {
  --bs-btn-padding-x: 0.75rem;
  --bs-btn-padding-y: 0.35rem;
  --bs-btn-border-radius: 8px;
}

.btn-lg {
  --bs-btn-padding-x: 1.5rem;
  --bs-btn-padding-y: 0.8rem;
  --bs-btn-font-size: 1.05rem;
}

.btn-primary {
  --bs-btn-bg: var(--cm-fill);
  --bs-btn-border-color: var(--cm-fill);
  --bs-btn-hover-bg: var(--cm-fill-strong);
  --bs-btn-hover-border-color: var(--cm-fill-strong);
  --bs-btn-active-bg: #284aae;
  --bs-btn-active-border-color: #284aae;
  --bs-btn-disabled-bg: #9db3ec;
  --bs-btn-disabled-border-color: #9db3ec;
  box-shadow: 0 6px 16px rgba(58, 102, 219, 0.25);
}

.btn-primary:disabled {
  box-shadow: none;
}

.btn-soft {
  --bs-btn-color: var(--cm-blue);
  --bs-btn-bg: var(--cm-blue-050);
  --bs-btn-border-color: transparent;
  --bs-btn-hover-color: var(--cm-blue-600);
  --bs-btn-hover-bg: var(--cm-blue-100);
  --bs-btn-hover-border-color: transparent;
  --bs-btn-active-color: var(--cm-blue-600);
  --bs-btn-active-bg: var(--cm-blue-100);
}

.btn-quiet {
  --bs-btn-color: var(--cm-muted);
  --bs-btn-bg: transparent;
  --bs-btn-border-color: var(--cm-line);
  --bs-btn-hover-color: var(--cm-ink);
  --bs-btn-hover-bg: var(--cm-surface);
  --bs-btn-hover-border-color: #cfd7e6;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--cm-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--cm-blue-050);
  color: var(--cm-blue);
}

.icon-btn.danger:hover {
  background: var(--cm-red-050);
  color: var(--cm-red);
}

.icon-btn:disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* --- Header and footer --- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--cm-line);
}

.site-header .navbar {
  padding: 0.65rem 0;
  /* My Videos and the admin page still carry older navbar styles inline. */
  background: none;
  box-shadow: none;
  position: static;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--cm-navy);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand:hover {
  color: var(--cm-navy);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #4c7bf0, #3a66db 45%, #1c2a52);
  box-shadow: 0 6px 14px rgba(58, 102, 219, 0.35);
  font-size: 0.95rem;
}

.site-header .nav-link {
  color: var(--cm-muted);
  font-weight: 500;
  border-radius: 8px;
  padding: 0.45rem 0.8rem !important;
}

.site-header .nav-link:hover,
.site-header .nav-link.active {
  color: var(--cm-ink);
  background: var(--cm-blue-050);
}

.site-header .navbar-toggler {
  border: 1px solid var(--cm-line);
  border-radius: 10px;
  padding: 0.35rem 0.55rem;
}

.site-header .navbar-toggler:focus {
  box-shadow: 0 0 0 3px rgba(58, 102, 219, 0.25);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* "More" (How it works, Blog, FAQ, Support): a menu on wide screens. In the phone menu, which is a list already,
   its links show directly. */
.site-header .nav-more .dropdown-menu {
  --bs-dropdown-min-width: 11rem;
  --bs-dropdown-padding-y: .35rem;
  --bs-dropdown-link-active-bg: var(--cm-blue-050);
  --bs-dropdown-link-active-color: var(--cm-blue-600);
  border-color: var(--cm-line);
  border-radius: var(--cm-radius-sm);
  box-shadow: var(--cm-shadow-lg);
}

.site-header .nav-more .dropdown-item {
  padding: .45rem .9rem;
  font-weight: 500;
}

@media (max-width: 991.98px) {
  .site-header .nav-more > .dropdown-toggle {
    display: none;
  }

  .site-header .nav-more > .dropdown-menu {
    display: block;
    position: static;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
  }

  .site-header .nav-more .dropdown-item {
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    color: var(--cm-muted);
  }

  .site-header .nav-more .dropdown-item:hover,
  .site-header .nav-more .dropdown-item.active {
    color: var(--cm-ink);
    background: var(--cm-blue-050);
  }
}

.account-dashboard {
  white-space: nowrap;
}

.account-dashboard[aria-current="page"] {
  border-color: var(--cm-blue-100);
  background: var(--cm-blue-050);
  color: var(--cm-blue-600);
}

.account-dropdown [data-user-name] {
  display: inline-block;
  max-width: min(11rem, 29vw);
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.account-dropdown .dropdown-menu {
  width: min(15rem, calc(100vw - 1.75rem));
  max-height: min(27rem, 65dvh);
  overflow-y: auto;
}

.account-dropdown [data-user-email] {
  overflow-wrap: anywhere;
}

@media (max-width: 991.98px) {
  .site-header .navbar-collapse {
    padding: 0.75rem 0 0.5rem;
  }
  .header-actions {
    margin-top: 0.5rem;
  }
  .navbar-collapse > .header-actions:has(.account-dropdown:not([hidden])) {
    justify-content: flex-end;
  }
  .site-header .navbar .account-dropdown .dropdown-menu {
    position: absolute;
    right: 0;
    left: auto;
  }
}

.site-footer {
  margin-top: 4rem;
  padding: 2.5rem 0 2rem;
  border-top: 1px solid var(--cm-line);
  background: var(--cm-surface);
  color: var(--cm-muted);
  font-size: 0.9rem;
}

.site-footer .footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.site-footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.site-footer a {
  color: var(--cm-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--cm-blue);
}

.site-footer .brand {
  color: var(--cm-navy);
}

/* The footer's link lists, in even columns. */
.partners {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.4rem 1.5rem;
  font-size: 0.85rem;
}

.partners-label {
  font-weight: 600;
  color: var(--cm-ink);
  margin: 1.5rem 0 0.6rem;
  font-size: 0.85rem;
}

.site-footer .container > p.small:last-child {
  margin-top: 2rem !important;
  padding-top: 1.25rem;
  border-top: 1px solid var(--cm-line);
}

@media (max-width: 575.98px) {
  .partners {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --- Surfaces and notices --- */

.panel {
  background: var(--cm-surface);
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius);
  box-shadow: var(--cm-shadow);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cm-blue);
  background: var(--cm-blue-050);
  border: 1px solid var(--cm-blue-100);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}

.notice {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  border-radius: var(--cm-radius-sm);
  font-size: 0.92rem;
  border: 1px solid transparent;
}

.notice > i {
  margin-top: 0.2rem;
}

.notice p {
  margin: 0;
}

.notice-danger {
  background: var(--cm-red-050);
  border-color: #f6c9ce;
  color: #8f1f2b;
}

.notice-warning {
  background: var(--cm-amber-050);
  border-color: #f4dcae;
  color: #7a4a06;
}

.notice-success {
  background: var(--cm-green-050);
  border-color: #bfe8d8;
  color: #0b6b50;
}

.notice-info {
  background: var(--cm-blue-050);
  border-color: var(--cm-blue-100);
  color: #26428f;
}

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100vw - 32px);
}

.toast-note {
  background: var(--cm-toast);
  color: #fff;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  box-shadow: var(--cm-shadow-lg);
  font-size: 0.92rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.toast-note.hide {
  opacity: 0;
  transform: translateY(8px);
}

/* --- Home: hero --- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 3.5rem 0 1.5rem;
  background:
    radial-gradient(900px 420px at 85% 10%, rgba(58, 102, 219, 0.12), transparent 70%),
    radial-gradient(700px 360px at 5% 0%, rgba(15, 157, 116, 0.08), transparent 70%);
}

.hero h1 {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  line-height: 1.08;
  font-weight: 800;
  margin: 1rem 0 1rem;
}

.hero h1 .accent {
  background: linear-gradient(120deg, var(--cm-blue), #6d5ce8 60%, #0f9d74);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .lead {
  color: var(--cm-muted);
  font-size: 1.12rem;
  max-width: 34rem;
  margin-bottom: 1.25rem;
}

.hero-points {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  color: var(--cm-ink);
  font-weight: 500;
  font-size: 0.95rem;
}

.hero-points i {
  color: var(--cm-green);
  margin-right: 0.35rem;
}

.hero-art {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 24px 40px rgba(28, 42, 82, 0.14));
}

@media (max-width: 767.98px) {
  .hero {
    padding: 2rem 0 0.75rem;
  }
}

/* --- Home: workspace --- */

.workspace {
  scroll-margin-top: 80px;
}

.upload-panel {
  padding: 1rem;
}

.editor-step-heading {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.editor-step-heading h2,
.editor-step-heading h3 {
  margin: 0;
}

.editor-step-number {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--cm-fill);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
}

.drop-zone {
  border: 2px dashed #b9c8ef;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfcff, #f3f6fe);
  padding: 2.25rem 1.25rem;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease, padding 0.2s ease;
  cursor: pointer;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--cm-blue);
  background: var(--cm-blue-050);
}

.drop-zone.dragover {
  box-shadow: inset 0 0 0 4px rgba(58, 102, 219, 0.12);
}

.drop-step {
  margin-bottom: .85rem;
}

.drop-zone h2 {
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}

.drop-zone .formats {
  color: var(--cm-muted);
  font-size: 0.85rem;
  margin: 0.9rem 0 0;
}

/* Once clips are added, the drop zone shrinks to a single row. */
.has-clips .drop-zone {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
}

.has-clips .drop-step {
  margin: 0;
}

.has-clips .drop-zone h2 {
  font-size: 1rem;
  margin: 0;
}

.has-clips .drop-zone .drop-text {
  flex: 1;
}

.has-clips .drop-zone .drop-sub,
.has-clips .drop-zone .formats {
  display: none;
}

.drop-sub {
  color: var(--cm-muted);
  margin-bottom: 1.1rem;
}

@media (max-width: 575.98px) {
  .has-clips .drop-zone {
    flex-wrap: wrap;
    gap: .6rem;
    padding: .75rem;
  }
  .has-clips .drop-zone .btn {
    flex: 1 0 100%;
  }
}

.plan-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-top: 0.85rem;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  background: var(--cm-bg);
  font-size: 0.88rem;
  color: var(--cm-muted);
}

.plan-strip strong {
  color: var(--cm-ink);
}

/* One line when it fits; a long translation wraps rather than widening the page. */
.plan-strip a {
  font-weight: 600;
  text-decoration: none;
}

.clips-panel {
  margin-top: 1.25rem;
}

.clips-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.1rem 1.25rem 0.9rem;
  border-bottom: 1px solid var(--cm-line);
}

.clips-head h2 {
  font-size: 1.15rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.count-pill {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--cm-blue);
  background: var(--cm-blue-050);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

.clips-hint {
  color: var(--cm-muted);
  font-size: 0.85rem;
}

.photo-overlay {
  margin: 0 1.25rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--cm-line);
}

.overlay-heading {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  justify-content: space-between;
  align-items: center;
}

.overlay-heading h3 {
  margin: 0 0 .25rem;
  font-size: 1.05rem;
}

.overlay-heading p,
.overlay-adjustments p {
  margin: 0;
  color: var(--cm-muted);
  font-size: .88rem;
}

#overlay-status:not(:empty) {
  margin-top: .65rem;
}

.overlay-editor {
  --frame-ratio: 1.77778;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 1fr);
  align-items: stretch;
  border: 1px solid var(--cm-line);
  border-radius: 12px;
  overflow: hidden;
  margin-top: .9rem;
}

.layout-artboard {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: clamp(.7rem, 2vw, 1.5rem);
  background-color: #edf1f8;
  background-image: radial-gradient(#cbd3e1 .8px, transparent .8px);
  background-size: 8px 8px;
}

.overlay-stage {
  position: relative;
  width: min(100%, calc(24rem * var(--frame-ratio)));
  aspect-ratio: var(--frame-ratio);
  overflow: hidden;
  border-radius: 4px;
  background: #101724;
  box-shadow: 0 1px 4px #19274638;
}

.overlay-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#text-preview {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.layout-object {
  position: absolute;
  touch-action: none;
  user-select: none;
  cursor: move;
}

.layout-object.is-selected {
  outline: 1px solid white;
  box-shadow: 0 0 0 2px var(--cm-blue);
}

.layout-object:focus-visible {
  outline: 2px dashed white;
  outline-offset: -2px;
}

.overlay-resize {
  display: none;
  position: absolute;
  inset: auto 0 0 auto;
  width: 24px;
  height: 24px;
  cursor: nwse-resize;
}

.is-selected > .overlay-resize {
  display: block;
}

.overlay-resize::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 11px;
  height: 11px;
  border: 2px solid white;
  border-radius: 2px;
  background: var(--cm-blue);
  box-shadow: 0 0 0 1px var(--cm-blue);
}

/* Keep the active area's handle reachable when the fixed overlay covers the same corner. */
.layout-object.is-selected > .overlay-resize {
  z-index: 1;
}

.overlay-adjustments {
  min-width: 0;
  padding: clamp(1rem, 2.3vw, 1.6rem);
  align-self: center;
}

.layout-layers {
  display: flex;
  padding: 3px;
  border: 1px solid var(--cm-line);
  border-radius: .65rem;
  background: #f2f5fc;
}

.layout-layers button {
  flex: 1 1 0;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: .45rem;
  padding: .45rem .25rem;
  background: transparent;
  color: var(--cm-muted);
  font-size: .83rem;
  font-weight: 600;
}

.layout-layers button[aria-pressed="true"] {
  border-color: #d9e2ff;
  background: var(--cm-surface);
  color: var(--cm-blue);
  box-shadow: 0 1px 3px #1d365111;
}

.layer-name-short,
.layout-layers.has-text .layer-name-long {
  display: none;
}

.layout-layers.has-text .layer-name-short {
  display: inline;
}

#text-settings {
  padding-bottom: .85rem;
  margin-bottom: .85rem;
  border-bottom: 1px solid var(--cm-line);
}

.text-content-label,
.text-decoration-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

#text-content {
  margin: .2rem 0 .65rem;
  min-height: 3.5rem;
  resize: vertical;
}

.text-presets {
  margin-bottom: .8rem;
}

.text-presets legend {
  float: none;
  margin: 0 0 .35rem;
  color: var(--cm-muted);
  font-size: .8rem;
  font-weight: 600;
}

.text-preset-choices {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.text-preset-choices .btn {
  --bs-btn-border-radius: 999px;
  --bs-btn-font-size: .8rem;
  --bs-btn-padding-x: .65rem;
  --bs-btn-padding-y: .3rem;
  min-height: 2rem;
  max-width: 100%;
}

.text-style-grid {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: .5rem .8rem;
}

.text-style-grid label {
  display: grid;
  gap: .25rem;
}

.text-style-grid label:first-child {
  flex: 1 1 6.75rem;
}

#text-kind {
  padding: .32rem 2.2rem .32rem .6rem;
}

.text-decoration-controls {
  display: grid;
  gap: .3rem;
  margin-top: .7rem;
}

.text-decoration-row {
  min-height: 1.65rem;
}

.overlay-adjustments p {
  margin: .7rem 0 .9rem;
  font-size: .81rem;
  line-height: 1.45;
}

.overlay-adjustments label,
.overlay-size-label output {
  color: var(--cm-ink);
  font-size: .83rem;
  font-weight: 600;
}

.layout-setting + .layout-setting {
  margin-top: .85rem;
}

.layout-setting select {
  margin-top: .25rem;
  padding-inline-end: 2.25rem;
}

.overlay-size-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .18rem;
}

.overlay-size-label output {
  color: var(--cm-muted);
  font-variant-numeric: tabular-nums;
}

.overlay-adjustments .form-range {
  display: block;
}

.layout-reset {
  display: inline-flex;
  gap: .35rem;
  align-items: center;
  margin-top: .8rem;
  padding: .15rem 0;
  border: 0;
  background: transparent;
  color: var(--cm-blue);
  font-size: .82rem;
  font-weight: 600;
}

.layout-reset:disabled {
  color: var(--cm-muted);
  opacity: .65;
}

.overlay-border-panel {
  border-top: 1px solid var(--cm-line);
  padding-top: .8rem;
  margin-top: .9rem;
}

.layout-border-toggle {
  display: inline-flex;
  gap: .5rem;
  align-items: center;
  cursor: pointer;
}

.layout-border-toggle input {
  margin: 0;
}

.layout-border-options {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  align-items: start;
  gap: 1.05rem;
  margin-top: .65rem;
}

.layout-border-color {
  display: grid;
  gap: .25rem;
}

.layout-border-color input,
#text-settings input[type="color"] {
  cursor: pointer;
  width: 2.8rem;
  height: 1.7rem;
  padding: 2px;
  background: var(--cm-surface);
  border: 1px solid var(--cm-line);
  border-radius: .35rem;
}

@media (max-width: 700px) {
  .overlay-editor { grid-template-columns: minmax(0, 1fr); }
  .overlay-adjustments { padding: .85rem 1rem 1rem; }
  .overlay-stage { width: min(100%, calc(21rem * var(--frame-ratio))); }
}

.clip-effects {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 50%;
  gap: 1rem 1.5rem;
  align-items: start;
  margin: 0 1.25rem;
  padding: 1rem 0;
  border-top: 1px solid var(--cm-line);
}

.effects-settings {
  container-type: inline-size;
}

.effects-heading {
  margin: 0 0 0.65rem;
}

.effects-heading h3 {
  font-size: 1rem;
}

#randomize-effects,
#effects-preview,
.effect-tile,
.effects-preview {
  scroll-margin-block: 4.5rem 12rem;
}

.effects-categories {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: .35rem;
  padding: .3rem;
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius-sm);
  background: var(--cm-bg);
}

.effect-category {
  min-width: 0;
  padding: .45rem .3rem;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--cm-muted);
  font-size: .81rem;
  font-weight: 650;
  line-height: 1.2;
}

.effect-category:hover:not(:disabled) {
  color: var(--cm-blue-600);
}

.effect-category[aria-pressed="true"] {
  border-color: var(--cm-blue-100);
  background: var(--cm-surface);
  color: var(--cm-blue-600);
  box-shadow: 0 1px 3px rgba(28, 42, 82, .1);
}

.effect-category-value {
  display: block;
  margin-top: .2rem;
  color: var(--cm-muted);
  font-size: .71rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.effects-picker-hint {
  margin: .6rem 0 .45rem;
  color: var(--cm-muted);
  font-size: .78rem;
}

.effects-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .45rem;
}

@container (min-width: 592px) {
  .effects-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@container (max-width: 384px) {
  .effects-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .effect-category i { display: none; }
}

.effect-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: .22rem;
  border: 1px solid var(--cm-line);
  border-radius: 8px;
  background: var(--cm-surface);
  color: var(--cm-navy);
}

.effect-tile:hover:not(:disabled) {
  border-color: var(--cm-blue);
}

.effect-tile[aria-pressed="true"] {
  border-color: var(--cm-blue-600);
  background: var(--cm-blue-050);
  color: var(--cm-blue-600);
  box-shadow: inset 0 0 0 1px var(--cm-blue-600);
}

.effect-tile-check {
  position: absolute;
  top: .45rem;
  right: .45rem;
  display: none;
  place-items: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--cm-fill-strong);
  color: #fff;
  font-size: .65rem;
}

.effect-tile[aria-pressed="true"] .effect-tile-check {
  display: grid;
}

.effect-tile-thumbnail {
  position: relative;
  overflow: hidden;
  border-radius: 5px;
  background: var(--cm-bg);
}

.effect-tile-thumbnail canvas {
  display: block;
  width: 100%;
  height: auto;
}

.effect-tile-play {
  position: absolute;
  bottom: .25rem;
  left: .25rem;
  display: grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #101724c9;
  color: #fff;
  font-size: .49rem;
}

.effect-tile-label {
  display: grid;
  place-items: center;
  flex: 1;
  min-height: 1.85rem;
  padding: .25rem .1rem;
  font-size: .75rem;
  font-weight: 650;
  line-height: 1.15;
}

.effect-category:focus-visible,
.effect-tile:focus-visible {
  outline: 2px solid var(--cm-blue);
  outline-offset: 2px;
}

.effect-category:disabled,
.effect-tile:disabled {
  opacity: .65;
}

.effects-preview {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--cm-line);
  border-radius: 0.6rem;
  background: #101724;
  color: #fff;
}

.effects-preview video {
  position: absolute;
  inset: 0;
}

.effects-preview canvas,
.effects-preview video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.effects-preview-status {
  position: absolute;
  top: .5rem;
  left: .5rem;
  right: auto;
  max-width: calc(100% - 1rem);
  padding: .3rem .6rem;
  border-radius: .5rem;
  background: rgba(16, 23, 36, 0.82);
  font-size: .78rem;
  font-weight: 600;
  pointer-events: none;
}

.effects-preview-status:empty {
  display: none;
}

.effects-preview-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .65rem;
}

@media (max-width: 767.98px) {
  .clip-effects {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.65rem;
  }
}

.image-duration-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0.9rem 1.25rem 0;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  background: var(--cm-bg);
  font-size: 0.9rem;
}

.image-duration-bar label {
  margin: 0;
  font-weight: 500;
}

.seconds-input {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--cm-muted);
  font-size: 0.85rem;
}

.seconds-input input {
  width: 4.5rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--cm-line);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--cm-ink);
  background: var(--cm-surface);
}

.clip-list {
  list-style: none;
  margin: 0;
  padding: 0.75rem 0.75rem 0.25rem;
}

.clip {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--cm-surface);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.clip + .clip {
  margin-top: 0.35rem;
}

.clip:hover {
  background: #fafbff;
  border-color: var(--cm-line);
}

.clip.has-error {
  background: #fff8f8;
  border-color: #f6c9ce;
}

.clip.sortable-ghost {
  opacity: 0.4;
}

.clip.sortable-chosen {
  box-shadow: var(--cm-shadow-lg);
  background: var(--cm-surface);
}

.clip-handle {
  cursor: grab;
  color: #a3b0c5;
  border: 0;
  background: none;
  padding: 0.25rem;
  touch-action: none;
}

.clip-handle:active {
  cursor: grabbing;
}

.clip-thumb {
  position: relative;
  width: 120px;
  aspect-ratio: 16 / 9;
  border-radius: 9px;
  overflow: hidden;
  background: #0f172a;
}

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

.clip-badge {
  position: absolute;
  right: 5px;
  bottom: 5px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.05rem 0.4rem;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}

.clip-index {
  position: absolute;
  left: 5px;
  top: 5px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--cm-navy);
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.3rem;
}

.clip-title {
  font-weight: 600;
  color: var(--cm-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clip-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.6rem;
  color: var(--cm-muted);
  font-size: 0.82rem;
  margin-top: 0.15rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  font-size: 0.75rem;
  border-radius: 6px;
  padding: 0.05rem 0.45rem;
}

.tag-video {
  background: var(--cm-blue-050);
  color: var(--cm-blue);
}

.tag-image {
  background: #f3edff;
  color: #6d4bd8;
}

.save-state.saved {
  color: var(--cm-green);
}

.save-state.failed {
  color: var(--cm-red);
}

.clip-progress {
  height: 3px;
  border-radius: 3px;
  background: var(--cm-line);
  overflow: hidden;
  margin-top: 0.45rem;
  max-width: 220px;
}

.clip-progress > div {
  height: 100%;
  background: var(--cm-blue);
  transition: width 0.3s ease;
}

.clip-error {
  margin-top: 0.4rem;
  color: var(--cm-red);
  font-size: 0.83rem;
  font-weight: 500;
}

.clip-image-duration {
  margin-top: 0.35rem;
}

.clip-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

@media (max-width: 575.98px) {
  .clip {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.6rem;
    padding: 0.5rem 0.35rem;
  }
  .clip-handle {
    display: none;
  }
  .clip-thumb {
    width: 88px;
  }
  .clip-actions .move {
    display: none;
  }
  .clip-list {
    padding: 0.5rem 0.4rem 0.25rem;
  }
}

.clip-warnings {
  padding: 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.clip-warnings:not(:empty) {
  margin: 0.5rem 0 0.75rem;
}

/* The merge bar sticks to the bottom of the screen while the clip list is long. */
.merge-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.9rem 1.25rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--cm-line);
  border-radius: 0 0 var(--cm-radius) var(--cm-radius);
}

.export-heading {
  flex: 1 0 100%;
}

.export-heading h2,
.template-intro h2 {
  font-size: 1.1rem;
}

.merge-summary {
  margin: .15rem 0 0;
  color: var(--cm-muted);
  font-size: 0.92rem;
}

.merge-summary strong {
  color: var(--cm-ink);
}

.watermark-choice {
  display: flex;
  flex: 1 1 22rem;
  align-items: flex-start;
  gap: .75rem;
  padding: .65rem .85rem;
  border: 1px solid var(--cm-blue-100);
  border-radius: var(--cm-radius-sm);
  background: var(--cm-blue-050);
  color: var(--cm-ink);
  font-size: .9rem;
  cursor: pointer;
}

.watermark-choice input {
  flex: none;
  width: 1.2rem;
  height: 1.2rem;
  margin-top: .1rem;
  cursor: inherit;
}

#watermark-help {
  display: block;
  color: var(--cm-muted);
  font-size: .84rem;
}

.merge-progress {
  flex: 1 1 100%;
}

.merge-progress .bar {
  height: 8px;
  border-radius: 8px;
  background: var(--cm-blue-050);
  overflow: hidden;
}

.merge-progress .bar > div {
  height: 100%;
  width: 0;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--cm-blue), #6d5ce8);
  transition: width 0.25s ease;
}

.merge-progress .status {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--cm-muted);
  margin-top: 0.45rem;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 575.98px) {
  /* Stacking both actions makes a sticky bar tall enough to cover the effects preview. */
  .merge-bar {
    position: static;
  }

  .merge-bar .btn,
  .effects-preview-actions .btn {
    width: 100%;
  }

  #randomize-effects {
    --bs-btn-font-size: 0.92rem;
    --bs-btn-padding-x: 0.75rem;
  }
}

/* --- Home: result --- */

.result-panel {
  margin-top: 1.25rem;
  padding: 1.5rem;
  scroll-margin-top: 80px;
}

.result-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.1rem;
}

.result-head h2 {
  font-size: 1.3rem;
  margin: 0;
}

.result-head p {
  margin: 0;
  color: var(--cm-muted);
  font-size: 0.9rem;
}

.result-video {
  display: block;
  width: 100%;
  max-height: 70vh;
  background: #0b1020;
  border-radius: 12px;
  object-fit: contain;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

@media (max-width: 575.98px) {
  .result-actions .btn {
    flex: 1 1 100%;
  }
}

/* --- Home: how it works, features, FAQ --- */

.section {
  padding-top: 4rem;
  scroll-margin-top: 70px;
}

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

.section-head h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.section-head p {
  color: var(--cm-muted);
  margin: 0;
}

.step {
  height: 100%;
  padding: 1.4rem;
}

.step-num {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--cm-blue-050);
  color: var(--cm-blue);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.9rem;
}

.step h3,
.feature h3 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.step p,
.feature p {
  color: var(--cm-muted);
  margin: 0;
  font-size: 0.94rem;
}

.feature {
  display: flex;
  gap: 0.9rem;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}

.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cm-surface);
  border: 1px solid var(--cm-line);
  color: var(--cm-blue);
  box-shadow: var(--cm-shadow);
}

.faq details {
  background: var(--cm-surface);
  border: 1px solid var(--cm-line);
  border-radius: 12px;
  padding: 0.95rem 1.15rem;
}

.faq details + details {
  margin-top: 0.6rem;
}

.faq summary {
  font-weight: 600;
  color: var(--cm-navy);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  color: var(--cm-blue);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "–";
}

.faq details p {
  margin: 0.6rem 0 0;
  color: var(--cm-muted);
}

/* --- Slideshow templates (web/templates.js) --- */

.template-picker {
  margin-bottom: 1rem;
}

.template-intro {
  margin-bottom: .8rem;
}

.template-intro p {
  margin: .2rem 0 0;
  font-size: 0.94rem;
  color: var(--cm-muted);
}

.template-choices,
.template-shape {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.template-choices-pro {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--cm-line);
}

@media (max-width: 575.98px) {
  .template-choices-free .template-choice {
    gap: 0.35rem;
    padding-inline: 0.7rem;
  }

  .template-choices-pro {
    position: relative;
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-right: -1rem;
    padding-right: 1rem;
    scrollbar-width: none;
  }

  .template-choices-pro::-webkit-scrollbar {
    display: none;
  }

  .template-choices-pro .template-choice {
    flex-shrink: 0;
  }
}

.template-choice {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--cm-line);
  border-radius: 999px;
  background: var(--cm-surface);
  color: var(--cm-ink);
  font-size: 0.92rem;
  font-weight: 500;
}

.template-choice i {
  color: var(--cm-muted);
}

.template-free-badge {
  padding: 0.15rem 0.42rem;
  border-radius: 999px;
  background: var(--cm-green-050);
  color: #087256;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
}

.template-choice:hover {
  border-color: var(--cm-blue-100);
  color: var(--cm-blue);
}

.template-choice[aria-pressed="true"] {
  border-color: var(--cm-blue);
  background: var(--cm-blue-050);
  color: var(--cm-blue);
}

.template-choice[aria-pressed="true"] i {
  color: var(--cm-blue);
}

.template-details {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--cm-line);
}

.template-details .form-label {
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.template-theme-title {
  margin: 0 0 .55rem;
  font-size: 1rem;
}

.template-themes {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(6.4rem, 1fr);
  gap: .5rem;
  overflow-x: auto;
  padding: .25rem .25rem .65rem;
  margin: -.25rem -.25rem .65rem;
  scroll-snap-type: x proximity;
}

.template-theme {
  min-width: 0;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .33rem;
  padding: .3rem;
  color: var(--cm-ink);
  background: var(--cm-surface);
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius-sm);
  text-align: center;
  font-weight: 650;
  font-size: .75rem;
  line-height: 1.25;
}

.template-theme:hover,
.template-theme[aria-pressed="true"] {
  border-color: var(--cm-blue);
  background: var(--cm-blue-050);
  color: var(--cm-blue-600);
}

.template-theme[aria-pressed="true"] {
  box-shadow: inset 0 0 0 1px var(--cm-blue);
}

.template-theme canvas {
  width: 100%;
  height: auto;
  border-radius: .35rem;
}

.template-previews {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.template-previews.is-vertical {
  grid-template-columns: repeat(3, minmax(0, 8.5rem));
  justify-content: center;
}

.template-previews.is-square {
  grid-template-columns: repeat(3, minmax(0, 12rem));
  justify-content: center;
}

.template-previews figure {
  margin: 0;
}

.template-previews canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: var(--cm-shadow);
}

.template-previews figcaption {
  margin-top: 0.3rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--cm-muted);
}

.template-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-top: 1rem;
}

.template-song {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: .75rem;
}

.template-cards-grid .template-card {
  height: 100%;
  display: block;
  overflow: hidden;
  color: var(--cm-ink);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.template-card:hover {
  border-color: var(--cm-blue-100);
  box-shadow: var(--cm-shadow-lg);
}

.template-card img {
  display: block;
  width: 100%;
  height: auto;
}

.template-card span {
  display: block;
  padding: 0 1.1rem 1.1rem;
  color: var(--cm-muted);
  font-size: 0.92rem;
}

.template-card strong {
  display: block;
  padding: 0.9rem 1.1rem 0.2rem;
  color: var(--cm-navy);
}

.template-music {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.5rem 0.75rem;
}

.template-music[hidden] {
  display: none;
}

.soundtrack-step {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--cm-line);
}

.soundtrack-step .editor-step-heading {
  margin-bottom: .75rem;
}

.soundtrack-step h3 {
  font-size: 1rem;
}

.soundtrack-step #song-name {
  font-size: .9rem;
  overflow-wrap: anywhere;
}

.soundtrack-choice {
  min-width: min(100%, 14rem);
}

.filler-panel {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem 1.1rem;
}

.filler-panel h2 {
  font-size: 1rem;
  margin-bottom: 0.15rem;
}

.filler-panel p {
  margin-bottom: 0.75rem;
  font-size: 0.88rem;
  color: var(--cm-muted);
}

.filler-strip {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.5rem;
}

@media (max-width: 767.98px) {
  .filler-strip {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .filler-strip::-webkit-scrollbar {
    display: none;
  }

  .filler-strip .filler {
    flex: 0 0 7.5rem;
  }
}

.filler {
  position: relative;
  aspect-ratio: 3 / 2;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--cm-line);
  cursor: pointer;
}

.filler.is-added::after {
  content: "✓ Added";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 157, 116, 0.82);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
}

.filler img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.filler:hover,
.filler:focus-visible {
  outline: 2px solid var(--cm-blue);
  outline-offset: 1px;
}

/* --- Landing pages (scripts/landing-pages.mjs): the problems, tips and guide links --- */

.pain {
  height: 100%;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
}

.pain h3 {
  display: flex;
  gap: 0.55rem;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.pain h3 i {
  color: var(--cm-red);
  margin-top: 0.15rem;
}

.pain p {
  color: var(--cm-muted);
  font-size: 0.94rem;
  margin-bottom: 0.9rem;
}

.pain .pain-fix {
  display: flex;
  gap: 0.55rem;
  margin: auto 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--cm-line);
  color: var(--cm-ink);
  font-weight: 500;
}

.pain-fix i {
  color: var(--cm-green);
  margin-top: 0.2rem;
}

.tips-panel {
  max-width: 46rem;
  padding: 1.4rem 1.5rem;
}

.tips-panel h2 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}

.tips-panel h2 i {
  color: var(--cm-amber);
  margin-right: 0.35rem;
}

.tips {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--cm-muted);
}

.tips li + li {
  margin-top: 0.5rem;
}

.guide-card {
  height: 100%;
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 1.1rem 1.2rem;
  color: var(--cm-ink);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.guide-card:hover {
  border-color: var(--cm-blue-100);
  box-shadow: var(--cm-shadow-lg);
}

.guide-card strong {
  display: block;
  color: var(--cm-navy);
}

.guide-card strong + span {
  display: block;
  color: var(--cm-muted);
  font-size: 0.92rem;
}

.guide-links {
  margin-bottom: 1rem;
}

/* --- Blog (scripts/blog.mjs) --- */

.blog-hero {
  padding-bottom: 1rem;
}

.blog-cats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.blog-cats a {
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--cm-line);
  border-radius: 999px;
  background: var(--cm-surface);
  color: var(--cm-ink);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.blog-cats a:hover {
  border-color: var(--cm-blue-100);
  color: var(--cm-blue);
}

.blog-section {
  padding-top: 2.5rem;
}

.blog-section h2 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.blog-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.2rem 1.25rem;
  color: var(--cm-ink);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.blog-card:hover {
  border-color: var(--cm-blue-100);
  box-shadow: var(--cm-shadow-lg);
}

.blog-card strong {
  color: var(--cm-navy);
  font-size: 1.05rem;
  line-height: 1.35;
}

.blog-card > span {
  color: var(--cm-muted);
  font-size: 0.92rem;
}

.blog-card .blog-card-cat {
  color: var(--cm-blue);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* The index already groups cards under their topic. */
.blog-section .blog-card-cat {
  display: none;
}

.blog-card .blog-card-meta {
  margin-top: auto;
  font-size: 0.82rem;
}

/* The page has the site's one width (.container). The text keeps a comfortable reading width; on wide screens the
   contents list stays beside it, so the two together span the page. */
.article {
  padding-top: 2.5rem;
}

.article > * {
  max-width: 46rem;
}

@media (min-width: 992px) {
  .article {
    display: grid;
    grid-template-columns: minmax(0, 46rem) 16rem;
    justify-content: space-between;
    column-gap: 3rem;
  }

  .article > * {
    grid-column: 1;
    max-width: none;
  }

  .article > .article-toc {
    position: sticky;
    top: 90px;
    grid-column: 2;
    grid-row: 1 / span 8;
    align-self: start;
    margin: 0;
  }
}

.article-crumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
}

.article-crumbs a {
  color: var(--cm-muted);
  text-decoration: none;
}

.article-crumbs a:hover {
  color: var(--cm-blue);
}

.article-crumbs i {
  color: var(--cm-line);
  font-size: 0.7rem;
}

.article-head h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  line-height: 1.15;
  margin-bottom: 0.9rem;
}

.article-lead {
  font-size: 1.15rem;
  color: var(--cm-muted);
  margin-bottom: 0.75rem;
}

.article-meta {
  font-size: 0.88rem;
  color: var(--cm-muted);
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--cm-line);
  margin-bottom: 1.75rem;
}

.article-toc {
  background: var(--cm-surface);
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  font-size: 0.94rem;
}

.article-toc ol {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.article-toc a {
  text-decoration: none;
}

.article-body {
  font-size: 1.06rem;
  line-height: 1.7;
  overflow-wrap: break-word;
}

.article-body h2 {
  font-size: 1.5rem;
  margin: 2.25rem 0 0.75rem;
  scroll-margin-top: 80px;
}

.article-body h3 {
  font-size: 1.15rem;
  margin: 1.75rem 0 0.5rem;
}

.article-body p,
.article-body ul,
.article-body ol {
  margin-bottom: 1.1rem;
}

.article-body li + li {
  margin-top: 0.35rem;
}

.article-body blockquote {
  margin: 1.5rem 0;
  padding: 0.9rem 1.2rem;
  border-left: 4px solid var(--cm-blue);
  background: var(--cm-blue-050);
  border-radius: 0 var(--cm-radius-sm) var(--cm-radius-sm) 0;
}

.article-body blockquote p:last-child {
  margin-bottom: 0;
}

.article-body code {
  color: var(--cm-navy);
  background: #eef2f9;
  padding: 0.1rem 0.35rem;
  border-radius: 5px;
  font-size: 0.9em;
}

.article-body pre {
  background: #1c2a52;
  color: #e9eefb;
  padding: 1rem 1.2rem;
  border-radius: var(--cm-radius-sm);
  font-size: 0.88rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

.article-body pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

.article-body .table {
  font-size: 0.94rem;
  margin: 0;
  background: var(--cm-surface);
}

.article-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
  padding: 1.4rem;
  margin-top: 2.5rem;
}

.article-cta > div {
  flex: 1 1 16rem;
}

.article-cta h2 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.article-cta p {
  color: var(--cm-muted);
  margin: 0;
  font-size: 0.94rem;
}

/* --- Forms --- */

.form-shell {
  padding-top: 3rem;
}

.form-panel {
  padding: 2rem;
}

@media (max-width: 575.98px) {
  .form-panel {
    padding: 1.35rem;
  }
  .form-shell {
    padding-top: 1.5rem;
  }
}

.form-label {
  font-weight: 600;
  color: var(--cm-ink);
  font-size: 0.92rem;
}

.form-control,
.form-select {
  background-color: var(--cm-surface);
  border-radius: 10px;
  border-color: var(--cm-line);
  padding: 0.65rem 0.85rem;
}

.form-control:focus,
.form-select:focus {
  border-color: #9db3ec;
  box-shadow: 0 0 0 4px rgba(58, 102, 219, 0.15);
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem;
}

.price-card {
  position: relative;
  display: block;
  margin: 0;
  padding: 0.85rem 0.9rem;
  border: 1.5px solid var(--cm-line);
  border-radius: 12px;
  background: var(--cm-surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.price-card:hover {
  border-color: #b9c8ef;
}

.price-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.price-card:has(input:checked) {
  border-color: var(--cm-blue);
  background: var(--cm-blue-050);
  box-shadow: 0 0 0 3px rgba(58, 102, 219, 0.15);
}

.price-card:has(input:focus-visible) {
  outline: 3px solid rgba(58, 102, 219, 0.45);
  outline-offset: 2px;
}

.price-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--cm-navy);
  line-height: 1.1;
}

.price-desc {
  color: var(--cm-muted);
  font-size: 0.82rem;
  margin-top: 0.15rem;
}

.perks {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
}

.perks li {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
  color: var(--cm-ink);
}

.perks i {
  color: var(--cm-green);
  margin-top: 0.3rem;
}

.success-state {
  text-align: center;
  padding: 1rem 0;
}

.success-state .check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  background: var(--cm-green-050);
  color: var(--cm-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

/* --- Account pages (log in, sign up, forgot and reset password) --- */

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 30rem) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
  max-width: 66rem;
  margin: 0 auto;
}

.auth-shell.single {
  grid-template-columns: minmax(0, 30rem);
  justify-content: center;
}

@media (max-width: 991.98px) {
  .auth-shell {
    grid-template-columns: minmax(0, 1fr);
    max-width: 32rem;
    gap: 2rem;
  }
}

.auth-head {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 1.2rem;
  margin-bottom: 0.9rem;
}

.auth-head h1 {
  font-size: 1.6rem;
  margin-bottom: 0.35rem;
}

.auth-head p {
  color: var(--cm-muted);
  margin: 0;
}

.input-icon {
  position: relative;
  display: block;
}

.input-icon > i {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  font-size: 0.9rem;
}

.input-icon .form-control {
  padding-left: 2.6rem;
}

.input-icon .form-control[readonly] {
  background: var(--cm-bg);
}

.input-icon.has-reveal .form-control {
  padding-right: 3rem;
}

.input-reveal {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
}

.field-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.forgot-link {
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.field-hint {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.83rem;
  color: var(--cm-muted);
}

.requirement {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.15s ease;
}

.requirement i {
  font-size: 0.72rem;
  opacity: 0.45;
}

.requirement.met {
  color: var(--cm-green);
}

.requirement.met i {
  opacity: 1;
}

.check-row {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin: 0.25rem 0 1.25rem;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.93rem;
}

.check-row input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.check-row small {
  display: block;
  color: var(--cm-muted);
  font-weight: 400;
}

.turnstile-field {
  margin-bottom: 1rem;
}

.turnstile-field > div:empty {
  display: none;
}

.auth-switch {
  text-align: center;
  margin: 1.25rem 0 0;
  color: var(--cm-muted);
  font-size: 0.95rem;
}

.auth-switch a {
  font-weight: 600;
  text-decoration: none;
}

.auth-aside h2 {
  font-size: 1.4rem;
  margin: 1.25rem 0 1.1rem;
}

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

.auth-points li {
  display: flex;
  gap: 0.9rem;
  margin-bottom: 1.1rem;
}

.auth-points strong {
  display: block;
  color: var(--cm-ink);
}

.auth-points .text-secondary {
  font-size: 0.93rem;
}

.auth-point-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--cm-surface);
  border: 1px solid var(--cm-line);
  color: var(--cm-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--cm-shadow);
}

.text-button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--cm-blue);
  font-weight: 600;
  text-decoration: underline;
}

/* --- ClipMerge Pro --- */

.editor-dialog {
  width: min(100% - 2rem, 29rem);
  max-height: calc(100dvh - 2rem);
  padding: clamp(1rem, 5vw, 1.75rem);
  color: var(--cm-ink);
  overflow: auto;
  overscroll-behavior: contain;
}

.editor-dialog::backdrop {
  background: rgba(17, 31, 60, 0.54);
}

.template-paywall-benefits {
  display: grid;
  gap: .3rem;
  list-style: none;
  padding: 0;
  margin: 0 0 .95rem;
  font-size: .875rem;
}

.template-paywall-benefits li {
  display: flex;
  align-items: baseline;
  gap: .5rem;
}

.template-paywall-benefits i {
  color: var(--cm-blue);
  font-size: .78rem;
}

.template-passes {
  display: grid;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.template-pass {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius-sm);
  color: var(--cm-navy);
  font-weight: 650;
}

.template-pass.btn {
  width: 100%;
  justify-content: space-between;
}

.template-pass-price {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.template-paywall-status:not(:empty) {
  margin-top: 0.75rem;
}

.pro-hero {
  padding-bottom: 2rem;
}

.pro-hero .lead {
  margin-left: auto;
  margin-right: auto;
}

.pro-status {
  max-width: 40rem;
  margin-top: 1.25rem;
  text-align: left;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem 1rem;
  max-width: 72rem;
  margin: 0 auto;
}

@media (max-width: 991.98px) {
  .plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 44rem;
  }
}

@media (max-width: 575.98px) {
  .plan-grid {
    grid-template-columns: minmax(0, 1fr);
    max-width: 26rem;
  }
}

.plan-card {
  position: relative;
  padding: 1.6rem 1.4rem 1.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.plan-card.featured {
  border: 2px solid var(--cm-blue);
  box-shadow: var(--cm-shadow-lg);
}

.plan-note {
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--cm-blue-050);
  color: var(--cm-blue);
  border: 1px solid var(--cm-blue-100);
}

.plan-card.featured .plan-note {
  background: var(--cm-fill);
  color: #fff;
  border-color: var(--cm-fill);
}

.plan-label {
  font-size: 1.05rem;
  margin: 0.25rem 0 0.5rem;
}

.plan-price {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--cm-navy);
  letter-spacing: -0.03em;
  line-height: 1;
}

.plan-sub {
  color: var(--cm-muted);
  font-size: 0.88rem;
  margin: 0.4rem 0 1.2rem;
  min-height: 1.3em;
}

.plan-card .btn {
  margin-top: auto;
}

.compare-panel {
  max-width: 52rem;
  overflow-x: auto;
}

.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.compare th,
.compare td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--cm-line);
  text-align: left;
  vertical-align: middle;
}

.compare thead th {
  color: var(--cm-muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.compare tbody tr:last-child th,
.compare tbody tr:last-child td {
  border-bottom: 0;
}

.compare tbody th {
  font-weight: 600;
  color: var(--cm-ink);
}

.compare .pro-col {
  background: var(--cm-blue-050);
  color: var(--cm-navy);
  font-weight: 600;
}

.pro-offer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--cm-radius-sm);
  background: linear-gradient(120deg, var(--cm-blue-050), #f3edff);
  border: 1px solid var(--cm-blue-100);
}

.pro-offer-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #5b86f3, #6d5ce8);
}

.pro-offer-text {
  flex: 1 1 16rem;
  margin: 0;
  color: var(--cm-ink);
  font-size: 0.93rem;
}

.pro-offer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (max-width: 575.98px) {
  .pro-offer-actions,
  .pro-offer-actions .btn {
    width: 100%;
  }
}

/* My videos and the admin page: an original this browser can't show (HEIC, AVI, WMV...) */
.gallery-no-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--cm-blue-050);
  color: var(--cm-muted);
  font-size: 0.8rem;
}

.gallery-no-preview i {
  font-size: 1.6rem;
  color: var(--cm-blue);
}

/* --- The light/dark button and the language menu, together at the end of the header (web/header-tools.js) --- */
.header-tools,
.lang-switch {
  display: flex;
  align-items: center;
  gap: .4rem;
}

.header-tools {
  margin-inline-start: .75rem;
}

.lang-picker {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0;
}

.lang-picker i {
  position: absolute;
  inset-inline-start: .65rem;
  color: var(--cm-muted);
  font-size: .85rem;
  pointer-events: none;
}

.lang-picker select {
  width: auto;
  max-width: 10.5rem;
  /* The same height as the small buttons beside it. */
  padding-block: 0.35rem;
  font-size: 0.875rem;
  line-height: 1.5;
  padding-inline-start: 1.85rem;
  border-color: var(--cm-line);
  border-radius: 999px;
  color: var(--cm-ink);
  font-weight: 600;
}

/* On phones the menu sits beside the menu button, so it's reachable without opening the menu. */
@media (max-width: 991.98px) {
  .site-header .navbar > .container .header-tools {
    order: 1;
    margin-inline-start: auto;
    margin-inline-end: .5rem;
  }

  .site-header .navbar > .container .navbar-toggler { order: 2; }
  .site-header .navbar > .container .navbar-collapse { order: 3; }
}

.lang-current {
  display: none;
}

/* Headers that are a plain row: the logo on one side, everything else together on the other. */
.site-header nav.container:has(> .header-tools) > :first-child {
  margin-inline-end: auto;
}

/* Compact, when the full labels would make the header wrap (web/header-tools.js): the menu is a pill with the
   language's code (EN, AR…), and the light/dark button its icon alone. The list itself is the same. */
.header-tools.is-compact,
.header-tools.is-compact .lang-switch { gap: .3rem; }

.header-tools.is-compact .lang-picker {
  min-height: 2.1rem;
  padding-block: 0;
  padding-inline: 1.75rem .65rem;
  border: 1px solid var(--cm-line);
  border-radius: 999px;
  background: var(--cm-surface);
}

.header-tools.is-compact .lang-current {
  display: inline;
  color: var(--cm-ink);
  font-size: .8rem;
  font-weight: 700;
}

.header-tools.is-compact .lang-picker select {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
  opacity: 0;
}

.header-tools.is-compact .lang-english { padding-inline: .55rem; }

.header-tools.is-compact .theme-toggle {
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
}

.header-tools.is-compact .theme-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Tight, when even that wraps: smaller gaps and logo text. */
.header-tools.is-tight,
.header-tools.is-tight .lang-switch { gap: .2rem; }

.header-tools.is-tight { margin-inline-start: .25rem; }

.site-header .navbar > .container .header-tools.is-tight { margin-inline-end: .3rem; }

.site-header .container:has(> .header-tools.is-tight) .brand {
  gap: .45rem;
  font-size: 1rem;
}

/* --- Light/dark button (web/theme-toggle.js): it shows the theme it switches to --- */

.theme-toggle {
  border-radius: 999px;
  white-space: nowrap;
}

.theme-toggle > span {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

:root[data-bs-theme="dark"] .theme-to-dark,
:root:not([data-bs-theme="dark"]) .theme-to-light {
  display: none;
}

/* --- Dark theme ---
   The palette above, redefined; Bootstrap's own components switch with data-bs-theme (web/theme.js). The rules
   after the palette are the light colours written into single rules. Solid blues behind white text use --cm-fill,
   which stays the same. */

:root[data-bs-theme="dark"] {
  --cm-blue: #7d9df5;
  --cm-blue-600: #a3baf9;
  --cm-blue-050: #18233f;
  --cm-blue-100: #22345f;
  --cm-navy: #f1f4fb;
  --cm-ink: #dfe5f0;
  --cm-muted: #9aa8bf;
  --cm-line: #273250;
  --cm-bg: #0d1220;
  --cm-surface: #151c2e;
  --cm-green: #3ccb9c;
  --cm-green-050: #10291f;
  --cm-red: #f27a85;
  --cm-red-050: #331a20;
  --cm-amber: #e6ad4c;
  --cm-amber-050: #2d2412;
  --cm-toast: #2b3b63;
  --cm-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.28);
  --cm-shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.35), 0 18px 48px rgba(0, 0, 0, 0.45);

  --bs-secondary-rgb: 154, 168, 191;
  --bs-secondary-color: #9aa8bf;
  --bs-body-color-rgb: 223, 229, 240;
  --bs-link-color-rgb: 125, 157, 245;
  --bs-link-hover-color-rgb: 163, 186, 249;
  --bs-primary-rgb: 125, 157, 245;
  --bs-secondary-bg: #1d263b;
  --bs-tertiary-bg: #182033;
  --bs-tertiary-bg-rgb: 24, 32, 51;
}

[data-bs-theme="dark"] .dropdown-menu { --bs-dropdown-bg: var(--cm-surface); --bs-dropdown-link-hover-bg: var(--cm-blue-050); }
[data-bs-theme="dark"] .modal { --bs-modal-bg: var(--cm-surface); }
[data-bs-theme="dark"] .card { --bs-card-bg: var(--cm-surface); }

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .seconds-input input {
  background-color: #10172a;
}

[data-bs-theme="dark"] .form-control:disabled,
[data-bs-theme="dark"] .form-control[readonly],
[data-bs-theme="dark"] .form-select:disabled {
  background-color: var(--cm-bg);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  border-color: #4d6fcf;
}

[data-bs-theme="dark"] .form-control::placeholder {
  color: #6f7d96;
}

[data-bs-theme="dark"] .btn-primary {
  --bs-btn-disabled-bg: #34487c;
  --bs-btn-disabled-border-color: #34487c;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .btn-quiet {
  --bs-btn-hover-border-color: #3a4766;
}

[data-bs-theme="dark"] .site-header {
  background: rgba(13, 18, 32, 0.86);
}

[data-bs-theme="dark"] .notice-danger { border-color: #5c2a32; color: #f6a7ae; }
[data-bs-theme="dark"] .notice-warning { border-color: #574217; color: #f0c674; }
[data-bs-theme="dark"] .notice-success { border-color: #1d4c3c; color: #7fe0bd; }
[data-bs-theme="dark"] .notice-info { color: #b3c6fa; }

[data-bs-theme="dark"] .toast-note {
  border: 1px solid #3a4c78;
}

[data-bs-theme="dark"] .hero h1 .accent {
  background-image: linear-gradient(120deg, #86a4ff, #a693ff 60%, #3fd3a6);
}

[data-bs-theme="dark"] .drop-zone {
  border-color: #34467a;
  background: linear-gradient(180deg, #141c30, #111829);
}

[data-bs-theme="dark"] .drop-zone:hover,
[data-bs-theme="dark"] .drop-zone.dragover {
  border-color: var(--cm-blue);
  background: var(--cm-blue-050);
}

[data-bs-theme="dark"] .layout-artboard {
  background-color: #10172a;
  background-image: radial-gradient(#2a3552 .8px, transparent .8px);
}

[data-bs-theme="dark"] .layout-layers { background: var(--cm-bg); }
[data-bs-theme="dark"] .layout-layers button[aria-pressed="true"] { border-color: var(--cm-blue-100); }

[data-bs-theme="dark"] .clip:hover { background: #182035; }
[data-bs-theme="dark"] .clip.has-error { background: #261519; border-color: #5c2a32; }
[data-bs-theme="dark"] .clip-handle { color: #6b7a96; }
[data-bs-theme="dark"] .clip-index { background: rgba(13, 18, 32, 0.88); }
[data-bs-theme="dark"] .tag-image { background: #261f48; color: #b9a6ff; }
[data-bs-theme="dark"] .merge-bar { background: rgba(21, 28, 46, 0.95); }
[data-bs-theme="dark"] .template-free-badge { color: var(--cm-green); }
[data-bs-theme="dark"] .article-body code { background: #1d2640; }
[data-bs-theme="dark"] .article-body pre { background: #0a0f1c; border: 1px solid var(--cm-line); }
[data-bs-theme="dark"] .price-card:hover { border-color: #3a4f86; }
[data-bs-theme="dark"] .pro-offer { background: linear-gradient(120deg, var(--cm-blue-050), #211a3d); }
[data-bs-theme="dark"] .editor-dialog::backdrop { background: rgba(3, 6, 14, 0.7); }
[data-bs-theme="dark"] .visually-hidden-focusable:focus { background: var(--cm-surface); }
