@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700&family=JetBrains+Mono:wght@400;600&display=swap");

:root {
  --app-bg: #141414;
  --chrome: #191919;
  --sidebar: #1c1c1c;
  --sidebar-elevated: #222222;
  --stage: #171717;
  --surface-soft: #232323;
  --surface-soft-hover: #2a2a2a;
  --input: #2a2a2a;
  --line: #404040;
  --line-soft: #2e2e2e;
  --text: #f1f1f1;
  --muted: #a7a7a7;
  --accent: #8f9aa6;
  --accent-soft: #8f9aa633;
  --radius: 4px;
  --control-h: 28px;
  --layers-width: 248px;
  --sidebar-width: 360px;
  --resize-hit: 12px;
  --active-layer-accent: var(--line-soft);
  --active-layer-accent-soft: rgba(64, 64, 64, 0.45);
  --active-layer-accent-faint: rgba(64, 64, 64, 0.12);
}

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

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

body {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 40px minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--app-bg);
  color: var(--text);
  font-family: "Manrope", sans-serif;
}

body[data-auth-state="locked"] .app-chrome,
body[data-auth-state="locked"] #appRoot {
  visibility: hidden;
  pointer-events: none;
}

.app-chrome {
  height: 40px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--chrome);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 10px;
  gap: 8px;
}

.chrome-left,
.chrome-center,
.chrome-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chrome-center {
  justify-content: center;
  transform: translateX(calc((var(--layers-width) - var(--sidebar-width)) / 2));
}

.chrome-right {
  justify-content: flex-end;
}

.auth-user-email {
  color: #bdbdbd;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  overflow: hidden;
  background: rgba(20, 20, 20, 0.84);
}

.auth-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  contain: paint;
  isolation: isolate;
}

.auth-scene-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(20, 20, 20, 0.08) 0%, rgba(20, 20, 20, 0.42) 48%, rgba(20, 20, 20, 0.82) 100%),
    linear-gradient(180deg, rgba(20, 20, 20, 0.38) 0%, rgba(20, 20, 20, 0.16) 34%, rgba(20, 20, 20, 0.5) 100%);
}

.auth-scene-art {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(124vw, 1780px);
  height: auto;
  max-width: none;
  max-height: 112vh;
  min-width: 100vw;
  border: 0;
  opacity: 0.24;
  contain: paint;
  backface-visibility: hidden;
  transform: translate(-50.5%, -46.8%);
}

.auth-scene-video {
  object-fit: cover;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  border: 1px solid #383838;
  border-radius: 14px;
  background: rgba(27, 27, 27, 0.96);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
  padding: 24px;
}

.auth-kicker {
  margin: 0 0 10px;
  color: #8f8f8f;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.auth-copy {
  margin: 10px 0 0;
  color: #a8a8a8;
  font-size: 12px;
  line-height: 1.5;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.auth-google-btn {
  width: 100%;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  margin-top: 14px;
  border: 1px solid #3d3d3d;
  border-radius: 10px;
  background: #252525;
  color: #f2f2f2;
  font-family: "Manrope", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease,
    transform 0.18s ease;
}

.auth-google-btn:hover,
.auth-google-btn:focus-visible {
  background: #2a2a2a;
  border-color: #4a4a4a;
  outline: none;
  box-shadow: 0 0 0 3px rgba(83, 200, 167, 0.12);
}

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

.auth-google-btn:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.auth-google-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.auth-google-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.auth-divider {
  position: relative;
  margin-top: 14px;
  text-align: center;
}

.auth-divider::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  border-top: 1px solid #303030;
}

.auth-divider span {
  position: relative;
  display: inline-block;
  padding: 0 10px;
  background: #1b1b1b;
  color: #828282;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-tab {
  appearance: none;
  border: 1px solid #3d3d3d;
  border-radius: 9px;
  background: #242424;
  color: #cccccc;
  font-family: "Manrope", sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 11px 14px;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.auth-tab:hover,
.auth-tab:focus-visible {
  background: #2a2a2a;
  border-color: #4a4a4a;
  color: #f1f1f1;
  outline: none;
}

.auth-tab.is-active {
  background: rgba(83, 200, 167, 0.12);
  border-color: rgba(83, 200, 167, 0.55);
  color: #e9fffa;
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.auth-field {
  display: grid;
  gap: 6px;
}

.auth-field label {
  color: #e8e8e8;
  font-size: 11px;
  font-weight: 600;
}

.auth-field input {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 1px solid #3b3b3b;
  border-radius: 10px;
  background: #262626;
  color: #f1f1f1;
  font: inherit;
  padding: 0 13px;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.auth-field input:hover {
  background: #2a2a2a;
  border-color: #454545;
}

.auth-field input:focus-visible {
  outline: none;
  border-color: rgba(83, 200, 167, 0.78);
  box-shadow: 0 0 0 3px rgba(83, 200, 167, 0.18);
}

.auth-consent {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  color: #b9b9b9;
  font-size: 11px;
  line-height: 1.5;
  margin-top: 2px;
  cursor: pointer;
}

.auth-consent input {
  margin: 2px 0 0;
}

.auth-submit {
  margin-top: 4px;
}

.auth-message,
.auth-config-hint {
  margin: 12px 0 0;
  font-size: 11px;
  line-height: 1.5;
}

.auth-message {
  color: #b8b8b8;
  min-height: 17px;
}

.auth-message.is-error {
  color: #ff9d9d;
}

.auth-message.is-success {
  color: #93e8cf;
}

.auth-config-hint {
  color: #d2c5a1;
}

.auth-footer-note {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #8f8f8f;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: center;
}

.auth-footer-link {
  color: #cfcfcf;
  text-decoration: none;
  transition: color 0.18s ease, opacity 0.18s ease;
}

.auth-footer-link:hover,
.auth-footer-link:focus-visible {
  color: #ffffff;
  outline: none;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #f2775a;
}

.brand-name {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.chrome-badge {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #232323;
  color: #d0d0d0;
  font-size: 9px;
  line-height: 1;
  padding: 4px 8px;
}

.chrome-pill {
  appearance: none;
  cursor: pointer;
  font-family: "Manrope", sans-serif;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: #232323;
  color: #d3d3d3;
  font-size: 9px;
  line-height: 1;
  padding: 5px 8px;
}

.chrome-pill[aria-pressed="true"] {
  background: #303030;
  border-color: #4a4a4a;
  color: #ffffff;
}

.chrome-meta {
  font-size: 10px;
  color: var(--muted);
}

.app {
  min-height: 0;
  display: grid;
  grid-template-columns: var(--layers-width) minmax(0, 1fr) var(--sidebar-width);
  grid-template-areas: "layers stage panel";
}

.app-footer {
  border-top: 1px solid var(--line-soft);
  background: var(--chrome);
  padding: 9px 20px;
}

.app-footer-text {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: center;
}

.app-footer-link {
  color: var(--text);
  text-decoration: none;
  transition: color 0.18s ease, opacity 0.18s ease;
}

.app-footer-link:hover,
.app-footer-link:focus-visible {
  color: #53c8a7;
}

.app.is-preview {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "stage";
}

.app.is-preview .layers-sidebar,
.app.is-preview .panel,
.app.is-preview .sidebar-resize {
  display: none;
}

.layers-sidebar,
.panel {
  min-width: 0;
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  container-type: inline-size;
  scrollbar-gutter: stable;
}

.layers-sidebar {
  grid-area: layers;
  border-right: 1px solid var(--line-soft);
}

.panel {
  grid-area: panel;
  border-left: 1px solid var(--line-soft);
  box-shadow: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  overflow-y: hidden;
}

.layers-sidebar::-webkit-scrollbar,
.panel::-webkit-scrollbar,
.canvas-wrap::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.layers-sidebar::-webkit-scrollbar-track,
.panel::-webkit-scrollbar-track,
.canvas-wrap::-webkit-scrollbar-track {
  background: #1c1c1c;
}

.layers-sidebar::-webkit-scrollbar-thumb,
.panel::-webkit-scrollbar-thumb,
.canvas-wrap::-webkit-scrollbar-thumb {
  background: #4b4b4b;
  border: 2px solid #1c1c1c;
  border-radius: 999px;
}

.layers-sidebar,
.panel,
.canvas-wrap {
  scrollbar-color: #4b4b4b #1c1c1c;
}

.sidebar-resize {
  grid-area: resize;
  appearance: none;
  border: none;
  background: #242424;
  border-right: 1px solid var(--line-soft);
  border-left: 1px solid var(--line-soft);
  cursor: col-resize;
  padding: 0;
  position: relative;
  z-index: 6;
  touch-action: none;
}

.sidebar-resize::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 44px;
  border-radius: 2px;
  background: #6a6a6a;
}

.sidebar-resize:hover::before,
.sidebar-resize:focus-visible::before {
  background: #d0d0d0;
}

.app.is-resizing,
.app.is-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.panel-header {
  padding: 7px 9px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.09em;
  font-size: 9px;
  text-transform: uppercase;
  color: #8f97a5;
  font-weight: 700;
}

.panel-badge {
  border: 1px solid #565656;
  background: #ffffff10;
  color: #d5d5d5;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9px;
  line-height: 1;
}

h1 {
  margin: 4px 0 3px;
  font-size: 16px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 0;
  font-size: 10px;
  line-height: 1.45;
  color: #999999;
}

.layers-sidebar-header {
  display: grid;
  gap: 5px;
  padding: 14px 12px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--sidebar);
}

.layers-sidebar-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.layers-sidebar-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #efefef;
  letter-spacing: -0.01em;
}

.layers-sidebar-help {
  margin: 0;
  color: #8f8f8f;
  font-size: 9px;
  line-height: 1.45;
}

.layers-sidebar-add-row {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--sidebar);
}

.layers-sidebar-add-link {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(241, 241, 241, 0.54);
  font-family: "Manrope", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0;
  cursor: pointer;
  transition: color 0.16s ease, opacity 0.16s ease;
  text-align: center;
}

.layers-sidebar-add-link:hover,
.layers-sidebar-add-link:focus-visible {
  color: rgba(255, 255, 255, 0.9);
  outline: none;
}

.layers-sidebar-project {
  display: grid;
  gap: 2px;
  padding: 13px 12px 12px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}

.project-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-menu {
  position: relative;
}

.project-menu-toggle {
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.16s ease;
}

.project-menu-toggle:hover,
.project-menu-toggle:focus-visible {
  opacity: 0.96;
  outline: none;
}

.project-menu-title {
  margin: 0;
}

.project-menu-chevron {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  opacity: 0.7;
  background: center / 10px 10px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10' fill='none'%3E%3Cpath d='M2.25 3.5L5 6.25L7.75 3.5' stroke='%23A7A7A7' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.project-save-inline {
  appearance: none;
  border: none;
  background: transparent;
  color: #b7b7b7;
  font-family: "Manrope", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0;
  cursor: pointer;
  line-height: 1;
  transition: color 0.16s ease, opacity 0.16s ease;
}

.project-save-inline:hover,
.project-save-inline:focus-visible {
  color: #ffffff;
  outline: none;
}

.project-menu-title,
.project-save-inline {
  display: inline-flex;
  align-items: center;
  min-height: 16px;
}

.project-icon-btn {
  appearance: none;
  border: none;
  background: transparent;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #bdbdbd;
  transition: background 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.project-icon-btn:hover,
.project-icon-btn:focus-visible {
  background: #2a2a2a;
  color: #f3f3f3;
  outline: none;
}

.project-icon-btn:disabled {
  opacity: 0.34;
  cursor: default;
  pointer-events: none;
}

.project-icon {
  width: 14px;
  height: 14px;
  display: block;
  background: center / 14px 14px no-repeat;
}

.project-icon-undo {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M5.25 3L2.5 5.75L5.25 8.5' stroke='%23CFCFCF' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M3 5.75H8C10.2091 5.75 12 7.54086 12 9.75V10.5' stroke='%23CFCFCF' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.project-icon-redo {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M8.75 3L11.5 5.75L8.75 8.5' stroke='%23CFCFCF' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M11 5.75H6C3.79086 5.75 2 7.54086 2 9.75V10.5' stroke='%23CFCFCF' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.project-menu.is-open .project-menu-chevron {
  transform: rotate(180deg);
  opacity: 0.95;
}

.project-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(220px, calc(100vw - 32px));
  display: grid;
  gap: 2px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid #3c3c3c;
  background: rgba(30, 30, 30, 0.96);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 30;
}

.project-menu-item {
  appearance: none;
  border: none;
  background: transparent;
  color: #efefef;
  font-family: "Manrope", sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.project-menu-item:hover,
.project-menu-item:focus-visible {
  background: #303030;
  color: #ffffff;
  outline: none;
}

.effect-layer-list {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 10px 10px 16px;
}

.effect-layer-item {
  --layer-accent: #5a5a5a;
  --layer-accent-soft: rgba(90, 90, 90, 0.42);
  --layer-accent-faint: rgba(90, 90, 90, 0.14);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  min-height: 54px;
  padding: 4px 4px 6px;
  border-radius: 11px;
  border: 1px solid var(--layer-accent-soft);
  background: rgba(255, 255, 255, 0.01);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    opacity 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.effect-layer-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.effect-layer-item:hover {
  background: color-mix(in srgb, var(--layer-accent-faint) 88%, rgba(255, 255, 255, 0.03));
  transform: translateY(-1px);
}

.effect-layer-item.is-selected {
  background: var(--layer-accent-faint);
  border-color: var(--layer-accent);
  box-shadow: inset 0 0 0 1px var(--layer-accent);
}

.effect-layer-item.is-hidden {
  opacity: 0.5;
}

.effect-layer-item.is-drop-target {
  border-color: #666666;
  background: #303030;
}

.effect-layer-item.is-dragging {
  opacity: 0.34;
}

.effect-layer-main {
  appearance: none;
  border: none;
  background: transparent;
  min-width: 0;
  width: 100%;
  min-height: 30px;
  padding: 4px 7px;
  color: inherit;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  cursor: pointer;
  text-align: left;
}

.effect-layer-main:hover .effect-layer-name,
.effect-layer-main:focus-visible .effect-layer-name {
  color: #ffffff;
}

.effect-layer-caret,
.effect-layer-grip,
.effect-layer-eye {
  flex: 0 0 auto;
}

.effect-layer-caret {
  width: 10px;
  height: 10px;
  opacity: 0.44;
  background: center / 8px 8px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8' fill='none'%3E%3Cpath d='M2 1.5L5.5 4L2 6.5' stroke='%23BEBEBE' stroke-width='1.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  transition: opacity 0.16s ease;
}

.effect-layer-grip {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background:
    radial-gradient(circle, #9a9a9a 1px, transparent 1px) center / 5px 5px,
    transparent;
  opacity: 0.72;
  cursor: grab;
  transition: opacity 0.16s ease, background-color 0.16s ease;
}

.effect-layer-main:hover .effect-layer-caret,
.effect-layer-main:hover .effect-layer-grip,
.effect-layer-main:focus-visible .effect-layer-caret,
.effect-layer-main:focus-visible .effect-layer-grip {
  opacity: 0.9;
}

.effect-layer-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #ededed;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.effect-layer-actions {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.effect-layer-opacity-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 7px 2px 37px;
}

.effect-layer-opacity-label {
  color: #888888;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
}

.effect-layer-opacity-value {
  min-width: 34px;
  text-align: right;
  color: #cfcfcf;
  font-size: 10px;
  font-weight: 700;
}

.effect-layer-opacity-slider {
  width: 100%;
  min-width: 0;
  height: 12px;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

.effect-layer-opacity-slider::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  border: none;
  background: #3b3b3b;
}

.effect-layer-opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  border: none;
  border-radius: 999px;
  background: #e0e0e0;
  box-shadow: 0 0 0 1px #2b2b2b, 0 2px 8px #00000044;
  cursor: pointer;
}

.effect-layer-opacity-slider::-moz-range-track {
  height: 3px;
  border: none;
  border-radius: 999px;
  background: #3b3b3b;
}

.effect-layer-opacity-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 999px;
  background: #e0e0e0;
  box-shadow: 0 0 0 1px #2b2b2b, 0 2px 8px #00000044;
  cursor: pointer;
}

.effect-layer-opacity-slider::-moz-focus-outer {
  border: 0;
}

.effect-layer-opacity-slider:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 1px #2b2b2b, 0 2px 8px #00000044, 0 0 0 2px #b0b0b0;
}

.effect-layer-opacity-slider:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 1px #2b2b2b, 0 2px 8px #00000044, 0 0 0 2px #b0b0b0;
}

.effect-layer-icon-btn {
  appearance: none;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  opacity: 0.78;
  transition: background 0.16s ease, opacity 0.16s ease;
}

.effect-layer-icon-btn:hover {
  background: #2f2f2f;
  opacity: 1;
}

.effect-layer-eye {
  display: block;
  width: 100%;
  height: 100%;
  background: center / 16px 16px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M1.5 8C2.7 5.5 5 4 8 4s5.3 1.5 6.5 4c-1.2 2.5-3.5 4-6.5 4s-5.3-1.5-6.5-4Z' stroke='%23E5E5E5' stroke-width='1.2'/%3E%3Ccircle cx='8' cy='8' r='2.1' stroke='%23E5E5E5' stroke-width='1.2'/%3E%3C/svg%3E");
}

.effect-layer-icon-btn[aria-pressed="false"] .effect-layer-eye {
  opacity: 0.38;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M1.5 8C2.7 5.5 5 4 8 4s5.3 1.5 6.5 4c-1.2 2.5-3.5 4-6.5 4s-5.3-1.5-6.5-4Z' stroke='%23A7A7A7' stroke-width='1.2'/%3E%3Ccircle cx='8' cy='8' r='2.1' stroke='%23A7A7A7' stroke-width='1.2'/%3E%3Cpath d='M3 13L13 3' stroke='%23A7A7A7' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.effect-layer-trash {
  display: block;
  width: 100%;
  height: 100%;
  background: center / 15px 15px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 15 15' fill='none'%3E%3Cpath d='M3.4 4.2H11.6' stroke='%23D6D6D6' stroke-width='1.15' stroke-linecap='round'/%3E%3Cpath d='M5.2 4.2V3.55C5.2 3.16 5.51 2.85 5.9 2.85H9.1C9.49 2.85 9.8 3.16 9.8 3.55V4.2' stroke='%23D6D6D6' stroke-width='1.15' stroke-linecap='round'/%3E%3Cpath d='M4.4 5.05V10.6C4.4 11.29 4.96 11.85 5.65 11.85H9.35C10.04 11.85 10.6 11.29 10.6 10.6V5.05' stroke='%23D6D6D6' stroke-width='1.15' stroke-linecap='round'/%3E%3Cpath d='M6.3 6.6V9.65' stroke='%23D6D6D6' stroke-width='1.15' stroke-linecap='round'/%3E%3Cpath d='M8.7 6.6V9.65' stroke='%23D6D6D6' stroke-width='1.15' stroke-linecap='round'/%3E%3C/svg%3E");
}

.effect-layer-delete:disabled {
  opacity: 0.26;
  cursor: default;
  pointer-events: none;
}

.effect-layer-delete:disabled:hover {
  background: transparent;
}

.uploader {
  margin: 12px 12px 8px;
  border: 1px solid #3a3a3a;
  border-radius: 9px;
  background: var(--sidebar);
  text-align: center;
  padding: 13px 10px;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.uploader:hover {
  border-color: #4b4b4b;
  background: #202020;
}

.uploader.is-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.uploader input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-title {
  margin: 0;
  font-weight: 600;
  font-size: 13px;
}

.upload-help {
  margin: 5px 0 0;
  color: #8f8f8f;
  font-size: 10px;
}

.controls {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 9px 12px 16px;
  display: grid;
  align-content: start;
  gap: 0;
}

.control-section {
  display: grid;
  gap: 11px;
}

.control-section + .control-section {
  border-top: 1px solid var(--line-soft);
  margin-top: 18px;
  padding-top: 20px;
}

.inner-section-divider {
  width: 100%;
  height: 1px;
  background: var(--line-soft);
  margin: 10px 0 12px;
}

.field {
  display: grid;
  gap: 5px;
  opacity: 1;
}

.field label {
  font-size: 11px;
  color: rgba(241, 241, 241, 0.82);
  line-height: 1.2;
  transition: color 0.16s ease;
}

.control-section > .field:first-of-type label,
.control-section > .control-group > .field:first-of-type label {
  color: rgba(241, 241, 241, 0.88);
}

.field.range-field {
  grid-template-columns: minmax(96px, 114px) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.field.range-field > label {
  font-size: 11px;
  color: rgba(241, 241, 241, 0.78);
  margin: 0;
}

.range-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.field .value-chip {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 46px;
  height: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: #aeaeae;
  font-family: "Manrope", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums lining-nums;
  transition: color 0.16s ease;
}

.field input[type="text"],
.field input[type="file"],
.field select {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #292929;
  color: #e7e7e7;
  padding: 0 9px;
  font-family: "Manrope", sans-serif;
  font-size: 12px;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23D7DEE8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px 6px;
}

.field input[type="file"] {
  padding-top: 7px;
}

.field:hover label,
.field:focus-within label {
  color: rgba(241, 241, 241, 0.94);
}

.field:hover .value-chip,
.field:focus-within .value-chip {
  color: #d0d0d0;
}

.field input[type="text"]:hover,
.field input[type="file"]:hover,
.field select:hover,
.toggle:hover,
.swatch:hover {
  border-color: #4b4b4b;
  background-color: var(--surface-soft-hover);
}

.field input[type="text"]:focus,
.field input[type="file"]:focus,
.field select:focus {
  border-color: #5d5d5d;
  background-color: #2c2c2c;
  outline: none;
}

.field input[type="range"] {
  width: 100%;
  height: 12px;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

.field input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  border: none;
  background: #3b3b3b;
}

.field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  border: none;
  border-radius: 999px;
  background: #e0e0e0;
  box-shadow: 0 0 0 1px #2b2b2b, 0 2px 8px #00000044;
  cursor: pointer;
}

.field input[type="range"]::-moz-range-track {
  height: 3px;
  border: none;
  border-radius: 999px;
  background: #3b3b3b;
}

.field input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 999px;
  background: #e0e0e0;
  box-shadow: 0 0 0 1px #2b2b2b, 0 2px 8px #00000044;
  cursor: pointer;
}

.field input[type="range"]::-moz-focus-outer {
  border: 0;
}

.field input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 1px #2b2b2b, 0 2px 8px #00000044, 0 0 0 2px #b0b0b0;
}

.field input[type="range"]:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 1px #2b2b2b, 0 2px 8px #00000044, 0 0 0 2px #b0b0b0;
}

.hidden,
.field.hidden {
  display: none !important;
}

.field.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.field.row.compact-actions {
  align-items: stretch;
}

.field.row.fixed-pair-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.hidden-file-input {
  display: none !important;
}

.field.row.charset-input-row {
  grid-template-columns: minmax(0, 70%) minmax(0, 30%);
  align-items: stretch;
  position: relative;
  overflow: visible;
  z-index: 2;
}

.charset-field {
  opacity: 1;
  position: relative;
  z-index: 5;
}

.charset-combo {
  position: relative;
  min-width: 0;
}

.charset-combo.is-open {
  z-index: 36;
}

.charset-combo-input {
  padding-right: 40px !important;
}

.charset-history-toggle {
  appearance: none;
  border: none;
  background: transparent;
  position: absolute;
  top: 50%;
  right: 4px;
  width: 32px;
  height: 32px;
  transform: translateY(-50%);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.16s ease, opacity 0.16s ease;
}

.charset-history-toggle:hover,
.charset-history-toggle:focus-visible,
.charset-combo.is-open .charset-history-toggle {
  background: rgba(255, 255, 255, 0.05);
  outline: none;
}

.charset-history-chevron {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  opacity: 0.76;
  background: center / 10px 10px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10' fill='none'%3E%3Cpath d='M2.25 3.5L5 6.25L7.75 3.5' stroke='%23B7BBC3' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.charset-combo.is-open .charset-history-chevron {
  transform: rotate(180deg);
  opacity: 0.96;
}

.charset-history-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  gap: 2px;
  max-height: 220px;
  padding: 8px;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid #41464e;
  background: #1d2025;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 40;
}

.charset-history-item {
  appearance: none;
  border: none;
  width: 100%;
  min-width: 0;
  background: transparent;
  color: #eceff3;
  display: flex;
  align-items: center;
  padding: 9px 10px;
  border-radius: 8px;
  text-align: left;
  font-family: "Manrope", sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.charset-history-item:hover,
.charset-history-item:focus-visible {
  background: #2b2f35;
  color: #ffffff;
  outline: none;
}

.charset-history-item.is-active {
  background: #262a31;
  color: #ffffff;
}

.charset-history-item-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.charset-history-empty {
  padding: 10px;
  color: rgba(232, 235, 240, 0.58);
  font-size: 11px;
  font-weight: 600;
}

.active-layer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 1px;
  min-height: 18px;
}

.active-layer-name {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--active-layer-accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-align: right;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.active-layer-name::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--active-layer-accent);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.28);
  flex: 0 0 auto;
}

.custom-glyph-list {
  display: grid;
  gap: 6px;
  margin-top: 2px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #232323;
}

.custom-glyph-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #969696;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.custom-glyph-items {
  display: grid;
  gap: 5px;
}

.custom-glyph-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 5px 6px;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  background: #2b2b2b;
  cursor: grab;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.14s ease;
}

.custom-glyph-item.is-dragging {
  opacity: 0.45;
  transform: scale(0.985);
}

.custom-glyph-item.is-drop-target {
  border-color: #6a6a6a;
  background: #303030;
}

.custom-glyph-grab {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid #444444;
  background:
    radial-gradient(circle, #9c9c9c 1px, transparent 1px) center / 5px 5px,
    #262626;
  opacity: 0.8;
}

.custom-glyph-thumb {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid #424242;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.04) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.custom-glyph-thumb img {
  max-width: 88%;
  max-height: 88%;
  display: block;
}

.custom-glyph-thumb.primitive-thumb {
  color: #efefef;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.custom-glyph-thumb.primitive-thumb::before {
  content: attr(data-thumb-label);
}

.custom-glyph-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.custom-glyph-order {
  flex: 0 0 auto;
  color: #9a9a9a;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.custom-glyph-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e1e1e1;
  font-size: 10px;
  font-weight: 600;
}

.custom-glyph-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.custom-glyph-move.btn.mini {
  min-width: 52px;
  height: 26px;
  padding: 0 8px;
  font-size: 10px;
}

.custom-glyph-remove.btn.mini {
  min-width: 64px;
}

.mixed-glyph-builder {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.charset-input-row .btn.mini {
  height: 34px;
  width: 100%;
  padding: 0 9px;
  white-space: nowrap;
}

.timeline-summary {
  gap: 3px;
}

.timeline-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #d4d4d4;
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums lining-nums;
}

.timeline-step-actions {
  grid-template-columns: 1fr 1fr;
}

#maskManualField {
  gap: 7px;
}

#maskManualField .btn.mini {
  width: 100%;
  justify-self: stretch;
}

.toggle,
.swatch {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #292929;
  color: #d7d7d7;
  font-size: 11px;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 7px;
}

.toggle input {
  accent-color: var(--accent);
}

.toggle span {
  color: rgba(241, 241, 241, 0.86);
  transition: color 0.16s ease;
}

.toggle:hover span,
.toggle:focus-within span,
.toggle:has(input:checked) span {
  color: #f1f1f1;
}

.swatch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
}

.swatch-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.swatch-hex {
  color: rgba(241, 241, 241, 0.7);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums lining-nums;
  text-transform: uppercase;
}

.swatch-trigger {
  appearance: none;
  width: 36px;
  height: 24px;
  border: 1px solid #4c4c4c;
  border-radius: 7px;
  padding: 0;
  background: #181818;
  overflow: hidden;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.swatch-trigger:hover {
  border-color: #5c5c5c;
}

.swatch-trigger:focus-visible,
.color-picker-close:focus-visible,
.color-picker-preset:focus-visible {
  outline: 2px solid rgba(126, 168, 255, 0.9);
  outline-offset: 2px;
}

.swatch-trigger-fill {
  display: block;
  width: 100%;
  height: 100%;
}

.color-picker-popover {
  position: fixed;
  z-index: 60;
  width: 356px;
  padding: 12px;
  border: 1px solid #3d3d3d;
  border-radius: 16px;
  background: rgba(26, 26, 26, 0.94);
  backdrop-filter: blur(22px);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.color-picker-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.color-picker-heading {
  display: grid;
  gap: 3px;
}

.color-picker-heading p {
  margin: 0;
}

.color-picker-heading p:first-child {
  color: #f0f0f0;
  font-size: 13px;
  font-weight: 700;
}

.color-picker-heading p:last-child {
  color: #979797;
  font-size: 10px;
  line-height: 1.4;
}

.color-picker-close {
  appearance: none;
  border: 1px solid #404040;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #242424;
  color: #d0d0d0;
  cursor: pointer;
}

.color-picker-close:hover {
  border-color: #575757;
  background: #2a2a2a;
}

.color-picker-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(132px, 0.9fr);
  gap: 12px;
}

.color-picker-surface-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  gap: 10px;
}

.color-picker-sv,
.color-picker-hue {
  position: relative;
  border: 1px solid #3b3b3b;
  border-radius: 12px;
  overflow: hidden;
  cursor: crosshair;
}

.color-picker-sv {
  min-height: 226px;
  background:
    linear-gradient(to top, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0)),
    linear-gradient(to right, rgba(255, 255, 255, 1), #00ffff);
}

.color-picker-hue {
  min-height: 226px;
  background: linear-gradient(
    to bottom,
    #ff0035 0%,
    #ff7a00 17%,
    #ffe600 34%,
    #1eff00 50%,
    #00d5ff 66%,
    #2447ff 82%,
    #d300ff 100%
  );
}

.color-picker-sv-handle,
.color-picker-hue-handle {
  position: absolute;
  pointer-events: none;
}

.color-picker-sv-handle {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -50%);
}

.color-picker-hue-handle {
  left: 50%;
  width: 18px;
  height: 8px;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.24);
  background: rgba(255, 255, 255, 0.18);
  transform: translate(-50%, -50%);
}

.color-picker-sidebar {
  display: grid;
  align-content: start;
  gap: 10px;
}

.color-picker-preview-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.color-picker-preview-card {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid #3a3a3a;
  border-radius: 12px;
  background: #232323;
}

.color-picker-preview-card.is-ghost {
  background: #202020;
}

.color-picker-preview-label,
.color-picker-input-label {
  color: #9a9a9a;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.color-picker-preview-swatch {
  width: 100%;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.color-picker-input-group {
  display: grid;
  gap: 6px;
}

.color-picker-text-input,
.color-picker-number-input {
  width: 100%;
  min-height: 36px;
  border: 1px solid #414141;
  border-radius: 10px;
  background: #212121;
  color: #ededed;
  font-size: 12px;
  font-weight: 600;
  padding: 0 11px;
  outline: none;
}

.color-picker-text-input:focus,
.color-picker-number-input:focus {
  border-color: #636363;
}

.color-picker-rgb-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.color-picker-number-input {
  text-align: center;
  padding: 0 6px;
}

.color-picker-actions .btn {
  width: 100%;
}

.color-picker-presets {
  display: grid;
  gap: 7px;
}

.color-picker-preset-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.color-picker-preset {
  appearance: none;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: var(--preset-color);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.color-picker-preset:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.16);
}

@media (max-width: 900px) {
  .color-picker-popover {
    width: min(356px, calc(100vw - 20px));
  }

  .color-picker-panel {
    grid-template-columns: 1fr;
  }
}

.control-group {
  border: none;
  border-radius: 0;
  background: transparent;
  display: grid;
  gap: 10px;
  padding: 0;
  margin-top: 0;
}

.section-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-toggle-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: #8f97a5;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  font-family: "Manrope", sans-serif;
  font-size: 16px;
  line-height: 1;
  font-weight: 600;
  transition: color 0.16s ease, opacity 0.16s ease;
}

.section-toggle-btn:hover,
.section-toggle-btn:focus-visible {
  color: #e5e5e5;
  outline: none;
}

.section-toggle-body {
  display: grid;
  gap: 10px;
}

#maskControlGroup.is-collapsed {
  gap: 0;
}

.mask-dependents {
  display: grid;
  gap: 9px;
  transition: opacity 0.16s ease, filter 0.16s ease;
}

#maskControlGroup .toggle {
  opacity: 0.94;
  transition: opacity 0.16s ease;
}

#maskControlGroup .toggle:hover,
#maskControlGroup .toggle:focus-within,
#maskControlGroup .toggle:has(input:checked) {
  opacity: 1;
}

.mask-dependent.is-inactive {
  opacity: 0.2;
  filter: saturate(0.55);
}

.mask-dependent.is-inactive,
.mask-dependent.is-inactive * {
  pointer-events: none;
}

#maskControlGroup[data-mask-enabled="false"] #maskInvertField {
  opacity: 0.15;
  filter: saturate(0.28) brightness(0.82);
}

#maskControlGroup[data-mask-enabled="false"] #maskDependents {
  opacity: 0.11;
  filter: saturate(0.22) brightness(0.8);
}

#maskControlGroup[data-mask-enabled="false"] #maskInvertField,
#maskControlGroup[data-mask-enabled="false"] #maskInvertField *,
#maskControlGroup[data-mask-enabled="false"] #maskDependents,
#maskControlGroup[data-mask-enabled="false"] #maskDependents * {
  pointer-events: none;
}

.group-title {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #858d9b;
  font-weight: 700;
}

.inline-help {
  margin: 0;
  color: #8f8f8f;
  font-size: 9px;
  line-height: 1.35;
  opacity: 1;
}

.controls .group-title,
.actions .group-title,
.active-layer-header .group-title,
.section-toggle-row .group-title {
  color: #f1f1f1;
  opacity: 1;
}

.actions {
  margin-top: auto;
  border-top: 1px solid var(--line-soft);
  background: var(--sidebar);
  padding: 14px 12px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  flex: 0 0 auto;
  z-index: 3;
  box-shadow: 0 -14px 28px rgba(0, 0, 0, 0.12);
}

.actions-export-settings {
  display: grid;
  gap: 10px;
}

.export-progress {
  display: grid;
  gap: 7px;
  padding: 10px 11px;
  border: 1px solid #3a3a3a;
  border-radius: 10px;
  background: #232323;
}

.export-progress-header,
.export-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.export-progress-label,
.export-progress-percent,
.export-progress-detail,
.export-progress-eta {
  font-size: 10px;
  font-weight: 700;
}

.export-progress-label,
.export-progress-percent {
  color: #ededed;
}

.export-progress-detail,
.export-progress-eta {
  color: #a8a8a8;
}

.export-progress-bar {
  position: relative;
  overflow: hidden;
  height: 6px;
  border-radius: 999px;
  background: #353535;
}

.export-progress-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #53c8a7 0%, #66d5b5 100%);
  transition: width 0.18s ease;
}

.actions-export-settings .group-title {
  margin-bottom: 1px;
}

.actions-export-primary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.actions-export-primary-row > .field {
  min-width: 0;
}

.actions-export-primary-row .field > label {
  white-space: nowrap;
}

.actions-export-primary-row.is-split {
  grid-template-columns: minmax(0, 1.2fr) minmax(132px, 0.8fr);
}

.render-reset-field .btn {
  width: 100%;
}

.btn {
  height: 34px;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: "Manrope", sans-serif;
  font-size: 12px;
  font-weight: 700;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.btn.primary {
  background: #53c8a7;
  color: #13211d;
  border-color: #66d5b5;
}

.btn.primary:hover {
  background: #62d3b2;
}

.btn.secondary {
  background: #2a2a2a;
  color: #e0e0e0;
  border-color: #454545;
}

.btn.secondary:hover {
  background: #313131;
}

.btn:disabled {
  opacity: 0.42;
  cursor: default;
  pointer-events: none;
}

.btn.mini {
  height: 30px;
  width: fit-content;
  padding: 0 10px;
  font-size: 11px;
}

.actions .btn.mini {
  height: 34px;
  width: 100%;
  justify-self: stretch;
}

.stage {
  grid-area: stage;
  min-width: 0;
  min-height: 0;
  background: var(--stage);
  display: grid;
  grid-template-rows: auto 1fr;
  position: relative;
  overflow: hidden;
}

.stage-toolbar {
  min-height: 42px;
  border-bottom: 1px solid var(--line-soft);
  background: #1a1a1a;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 8px 10px;
}

.status-block {
  display: grid;
  gap: 1px;
  min-width: 0;
  max-width: 560px;
}

.toolbar-label {
  margin: 0;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #878787;
}

#statusText {
  margin: 0;
  font-size: 10px;
  color: #b5b5b5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-self: end;
  min-width: 0;
}

.stage-history-tools {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  justify-self: center;
  padding: 3px;
  border: 1px solid #363636;
  border-radius: 8px;
  background: #202020;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.stage-history-btn {
  min-width: 28px;
  height: 24px;
  padding-inline: 0;
  border-color: transparent;
  background: transparent;
}

.stage-history-btn .project-icon {
  opacity: 0.96;
}

.stage-history-btn:hover:not(:disabled),
.stage-history-btn:focus-visible:not(:disabled) {
  background: #2d2d2d;
  border-color: #404040;
  outline: none;
}


.tool-chip {
  height: 22px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: #272727;
  color: #e0e0e0;
  padding: 0 8px;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.stage-tools .tool-chip {
  min-width: 28px;
  justify-content: center;
}

.stage-tools .tool-chip:hover,
.stage-tools .tool-chip:focus-visible {
  background: #2f2f2f;
  border-color: #484848;
  outline: none;
}

.tool-btn {
  appearance: none;
  cursor: pointer;
  font-family: "Manrope", sans-serif;
  min-width: 28px;
  justify-content: center;
}

.tool-btn:hover {
  background: #343434;
}

.tool-btn[aria-pressed="true"] {
  background: #3a3a3a;
  border-color: #555555;
  color: #ffffff;
}

.video-timeline-dock {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(1080px, calc(100% - 40px));
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(96, 96, 96, 0.62);
  border-radius: 16px;
  background: rgba(30, 30, 30, 0.74);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px) saturate(1.05);
  -webkit-backdrop-filter: blur(18px) saturate(1.05);
  z-index: 4;
}

.video-timeline-top {
  display: grid;
  grid-template-columns: auto auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.video-timeline-main {
  display: grid;
  gap: 10px;
}

.video-timeline-range,
.video-timeline-point {
  display: grid;
  gap: 6px;
}

.video-timeline-dock .value-chip {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 64px;
  color: #a8a8a8;
  font-family: "Manrope", sans-serif;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums lining-nums;
}

.video-timeline-range input[type="range"],
.video-timeline-point input[type="range"] {
  width: 100%;
  height: 12px;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

.video-timeline-range input[type="range"]::-webkit-slider-runnable-track,
.video-timeline-point input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  border: none;
  background: #3b3b3b;
}

.video-timeline-range input[type="range"]::-webkit-slider-thumb,
.video-timeline-point input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  border: none;
  border-radius: 999px;
  background: #e0e0e0;
  box-shadow: 0 0 0 1px #2b2b2b, 0 2px 8px #00000044;
  cursor: pointer;
}

.video-timeline-range input[type="range"]::-moz-range-track,
.video-timeline-point input[type="range"]::-moz-range-track {
  height: 3px;
  border: none;
  border-radius: 999px;
  background: #3b3b3b;
}

.video-timeline-range input[type="range"]::-moz-range-thumb,
.video-timeline-point input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 999px;
  background: #e0e0e0;
  box-shadow: 0 0 0 1px #2b2b2b, 0 2px 8px #00000044;
  cursor: pointer;
}

.video-timeline-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.video-timeline-label-row label {
  font-size: 10px;
  color: #d4d4d4;
}

.video-timeline-label-row .value-chip {
  min-width: 64px;
}

.video-timeline-points {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.timeline-btn {
  height: 32px;
  min-width: 96px;
  border-radius: 10px;
  padding: 0 12px;
  white-space: nowrap;
}

.video-timeline-loop {
  min-width: 88px;
  justify-content: center;
}

.video-timeline-dock .timeline-metrics {
  justify-content: center;
  padding: 0 8px;
}

.canvas-wrap {
  min-height: 0;
  overflow: auto;
  padding: 18px;
  display: flex;
  position: relative;
  align-items: center;
  justify-content: center;
  background-color: #141414;
}

.canvas-wrap.is-transparent-preview {
  background-color: #141414;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.05) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.05) 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
}

.canvas-wrap.is-overflow-x {
  justify-content: flex-start;
}

.canvas-wrap.is-overflow-y {
  align-items: flex-start;
}

.canvas-wrap.hand-ready,
.canvas-wrap.hand-ready #outputCanvas {
  cursor: grab !important;
}

.canvas-wrap.hand-dragging,
.canvas-wrap.hand-dragging #outputCanvas {
  cursor: grabbing !important;
}

.canvas-empty-state {
  position: absolute;
  inset: 18px;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.canvas-wrap.is-empty .canvas-empty-state {
  display: flex !important;
}

.canvas-wrap.is-empty #outputCanvas {
  display: none !important;
}

.canvas-empty-card {
  all: unset;
  display: grid;
  width: 100%;
  min-height: 100%;
  justify-items: center;
  align-content: center;
  gap: 4px;
  appearance: none;
  -webkit-appearance: none;
  pointer-events: auto;
  cursor: pointer;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  padding: 0;
  text-align: center;
  font: inherit;
  color: inherit;
  transition: opacity 0.18s ease;
}

.canvas-empty-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-inline: auto;
  width: min(1320px, 94vw);
  max-width: 100%;
  min-height: min(62vh, 620px);
  pointer-events: none;
  contain: paint;
  isolation: isolate;
}

.canvas-empty-art {
  display: block;
  margin-inline: auto;
  width: min(1420px, 96vw);
  height: min(66vh, 680px);
  max-width: 100%;
  border: 0;
  opacity: 0.88;
  contain: layout paint style;
  backface-visibility: hidden;
  will-change: transform;
  pointer-events: none;
}

.canvas-empty-card:hover {
  opacity: 0.92;
}

.canvas-empty-card.is-over {
  opacity: 1;
}

.canvas-empty-title {
  margin: 0;
  color: #f1f1f1;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.canvas-empty-help {
  margin: 2px 0 0;
  color: #afafaf;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.mask-brush-preview {
  --brush-size: 40px;
  --brush-inner-scale: 0.45;
  position: fixed;
  left: 0;
  top: 0;
  width: var(--brush-size);
  height: var(--brush-size);
  margin-left: calc(var(--brush-size) * -0.5);
  margin-top: calc(var(--brush-size) * -0.5);
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.42), 0 10px 24px rgba(0, 0, 0, 0.22);
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02) 58%, rgba(255, 255, 255, 0) 72%);
  pointer-events: none;
  z-index: 12;
  opacity: 0.98;
  transition: opacity 0.12s ease, transform 0.08s ease;
}

.mask-brush-preview-inner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--brush-size) * var(--brush-inner-scale));
  height: calc(var(--brush-size) * var(--brush-inner-scale));
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.04);
}

.mask-brush-preview.is-erasing {
  border-style: dashed;
  border-color: rgba(255, 178, 178, 0.96);
  background: radial-gradient(circle at center, rgba(255, 178, 178, 0.08), rgba(255, 178, 178, 0.02) 58%, rgba(255, 178, 178, 0) 72%);
}

.mask-brush-preview.is-erasing .mask-brush-preview-inner {
  border-color: rgba(255, 178, 178, 0.4);
  background: rgba(255, 178, 178, 0.04);
}

#outputCanvas {
  width: auto;
  max-width: none;
  max-height: none;
  height: auto;
  display: block;
  border-radius: 2px;
  border: 1px solid #575757;
  background: #181818;
  box-shadow: 0 0 0 1px #424242;
}

#outputCanvas.is-transparent-preview {
  background: transparent;
}

#outputCanvas.mask-paint-mode {
  cursor: none;
}

@container (max-width: 360px) {
  .field.row {
    grid-template-columns: 1fr;
  }

  .field.row.fixed-pair-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .field.row.charset-input-row {
    grid-template-columns: minmax(0, 70%) minmax(0, 30%);
  }

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

  .actions-export-settings,
  .actions .btn.primary {
    grid-column: 1 / -1;
  }

  .toggle,
  .swatch {
    height: auto;
    min-height: var(--control-h);
    padding-top: 8px;
    padding-bottom: 8px;
  }
}

@media (max-width: 1040px) {
  body {
    overflow: auto;
  }

  .app {
    height: auto;
    min-height: calc(100vh - 40px);
    grid-template-columns: 1fr;
    grid-template-areas:
      "stage"
      "layers"
      "panel";
  }

  .stage {
    min-height: 520px;
  }

  .layers-sidebar,
  .panel {
    border-left: none;
    border-top: 1px solid var(--line-soft);
    overflow: visible;
  }

  .layers-sidebar {
    border-right: none;
  }

  .sidebar-resize {
    display: none;
  }

  .chrome-center {
    display: none;
  }

  .canvas-empty-title {
    font-size: 17px;
  }

  .canvas-empty-help {
    font-size: 12px;
  }

  .video-timeline-dock {
    width: calc(100% - 24px);
    bottom: 12px;
  }

  .video-timeline-top,
  .video-timeline-points {
    grid-template-columns: 1fr 1fr;
  }

  .video-timeline-top .timeline-metrics {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .video-timeline-loop {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .video-timeline-dock {
    gap: 8px;
    padding: 10px;
  }

  .video-timeline-top,
  .video-timeline-points {
    grid-template-columns: 1fr;
  }

  .timeline-btn {
    width: 100%;
  }

  .effect-layer-item {
    min-height: 36px;
  }

  .canvas-empty-card {
    padding: 0;
  }

  .canvas-empty-visual {
    min-height: min(48vh, 420px);
  }

  .canvas-empty-art {
    width: min(1080px, 96vw);
    height: min(48vh, 440px);
  }

  .canvas-empty-title {
    font-size: 16px;
  }

  .canvas-empty-help {
    margin-top: 2px;
    font-size: 11px;
  }
}
