@font-face {
  font-family: "TikTok Sans";
  src: url("assets/TikTokSans.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: "TikTok Sans", sans-serif;
  --ink: #151515;
  --muted: #706f6a;
  --paper: #f2f1ed;
  --panel: #fbfaf7;
  --line: #d8d6cf;
  --soft-line: #e7e5de;
  --white: #fff;
  --cyan: #25f4ee;
  --red: #fe2c55;
  --danger: #a7213a;
  --danger-line: #d7a7ae;
  --grid-line: rgba(21, 21, 21, 0.025);
  --header-bg: rgba(242, 241, 237, 0.88);
  --rail-bg: rgba(251, 250, 247, 0.84);
  --quiet-bg: rgba(255, 255, 255, 0.52);
  --icon-bg: rgba(255, 255, 255, 0.7);
  --card-wash: rgba(251, 250, 247, 0.52);
  --hover-wash: rgba(21, 21, 21, 0.04);
  --menu-hover: rgba(21, 21, 21, 0.06);
  --workspace-center: rgba(255, 255, 255, 0.88);
  --workspace-edge: rgba(238, 237, 231, 0.82);
  --workspace-dot: rgba(21, 21, 21, 0.22);
  --canvas-action-bg: rgba(251, 250, 247, 0.94);
  --canvas-action-border: rgba(21, 21, 21, 0.22);
  --canvas-action-shadow: rgba(21, 21, 21, 0.1);
  --empty-bg: rgba(251, 250, 247, 0.72);
  --editor-ink: #151515;
  --editor-white: #fff;
  --radius: 14px;
  --shadow: 0 20px 54px rgba(26, 24, 20, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

input,
textarea {
  color: inherit;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

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

button {
  color: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

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

.button:active {
  transform: translateY(0);
}

.button--primary {
  color: var(--white);
  background: var(--ink);
  box-shadow: 4px 4px 0 var(--cyan), -2px -2px 0 var(--red);
}

.button--primary:hover {
  box-shadow: 6px 6px 0 var(--cyan), -3px -3px 0 var(--red);
}

.button--quiet {
  border-color: var(--line);
  background: var(--quiet-bg);
}

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

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--icon-bg);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.icon-button:hover {
  border-color: var(--ink);
  background: var(--white);
  transform: translateY(-1px);
}

.icon-button svg,
.button svg {
  width: 18px;
  height: 18px;
}

.github-link {
  flex: 0 0 auto;
  color: inherit;
  text-decoration: none;
}

.github-mark {
  display: block;
  width: 18px;
  height: 18px;
}

.airdrop-icon {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  object-fit: cover;
}

.app-header {
  display: flex;
  height: 72px;
  padding: 0 26px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.not-found-brand {
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 29px;
  height: 34px;
  border-radius: 6px;
  background: var(--ink);
  transform: rotate(-4deg);
  box-shadow: 4px 2px 0 var(--cyan), -3px -2px 0 var(--red);
}

.brand-mark::after {
  position: absolute;
  top: 8px;
  right: -5px;
  width: 11px;
  height: 18px;
  border-radius: 3px;
  background: var(--ink);
  content: "";
}

.brand-copy {
  display: grid;
  text-align: left;
  line-height: 0.9;
}

.brand-copy strong {
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.brand-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.header-actions,
.project-identity {
  display: flex;
  gap: 12px;
  align-items: center;
}

.header-actions .button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.project-identity {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.project-title-input {
  width: min(320px, 32vw);
  padding: 8px 10px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
  outline: none;
  background: transparent;
  font-size: 15px;
  font-weight: 750;
  text-align: center;
  text-overflow: ellipsis;
}

.project-title-input:hover,
.project-title-input:focus {
  border-color: var(--line);
  background: var(--panel);
}

.dashboard {
  width: min(1160px, calc(100% - 48px));
  margin: 0 auto;
  padding: 82px 0 100px;
}

.not-found {
  min-height: calc(100vh - 72px);
  display: grid;
  align-content: center;
  justify-items: start;
  padding-top: 40px;
}

.not-found h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(48px, 9vw, 108px);
  font-weight: 900;
  letter-spacing: -0.075em;
  line-height: 0.9;
}

.not-found > p:not(.eyebrow) {
  margin: 24px 0 30px;
  color: var(--muted);
  font-size: 18px;
}

.not-found-action {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

.dashboard-hero {
  display: flex;
  margin-bottom: 58px;
  align-items: end;
  justify-content: space-between;
}

.eyebrow {
  display: inline-flex;
  gap: 8px;
  margin: 0 0 16px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 8px 0 0 var(--cyan);
  content: "";
}

.dashboard h1 {
  max-width: 670px;
  margin: 0;
  font-size: clamp(46px, 7vw, 86px);
  font-weight: 820;
  line-height: 0.93;
  letter-spacing: -0.072em;
}

.dashboard h1 em {
  font-style: normal;
  text-decoration: underline;
  text-decoration-color: var(--cyan);
  text-decoration-thickness: 9px;
  text-underline-offset: -2px;
}

.dashboard-intro {
  max-width: 300px;
  margin: 0 0 7px 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.section-heading {
  display: flex;
  margin: 0 0 18px;
  align-items: center;
  justify-content: space-between;
}

.section-heading h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.project-card,
.new-project-card {
  position: relative;
  min-height: 250px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  text-align: left;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.project-card:hover,
.new-project-card:hover {
  border-color: #aaa8a0;
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.project-preview {
  position: absolute;
  inset: 0 0 74px;
  overflow: hidden;
  background: #dad8d1;
}

.project-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-preview-empty {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #aaa8a0;
  background:
    linear-gradient(135deg, transparent 49.5%, rgba(21, 21, 21, 0.08) 50%, transparent 50.5%),
    #e6e4dd;
}

.project-meta {
  position: absolute;
  right: 18px;
  bottom: 16px;
  left: 18px;
  display: flex;
  align-items: end;
  justify-content: space-between;
}

.project-meta strong {
  display: block;
  max-width: 70%;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-meta span {
  color: var(--muted);
  font-size: 12px;
}

.new-project-card {
  display: grid;
  border-style: dashed;
  place-items: center;
  color: var(--muted);
  background: var(--card-wash);
  text-align: center;
}

.new-project-card span:first-child {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  font-size: 30px;
  font-weight: 300;
}

.new-project-card strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
}

.new-project-card small {
  display: block;
  margin-top: 5px;
  font-size: 12px;
}

.editor-shell {
  display: grid;
  height: calc(100vh - 72px);
  grid-template-columns: 190px 168px minmax(300px, 1fr) 294px;
}

.slide-rail,
.asset-rail,
.inspector {
  min-height: 0;
  background: var(--rail-bg);
  backdrop-filter: blur(18px);
}

.slide-rail,
.asset-rail {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--line);
}

.slide-rail.is-file-drop-target {
  z-index: 9;
  background: color-mix(in srgb, var(--cyan) 14%, var(--panel));
  box-shadow: inset 0 0 0 3px var(--cyan), inset 0 0 0 5px var(--ink);
}

.slide-rail.is-file-drop-target::after {
  position: absolute;
  z-index: 4;
  right: 14px;
  bottom: 76px;
  left: 14px;
  padding: 12px 8px;
  border: 1px solid var(--ink);
  border-radius: 10px;
  color: var(--white);
  background: var(--ink);
  box-shadow: 3px 3px 0 var(--cyan);
  content: "Drop to add slides";
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  pointer-events: none;
}

.rail-heading {
  display: flex;
  padding: 20px 16px 12px;
  align-items: center;
  justify-content: space-between;
}

.rail-heading h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.rail-heading span {
  color: var(--muted);
  font-size: 11px;
}

.slide-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 4px 12px 18px;
  overflow-y: auto;
}

.slide-thumb {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  padding: 8px;
  align-items: start;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  cursor: grab;
  text-align: left;
}

.slide-thumb:hover {
  background: var(--hover-wash);
}

.slide-thumb.is-active {
  border-color: var(--ink);
  background: var(--white);
  box-shadow: 3px 3px 0 var(--cyan);
}

.slide-thumb.is-dragging {
  opacity: 0.42;
  cursor: grabbing;
}

.slide-thumb.is-drop-before::before,
.slide-thumb.is-drop-after::after {
  position: absolute;
  z-index: 5;
  right: 4px;
  left: 4px;
  height: 3px;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 0 1px var(--ink);
  content: "";
  pointer-events: none;
}

.slide-thumb.is-drop-before::before {
  top: -6px;
}

.slide-thumb.is-drop-after::after {
  bottom: -6px;
}

.slide-number {
  padding-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.thumb-image {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: 7px;
  background: #dedcd5;
  aspect-ratio: 9 / 16;
  pointer-events: none;
}

.thumb-rendered {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.thumb-rendering-placeholder {
  position: absolute;
  display: grid;
  inset: 0;
  overflow: hidden;
  place-items: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--panel) 78%, var(--ink)), var(--panel));
}

.thumb-rendering-placeholder span {
  width: 22px;
  height: 22px;
  border: 2px solid color-mix(in srgb, var(--ink) 22%, transparent);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: thumb-spin 700ms linear infinite;
}

.slide-drag-ghost {
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  margin: 0;
  border: 2px solid var(--ink);
  border-radius: 9px;
  box-shadow: 4px 4px 0 var(--cyan), 0 12px 28px rgba(0, 0, 0, 0.28);
  opacity: 1;
  pointer-events: none;
  transform: translateX(-200vw);
}

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

.rail-upload {
  padding: 12px;
  border-top: 1px solid var(--soft-line);
}

.rail-upload .button {
  display: inline-flex;
  width: 100%;
  gap: 8px;
  padding: 0 10px;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  white-space: nowrap;
}

.rail-upload .button svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.asset-grid {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: max-content;
  gap: 8px;
  align-content: start;
  padding: 4px 12px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.asset-empty {
  grid-column: 1 / -1;
  margin: 4px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.asset-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  cursor: grab;
}

.asset-item:hover {
  border-color: var(--ink);
}

.asset-item.is-dragging {
  opacity: 0.55;
  cursor: grabbing;
}

.asset-hover-preview {
  position: fixed;
  z-index: 90;
  width: auto;
  height: auto;
  max-width: 240px;
  max-height: 240px;
  border: 0;
  background: none;
  box-shadow: none;
  pointer-events: none;
  object-fit: contain;
}

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

.asset-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(21, 21, 21, 0.72);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
}

.asset-item:hover .asset-remove,
.asset-remove:focus-visible {
  opacity: 1;
}

.overlay-asset-name {
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-trash {
  display: flex;
  gap: 7px;
  min-height: 38px;
  margin: 0 12px 8px;
  padding: 0 10px;
  align-items: center;
  justify-content: center;
  border: 1px dashed #b7b4ab;
  border-radius: 10px;
  color: #7a7872;
  background: #dddcd6;
  font-size: 11px;
  font-weight: 750;
}

.asset-trash svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.asset-trash.is-hot {
  border-color: #5f5d57;
  color: #2b2b2b;
  background: #b8b6ae;
}

.workspace {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle at 50% 48%, var(--workspace-center), var(--workspace-edge) 45%, transparent 72%);
}

.workspace.is-file-drop-target {
  z-index: 7;
  box-shadow: inset 0 0 0 3px var(--cyan), inset 0 0 0 5px var(--ink);
}

.workspace.is-file-drop-target::after {
  position: absolute;
  z-index: 12;
  top: 58px;
  left: 50%;
  padding: 9px 14px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--white);
  background: var(--ink);
  box-shadow: 3px 3px 0 var(--cyan);
  content: "Drop to add asset";
  font-size: 11px;
  font-weight: 800;
  pointer-events: none;
  transform: translateX(-50%);
}

.canvas-composition {
  display: flex;
  gap: 18px;
  align-items: center;
}

.canvas-actions {
  position: relative;
  z-index: 8;
  display: grid;
  width: 132px;
  flex: 0 0 132px;
  gap: 8px;
}

.canvas-action {
  display: flex;
  min-width: 0;
  min-height: 42px;
  gap: 9px;
  padding: 0 12px;
  align-items: center;
  border: 1px solid var(--canvas-action-border);
  border-radius: 12px;
  color: var(--ink);
  background: var(--canvas-action-bg);
  box-shadow: 0 6px 18px var(--canvas-action-shadow);
  backdrop-filter: blur(12px);
  font-size: 11px;
  font-weight: 760;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.canvas-action:hover,
.canvas-action.is-active {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.canvas-action.is-active {
  color: var(--white);
  background: var(--ink);
  box-shadow: 2px 2px 0 var(--cyan);
}

.canvas-action svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.canvas-action span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace::before {
  position: absolute;
  inset: 0;
  opacity: 0.26;
  background-image: radial-gradient(var(--workspace-dot) 0.55px, transparent 0.55px);
  background-size: 8px 8px;
  content: "";
  pointer-events: none;
}

.workspace-inner {
  position: relative;
  display: grid;
  width: max-content;
  min-width: 100%;
  min-height: 100%;
  padding: 30px;
  overflow: visible;
  place-items: center;
}

.stage-wrap {
  position: relative;
  filter: drop-shadow(0 24px 30px rgba(26, 24, 20, 0.18));
}

.stage-frame {
  position: relative;
}

.stage-image-ghost {
  position: absolute;
  z-index: 0;
  display: none;
  max-width: none;
  filter: grayscale(1) saturate(0) brightness(0.92) contrast(0.76);
  opacity: 0.52;
  pointer-events: none;
  user-select: none;
}

.stage-frame.is-adjusting-photo .stage-image-ghost {
  display: block;
}

.selection-marquee {
  position: absolute;
  z-index: 20;
  display: none;
  border: 1px solid var(--cyan);
  background: rgba(37, 244, 238, 0.14);
  box-shadow: 0 0 0 1px rgba(21, 21, 21, 0.62), inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

.selection-marquee.is-visible {
  display: block;
}

.stage {
  position: relative;
  z-index: 1;
  overflow: hidden;
  background: #232323;
  user-select: none;
  touch-action: none;
}

.stage-image {
  position: absolute;
  display: block;
  pointer-events: none;
  max-width: none;
  user-select: none;
}

.stage.is-adjusting,
.stage.is-moving-photo {
  cursor: grab;
}

.stage.is-moving-photo {
  cursor: grabbing;
}

.stage-frame.is-adjusting-photo .layer-stack {
  opacity: 0.7;
  pointer-events: none;
}

.stage-frame.is-adjusting-photo .text-box,
.stage-frame.is-adjusting-photo .overlay-box {
  pointer-events: none;
}

.stage-frame.is-adjusting-photo .resize-handle,
.stage-frame.is-adjusting-photo .edge-resize-handle,
.stage-frame.is-adjusting-photo .rotate-handle {
  display: none;
}

.stage.is-drop-target,
.stage-frame.is-drop-target .stage {
  outline: 3px solid var(--cyan);
  outline-offset: -3px;
  box-shadow: inset 0 0 0 2px var(--ink);
}

.stage-dimensions {
  position: absolute;
  right: 0;
  bottom: -25px;
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.canvas-zoom-controls {
  display: inline-flex;
  overflow: hidden;
  align-items: center;
  padding-left: 10px;
  border-left: 1px solid var(--line);
  border-radius: 999px;
  letter-spacing: normal;
}

.canvas-zoom-button,
.canvas-zoom-level {
  height: 22px;
  padding: 0;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--canvas-action-bg);
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
  cursor: pointer;
}

.canvas-zoom-button {
  width: 24px;
}

.canvas-zoom-level {
  min-width: 42px;
  border-right: 0;
  border-left: 0;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.canvas-zoom-button:hover,
.canvas-zoom-level:hover {
  background: var(--white);
}

.tiktok-overlay {
  position: absolute;
  z-index: 5;
  inset: 0;
  overflow: hidden;
  opacity: 0.66;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.tiktok-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.tiktok-overlay-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 1080px;
  height: 1920px;
  color: #fff;
  font-family: "TikTok Sans", sans-serif;
  text-shadow: 0 2px 7px rgba(0, 0, 0, 0.9);
  transform: scale(var(--stage-scale, 0.5));
  transform-origin: top left;
}

.tt-preview-label {
  position: absolute;
  top: 24px;
  left: 24px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(0, 0, 0, 0.48);
  font-size: 15px;
  font-weight: 720;
  letter-spacing: 0.1em;
  text-shadow: none;
}

.tt-topbar {
  position: absolute;
  top: 54px;
  left: 50%;
  display: flex;
  gap: 38px;
  align-items: center;
  font-size: 36px;
  transform: translateX(-50%);
}

.tt-topbar span:first-child {
  opacity: 0.74;
}

.tt-topbar strong {
  position: relative;
}

.tt-topbar strong::after {
  position: absolute;
  right: 12px;
  bottom: -12px;
  left: 12px;
  height: 5px;
  border-radius: 999px;
  background: #fff;
  content: "";
}

.tt-search {
  position: absolute;
  top: -20px;
  left: calc(100% + 250px);
  font-size: 62px;
  font-weight: 400;
}

.tt-side-actions {
  position: absolute;
  right: 22px;
  bottom: 312px;
  display: flex;
  width: 98px;
  flex-direction: column;
  gap: 28px;
  align-items: center;
}

.tt-avatar {
  position: relative;
  width: 78px;
  height: 78px;
  margin-bottom: 6px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
}

.tt-avatar b {
  position: absolute;
  right: 15px;
  bottom: -14px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #fe2c55;
  font-size: 30px;
  line-height: 1;
  text-shadow: none;
}

.tt-action {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.tt-action > span {
  display: grid;
  width: 78px;
  height: 68px;
  place-items: center;
  font-size: 66px;
  font-weight: 760;
  line-height: 1;
}

.tt-action small {
  font-size: 25px;
  font-weight: 700;
}

.tt-bubble {
  position: relative;
  -webkit-text-stroke: 6px #fff;
  color: transparent;
}

.tt-bookmark {
  font-size: 70px !important;
}

.tt-share {
  font-size: 72px !important;
}

.tt-disc {
  display: grid;
  width: 80px;
  height: 80px;
  margin-top: 3px;
  place-items: center;
  border: 18px solid #252525;
  border-radius: 50%;
  background: #777;
  font-size: 24px;
}

.tt-caption {
  position: absolute;
  right: 158px;
  bottom: 158px;
  left: 24px;
  font-size: 31px;
  line-height: 1.32;
}

.tt-caption strong {
  font-size: 34px;
}

.tt-caption p {
  margin: 10px 0;
}

.tt-caption span {
  font-weight: 650;
}

.tt-bottom-nav {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  height: 115px;
  padding: 11px 25px 9px;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  background: rgba(0, 0, 0, 0.86);
  text-shadow: none;
}

.tt-bottom-nav span {
  display: grid;
  gap: 3px;
  place-items: center;
  font-size: 21px;
  font-weight: 650;
}

.tt-bottom-nav b {
  font-size: 44px;
  line-height: 1;
}

.tt-bottom-nav .tt-create {
  display: grid;
  width: 90px;
  height: 55px;
  justify-self: center;
  border-radius: 12px;
  color: #111;
  background: #fff;
  box-shadow: -10px 0 0 #25f4ee, 10px 0 0 #fe2c55;
  font-size: 48px;
  line-height: 1;
}

.text-layer,
.overlay-layer,
.layer-stack {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
}

.overlay-box {
  position: absolute;
  border: 1px solid transparent;
  outline: none;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  transform-origin: center center;
}

.overlay-box img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}

.overlay-image-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.overlay-image-clip img {
  position: absolute;
  max-width: none;
}

.overlay-image-clip--outside img {
  filter: grayscale(1) saturate(0) brightness(1.08) contrast(0.82);
  opacity: 0.72;
}

.overlay-image-clip--outside {
  display: none;
}

.overlay-box.is-selected .overlay-image-clip--outside,
.overlay-box.is-cropping .overlay-image-clip--outside {
  display: block;
}

.overlay-image-clip--inside {
  z-index: 1;
}

.overlay-box.is-cropping {
  overflow: hidden;
  cursor: default;
}

.crop-rect {
  position: absolute;
  z-index: 3;
  border: 1px solid #fff;
  box-shadow: 0 0 0 9999px rgba(15, 15, 15, 0.5);
  cursor: move;
  touch-action: none;
}

.crop-handle {
  position: absolute;
  z-index: 4;
  width: 11px;
  height: 11px;
  border: 2px solid var(--editor-ink);
  background: var(--cyan);
  box-shadow: 0 0 0 1px var(--editor-white);
}

.crop-handle[data-crop="nw"] { top: -6px; left: -6px; cursor: nwse-resize; }
.crop-handle[data-crop="ne"] { top: -6px; right: -6px; cursor: nesw-resize; }
.crop-handle[data-crop="sw"] { bottom: -6px; left: -6px; cursor: nesw-resize; }
.crop-handle[data-crop="se"] { right: -6px; bottom: -6px; cursor: nwse-resize; }
.crop-handle[data-crop="n"] { top: -6px; left: 50%; cursor: ns-resize; transform: translateX(-50%); }
.crop-handle[data-crop="s"] { bottom: -6px; left: 50%; cursor: ns-resize; transform: translateX(-50%); }
.crop-handle[data-crop="e"] { top: 50%; right: -6px; cursor: ew-resize; transform: translateY(-50%); }
.crop-handle[data-crop="w"] { top: 50%; left: -6px; cursor: ew-resize; transform: translateY(-50%); }

.overlay-box:hover {
  border-color: rgba(255, 255, 255, 0.52);
}

.overlay-box.is-selected {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(21, 21, 21, 0.75);
}

.overlay-box.is-dragging {
  cursor: grabbing;
}

.rotate-handle {
  position: absolute;
  top: -30px;
  left: 50%;
  z-index: 3;
  display: none;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 2px solid var(--editor-ink);
  border-radius: 50%;
  color: var(--editor-ink);
  background: var(--editor-white);
  box-shadow: 0 0 0 1px var(--editor-white);
  transform: translateX(-50%);
  cursor: grab;
}

.rotate-handle svg {
  width: 12px;
  height: 12px;
}

.rotate-handle::after {
  position: absolute;
  top: 20px;
  left: 50%;
  width: 1px;
  height: 10px;
  background: var(--cyan);
  content: "";
  transform: translateX(-50%);
}

.is-selected .rotate-handle {
  display: grid;
}

.text-box {
  position: absolute;
  display: grid;
  min-width: 40px;
  min-height: 26px;
  place-items: center;
  border: 1px solid transparent;
  outline: none;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
}

.text-box:hover {
  border-color: rgba(255, 255, 255, 0.52);
}

.text-box.is-selected {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(21, 21, 21, 0.75);
}

.text-box.is-dragging {
  cursor: grabbing;
}

.text-visual {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.text-visual--outside {
  display: none;
  filter: grayscale(1) saturate(0) brightness(0.9) contrast(0.78);
  opacity: 0.56;
  pointer-events: none;
}

.text-box.is-selected .text-visual--outside {
  display: grid;
}

.text-visual--inside {
  z-index: 1;
}

.text-content-wrap {
  width: 100%;
  max-height: 100%;
  padding: 0.14em 0.3em;
  overflow: hidden;
  color: var(--text-color, #fff);
  font-family: "TikTok Sans", sans-serif;
  font-weight: 500;
  line-height: 1.12;
  text-align: center;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.text-box[data-align="left"] .text-content-wrap,
.text-box[data-align="left"] .text-content,
.text-box[data-align="left"] .text-line {
  text-align: left;
}

.text-box[data-align="right"] .text-content-wrap,
.text-box[data-align="right"] .text-content,
.text-box[data-align="right"] .text-line {
  text-align: right;
}

.text-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  outline: 0;
  font: inherit;
  line-height: inherit;
}

.text-box.is-selected:not(.is-editing) .text-visual--inside .text-content {
  cursor: text;
  pointer-events: auto;
}

.text-line {
  position: relative;
  z-index: 1;
  display: block;
  flex: 0 0 auto;
  height: 1.12em;
  line-height: 1.12;
  text-align: center;
  white-space: nowrap;
}

.text-box.is-editing {
  cursor: grab;
}

.text-box.is-editing .text-content-wrap,
.text-box.is-editing .text-content {
  pointer-events: auto;
  user-select: text;
}

.text-box.is-editing .text-content {
  cursor: text;
}

.text-box.is-editing .text-content {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.text-box[data-style="outline"] .text-content-wrap {
  overflow: visible;
}

.text-box[data-style="outline"].is-editing .text-content {
  -webkit-text-stroke: 0.18em var(--outline-color, #111);
  paint-order: stroke fill;
}

.outline-line {
  display: block;
  width: 100%;
  overflow: visible;
}

.text-box[data-style="boxed"] .text-content-wrap {
  overflow: visible;
}

.text-box[data-style="boxed"] .text-content {
  color: var(--text-color, #fff);
  background: transparent;
  padding: 0;
}

.text-box[data-style="boxed"][data-box-shape="lines"] .text-line {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1.12em;
  margin: 0;
  padding: 0;
  color: var(--text-color, #fff);
  background: transparent;
  line-height: 1.12;
}

.text-box[data-style="boxed"][data-box-shape="lines"][data-align="left"] .text-line {
  justify-content: flex-start;
}

.text-box[data-style="boxed"][data-box-shape="lines"][data-align="right"] .text-line {
  justify-content: flex-end;
}

.text-box[data-style="boxed"][data-box-shape="lines"][data-background="black"] .text-line {
  color: var(--text-color, #fff);
}

.text-background {
  position: absolute;
  left: 0;
  z-index: 0;
  display: block;
  width: 100%;
  overflow: visible;
  pointer-events: none;
}

.text-box[data-style="boxed"][data-box-shape="full"] .text-visual {
  border-radius: 0.18em;
  background: #fff;
}

.text-box[data-style="boxed"][data-box-shape="full"] .text-content {
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.text-box[data-style="boxed"][data-background="black"] .text-content {
  color: var(--text-color, #fff);
  background: transparent;
}

.text-box[data-style="boxed"][data-box-shape="full"][data-background="black"] .text-visual {
  background: #111;
}

.text-box[data-style="boxed"][data-box-shape="full"][data-background="black"] .text-content {
  background: transparent;
}

.resize-handle {
  position: absolute;
  z-index: 2;
  display: none;
  width: 12px;
  height: 12px;
  border: 2px solid var(--editor-ink);
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 1px var(--editor-white);
}

.edge-resize-handle {
  position: absolute;
  z-index: 2;
  display: none;
  border: 2px solid var(--editor-ink);
  border-radius: 4px;
  background: var(--cyan);
  box-shadow: 0 0 0 1px var(--editor-white);
}

.is-selected .edge-resize-handle {
  display: block;
}

.edge-resize-handle[data-edge="n"],
.edge-resize-handle[data-edge="s"] {
  left: 50%;
  width: 18px;
  height: 8px;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.edge-resize-handle[data-edge="n"] { top: -5px; }
.edge-resize-handle[data-edge="s"] { bottom: -5px; }

.edge-resize-handle[data-edge="e"],
.edge-resize-handle[data-edge="w"] {
  top: 50%;
  width: 8px;
  height: 18px;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.edge-resize-handle[data-edge="e"] { right: -5px; }
.edge-resize-handle[data-edge="w"] { left: -5px; }

.is-selected .resize-handle {
  display: block;
}

.stage-frame.has-multi-selection .is-selected .resize-handle,
.stage-frame.has-multi-selection .is-selected .edge-resize-handle,
.stage-frame.has-multi-selection .is-selected .rotate-handle {
  display: none;
}

.resize-handle[data-corner="nw"] {
  top: -7px;
  left: -7px;
  cursor: nwse-resize;
}

.resize-handle[data-corner="ne"] {
  top: -7px;
  right: -7px;
  cursor: nesw-resize;
}

.resize-handle[data-corner="sw"] {
  bottom: -7px;
  left: -7px;
  cursor: nesw-resize;
}

.resize-handle[data-corner="se"] {
  right: -7px;
  bottom: -7px;
  cursor: nwse-resize;
}

.empty-stage {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(420px, 88%);
  min-height: 300px;
  padding: 40px;
  place-items: center;
  border: 1px dashed #aaa8a0;
  border-radius: 20px;
  color: var(--muted);
  background: var(--empty-bg);
  text-align: center;
}

.empty-stage-graphic {
  position: relative;
  width: 94px;
  height: 112px;
  margin: 0 auto 28px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #ddd9ce;
  box-shadow: 10px 9px 0 var(--cyan), -7px -5px 0 var(--red);
  transform: rotate(3deg);
}

.empty-stage-graphic::after {
  position: absolute;
  right: 14px;
  bottom: 15px;
  left: 14px;
  height: 44px;
  background: linear-gradient(145deg, transparent 49%, var(--ink) 50% 53%, transparent 54%);
  content: "";
}

.empty-stage h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 22px;
  letter-spacing: -0.035em;
}

.empty-stage p {
  max-width: 270px;
  margin: 0 auto 22px;
  font-size: 13px;
  line-height: 1.5;
}

.inspector {
  overflow-y: auto;
  border-left: 1px solid var(--line);
}

.inspector-header {
  display: flex;
  min-height: 62px;
  padding: 14px 16px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--soft-line);
}

.inspector-header h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

.inspector-body {
  padding: 18px 16px;
}

.control-group {
  margin: 0 0 24px;
}

.control-label {
  display: flex;
  margin: 0 0 9px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.control-label output {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.text-input {
  width: 100%;
  min-height: 104px;
  padding: 12px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  background: var(--white);
  font-size: 15px;
  line-height: 1.35;
}

.text-input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(37, 244, 238, 0.22);
}

.style-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.style-option {
  display: grid;
  min-width: 0;
  min-height: 76px;
  padding: 8px 5px 7px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  cursor: pointer;
}

.style-option:hover {
  border-color: #97958e;
}

.style-option.is-active {
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--cyan);
}

.style-preview {
  display: grid;
  min-width: 47px;
  min-height: 31px;
  padding: 3px 5px;
  place-items: center;
  color: #fff;
  background: #929089;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.style-preview--outline {
  -webkit-text-stroke: 2.4px #111;
  paint-order: stroke fill;
}

.style-preview--boxed {
  border-radius: 5px;
  color: #111;
  background: #fff;
  box-shadow: inset 0 0 0 1px #dad8d1;
}

.style-option small {
  align-self: end;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
}

.color-presets {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 7px;
  margin-bottom: 10px;
}

.color-preset {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid rgba(21, 21, 21, 0.22);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34);
  cursor: pointer;
}

.color-preset--white { background: #fff; }
.color-preset--black { background: #111; }
.color-preset--yellow { background: #ffe45e; }
.color-preset--pink { background: #fe2c55; }
.color-preset--cyan { background: #25f4ee; }
.color-preset--blue { background: #4d7cfe; }
.color-preset--green { background: #35d07f; }
.color-preset--purple { background: #a855f7; }

.color-preset:hover {
  transform: scale(1.08);
}

.color-preset.is-active::after {
  position: absolute;
  inset: -4px;
  border: 2px solid var(--ink);
  border-radius: inherit;
  content: "";
}

.color-custom {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 9px;
}

.color-picker-wrap {
  display: grid;
  min-width: 0;
  padding: 6px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
}

.color-picker-wrap:focus-within {
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--cyan);
}

#text-color-picker {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}

#text-color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

#text-color-picker::-webkit-color-swatch {
  border: 1px solid var(--line);
  border-radius: 50%;
}

#text-color-picker::-moz-color-swatch {
  border: 1px solid var(--line);
  border-radius: 50%;
}

.color-values {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.color-value-row {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  min-width: 0;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  overflow: hidden;
}

.color-value-row:focus-within {
  border-color: var(--ink);
}

.color-value-row > label {
  padding-left: 7px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  text-transform: uppercase;
  cursor: text;
}

.color-value-row input {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 4px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.color-value-row button {
  align-self: stretch;
  padding: 0 7px;
  border: 0;
  border-left: 1px solid var(--soft-line);
  background: #f4f3ee;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  cursor: pointer;
}

.color-value-row button:hover {
  color: var(--ink);
  background: #eceae3;
}

.alignment-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.alignment-option {
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: var(--white);
  cursor: pointer;
}

.alignment-option:hover,
.alignment-option.is-active {
  border-color: var(--ink);
  color: var(--ink);
}

.alignment-option.is-active {
  box-shadow: 2px 2px 0 var(--cyan);
}

.alignment-option svg {
  width: 20px;
  height: 20px;
}

.tone-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tone-option {
  display: flex;
  min-height: 48px;
  gap: 8px;
  padding: 6px 9px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.tone-option:hover,
.tone-option.is-active {
  border-color: var(--ink);
}

.tone-option.is-active {
  box-shadow: 2px 2px 0 var(--cyan);
}

.tone-swatch {
  display: grid;
  width: 34px;
  height: 28px;
  place-items: center;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 760;
}

.tone-swatch--white {
  border: 1px solid var(--line);
  color: #111;
  background: #fff;
}

.tone-swatch--black {
  color: #fff;
  background: #111;
}

.shape-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.shape-option {
  display: grid;
  min-height: 88px;
  padding: 9px 7px 7px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  cursor: pointer;
}

.shape-option:hover,
.shape-option.is-active {
  border-color: var(--ink);
}

.shape-option.is-active {
  box-shadow: 2px 2px 0 var(--cyan);
}

.shape-option small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
}

.shape-preview {
  display: grid;
  place-items: center;
  color: #111;
  font-size: 11px;
  font-weight: 760;
}

.shape-preview--lines {
  gap: 2px;
}

.shape-preview--lines i {
  padding: 3px 5px;
  border-radius: 3px;
  background: #e5e3dc;
  font-style: normal;
}

.shape-preview--full {
  width: 76px;
  height: 42px;
  border-radius: 6px;
  background: #e5e3dc;
}

.reset-photo-button {
  width: 100%;
  margin: -6px 0 18px;
}

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

input[type="range"] {
  width: 100%;
  height: 4px;
  margin: 0;
  appearance: none;
  border-radius: 999px;
  outline: none;
  background: var(--line);
}

input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  appearance: none;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--cyan);
  cursor: ew-resize;
}

.number-input {
  width: 50px;
  height: 34px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: var(--white);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.inspector-empty {
  padding: 34px 22px;
  color: var(--muted);
  text-align: center;
}

.inspector-empty span {
  display: grid;
  width: 42px;
  height: 42px;
  margin: 0 auto 12px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  font-size: 20px;
}

.inspector-empty p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.modal-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgba(21, 21, 21, 0.48);
  backdrop-filter: blur(8px);
  animation: fade-in 160ms ease both;
}

.modal {
  width: min(440px, 100%);
  padding: 26px;
  border: 1px solid var(--ink);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 9px 9px 0 var(--cyan), -6px -5px 0 var(--red), var(--shadow);
  animation: modal-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.modal h2 {
  margin: 0 0 7px;
  font-size: 28px;
  letter-spacing: -0.045em;
}

.modal p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.modal input {
  width: 100%;
  height: 49px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  background: var(--white);
  font-size: 16px;
}

.modal input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(37, 244, 238, 0.24);
}

.modal-actions {
  display: flex;
  gap: 9px;
  margin-top: 20px;
  justify-content: flex-end;
}

.layer-menu {
  position: fixed;
  z-index: 80;
  display: grid;
  min-width: 214px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.layer-menu--confirm {
  min-width: 132px;
}

.layer-menu-item {
  display: flex;
  gap: 10px;
  min-height: 36px;
  padding: 0 10px;
  align-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.layer-menu-item:hover {
  background: var(--menu-hover);
}

.layer-menu-item svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.layer-menu-item.is-danger {
  color: var(--danger);
}

.toast {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  max-width: min(380px, calc(100vw - 44px));
  padding: 12px 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--white);
  background: var(--ink);
  box-shadow: 3px 3px 0 var(--cyan);
  font-size: 12px;
  font-weight: 650;
  animation: toast-in 220ms ease both;
}

.hidden-input {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

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

@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #f4f5f0;
    --muted: #b9bbb3;
    --paper: #121310;
    --panel: #1c1d19;
    --line: #72756c;
    --soft-line: #3b3d37;
    --white: #242520;
    --danger: #ff9caf;
    --danger-line: #995463;
    --grid-line: rgba(255, 255, 255, 0.04);
    --header-bg: rgba(18, 19, 16, 0.9);
    --rail-bg: rgba(28, 29, 25, 0.88);
    --quiet-bg: rgba(255, 255, 255, 0.06);
    --icon-bg: rgba(255, 255, 255, 0.08);
    --card-wash: rgba(28, 29, 25, 0.7);
    --hover-wash: rgba(255, 255, 255, 0.08);
    --menu-hover: rgba(255, 255, 255, 0.09);
    --workspace-center: rgba(55, 57, 51, 0.74);
    --workspace-edge: rgba(25, 26, 23, 0.9);
    --workspace-dot: rgba(255, 255, 255, 0.22);
    --canvas-action-bg: rgba(31, 32, 28, 0.95);
    --canvas-action-border: rgba(255, 255, 255, 0.28);
    --canvas-action-shadow: rgba(0, 0, 0, 0.38);
    --empty-bg: rgba(28, 29, 25, 0.78);
    --shadow: 0 20px 58px rgba(0, 0, 0, 0.44);
  }

  .project-card:hover,
  .new-project-card:hover,
  .style-option:hover {
    border-color: #9a9d92;
  }

  .github-mark {
    filter: invert(1);
  }

  .project-preview,
  .thumb-image {
    background: #2c2e29;
  }

  .project-preview-empty {
    color: var(--muted);
    background:
      linear-gradient(135deg, transparent 49.5%, rgba(255, 255, 255, 0.11) 50%, transparent 50.5%),
      #30322d;
  }

  .asset-trash {
    border-color: #777a71;
    color: var(--muted);
    background: #2c2e29;
  }

  .asset-trash.is-hot {
    border-color: var(--ink);
    color: var(--ink);
    background: #45483f;
  }

  .stage-wrap {
    filter: drop-shadow(0 26px 34px rgba(0, 0, 0, 0.48));
  }

  .empty-stage {
    border-color: #777a71;
  }

  .empty-stage-graphic {
    background: #3b3d36;
  }

  .color-value-row button {
    background: #30312c;
  }

  .color-value-row button:hover {
    background: #3b3d36;
  }

  .color-preset {
    border-color: rgba(255, 255, 255, 0.52);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28);
  }

  .tone-swatch--black {
    border: 1px solid #777a71;
  }

  .modal-backdrop {
    background: rgba(0, 0, 0, 0.7);
  }

  .inspector.is-mobile-open {
    box-shadow: 0 -20px 40px rgba(0, 0, 0, 0.42);
  }
}

@media (max-width: 1040px) {
  .editor-shell {
    grid-template-columns: 148px 132px minmax(280px, 1fr) 250px;
  }

  .canvas-composition {
    gap: 12px;
  }

  .canvas-actions {
    width: 112px;
    flex-basis: 112px;
  }

  .dashboard-hero {
    display: block;
  }

  .dashboard-intro {
    margin: 28px 0 0;
  }
}

@media (max-width: 780px) {
  .app-header {
    height: 62px;
    padding: 0 14px;
  }

  .brand-copy small,
  .project-identity {
    display: none;
  }

  .header-actions {
    gap: 8px;
  }

  .header-actions .share-button {
    width: 42px;
    padding: 0;
  }

  .header-actions .share-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .editor-shell {
    height: calc(100vh - 62px);
    grid-template-columns: 68px 64px minmax(200px, 1fr);
  }

  .slide-rail,
  .asset-rail {
    grid-column: auto;
  }

  .rail-heading {
    justify-content: center;
  }

  .rail-heading h2,
  .rail-heading span,
  .slide-number,
  .rail-upload .button,
  .asset-empty {
    font-size: 0;
  }

  .asset-grid {
    grid-template-columns: 1fr;
    padding: 4px 6px 10px;
  }

  .asset-remove {
    opacity: 1;
  }

  .asset-trash {
    min-height: 32px;
    margin: 0 6px 8px;
    padding: 0;
  }

  .asset-trash span {
    display: none;
  }

  .slide-thumb {
    display: block;
    padding: 5px;
  }

  .inspector {
    position: fixed;
    z-index: 20;
    right: 0;
    bottom: 0;
    left: 132px;
    display: none;
    max-height: 62vh;
    border-top: 1px solid var(--line);
    box-shadow: 0 -20px 40px rgba(21, 21, 21, 0.16);
  }

  .inspector.is-mobile-open {
    display: block;
  }

  .workspace-inner {
    padding: 20px 14px 72px;
  }

  .canvas-composition {
    gap: 10px;
  }

  .canvas-actions {
    width: 44px;
    flex-basis: 44px;
  }

  .canvas-action {
    width: 44px;
    padding: 0;
    justify-content: center;
  }

  .canvas-action span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .mobile-edit-button {
    display: inline-flex !important;
  }

  .project-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard {
    width: min(100% - 28px, 1160px);
    padding-top: 54px;
  }
}

@media (min-width: 781px) {
  .mobile-edit-button {
    display: none !important;
  }
}

@media (max-width: 430px) {
  .app-header--editor .brand-copy {
    display: none;
  }
}

@media (max-width: 560px) {
  .header-actions [data-action="export"] {
    width: 42px;
    padding: 0;
  }

  .header-actions [data-action="export"] span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .dashboard h1 {
    font-size: 48px;
  }

  .dashboard-intro {
    font-size: 14px;
  }
}

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