body {
  background: #2f3341;
  margin: 0;
  font-family: system-ui;
}

.github-link {
  position: fixed;
  right: calc(26px + env(safe-area-inset-right));
  bottom: calc(26px + env(safe-area-inset-bottom));
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(207, 211, 255, 0.85);
  background: #373944;
  backdrop-filter: blur(8px);
  z-index: 10000;
  text-decoration: none;
  transition: transform 120ms ease, color 120ms ease, background 120ms ease;
}

.github-link svg {
  width: 22px;
  height: 22px;
  display: block;
}

.github-link:hover {
  color: rgba(207, 211, 255, 1);
  background: rgba(72, 75, 92, 0.92);
  transform: translateY(-1px);
}

.github-link:active {
  transform: translateY(0px);
}

.github-link:focus-visible {
  outline: 2px solid rgba(207, 211, 255, 0.85);
  outline-offset: 3px;
}

header {
  display: none !important;
}

input[type="file"] {
  display: none !important;
}

.lucide-upload,
svg.lucide.lucide-upload,
svg[class*="lucide-upload"] {
  display: none !important;
}

/* Backup: hide export panels (in case text-scan misses) */
.has-animation .rounded-xl:has(svg.lucide-code-xml),
.has-animation .rounded-xl:has(svg.lucide-grid3x3) {
  display: none !important;
}

.empty-zone {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 40px;
  z-index: 100;
  background: #28282c;
}

.empty-zone-inner {
	--drop-icon-size: 64px;
	width: min(1100px, 92vw);
	height: min(520px, 60vh);
	border-radius: 14px;
	/* border: 2px dashed rgba(120, 125, 255, 0.55); */
	/* background: rgb(57 59 81); */
	color: rgb(119 124 147);
	font-size: 16px;
	font-weight: 400;
	letter-spacing: 0.2px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	text-align: center;
	text-transform: none;
	cursor: pointer;
	user-select: none;
}

.empty-zone-inner::before {
  content: "";
  width: var(--drop-icon-size);
  height: var(--drop-icon-size);
  background-color: #3E414E;
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%3E%3Cpath%20d%3D%27M10%204H4c-1.1%200-2%20.9-2%202v12c0%201.1.9%202%202%202h16c1.1%200%202-.9%202-2V8c0-1.1-.9-2-2-2h-8L10%204z%27/%3E%3C/svg%3E")
    no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%3E%3Cpath%20d%3D%27M10%204H4c-1.1%200-2%20.9-2%202v12c0%201.1.9%202%202%202h16c1.1%200%202-.9%202-2V8c0-1.1-.9-2-2-2h-8L10%204z%27/%3E%3C/svg%3E")
    no-repeat center / contain;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.25));
  animation: dropFolderFloat 1.8s ease-in-out infinite;
}

.empty-zone.dragging .empty-zone-inner::before {
  background-color: rgba(207, 211, 255, 0.9);
  animation: dropFolderPulse 0.9s ease-in-out infinite;
}

@keyframes dropFolderFloat {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-7px) rotate(-1.5deg);
  }
  100% {
    transform: translateY(0) rotate(0deg);
  }
}

@keyframes dropFolderPulse {
  0% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-6px) scale(1.04);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

.empty-zone.dragging .empty-zone-inner {
  border-style: solid;
  border-color: rgba(120, 125, 255, 0.9);
  background: rgba(74, 77, 92, 0.82);
}

.has-file .empty-zone,
.has-animation .empty-zone {
  display: none;
}

/* Center everything */
.preview {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

/* Card style */
.card {
  width: 80vw;
  max-width: 800px;
  background: #3a3f52;
  border-radius: 12px;
  padding: 16px;
  color: #cfd3ff;
}

/* Header */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Preview area */
.preview-canvas {
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Button */
button {
  background: none;
  border: none;
  color: #cfd3ff;
  cursor: pointer;
  opacity: 0.8;
}

button:hover {
  opacity: 1;
}

.toolbar {
  position: fixed;
  top: calc(24px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #474a59;
  /* border: 1px solid rgba(207, 211, 255, 0.18); */
  /* box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28); */
  backdrop-filter: blur(8px);
  z-index: 9999;
  max-width: calc(100vw - 24px);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

.toolbar-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  background: transparent;
  border: 0;
  color: rgba(207, 211, 255, 0.75);
  cursor: pointer;
  opacity: 1;
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toolbar-btn:hover {
  color: rgba(207, 211, 255, 0.95);
  background: rgba(207, 211, 255, 0.08);
}

.toolbar-btn:active {
  transform: translateY(1px);
  background: rgba(207, 211, 255, 0.12);
}

.toolbar-btn.active {
  color: rgba(207, 211, 255, 1);
}

.toolbar-btn.is-text {
  width: auto;
  padding: 0 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.toolbar-btn.is-subtle {
  opacity: 0.8;
}

.toolbar-sep {
  width: 1px;
  height: 22px;
  background: rgba(207, 211, 255, 0.18);
  margin: 0 4px;
}

/* Loaded-file layout (screenshot style) */
.has-animation main {
  max-width: none !important;
  padding-top: 160px !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
  display: flex !important;
  justify-content: center !important;
}

.has-animation [data-preview-frame="1"] {
  width: min(1100px, 92vw) !important;
  background: rgba(74, 77, 92, 0.9) !important;
  border-radius: 14px !important;
  padding: 0 !important;
  overflow: hidden !important;
  position: relative !important;
}

.has-animation [data-preview-frame="1"] .file-tab {
	position: absolute;
	top: -1px;
	left: -1px;
	background: rgb(105 106 135);
	color: #eef0ff;
	/* border: 2px solid rgba(120, 125, 255, 0.75); */
	border-bottom: 0;
	padding: 10px 14px;
	font-weight: 400;
	font-size: 14px;
	border-top-left-radius: 14px;
	border-top-right-radius: 14px;
	border-bottom-right-radius: 14px;
}

.has-animation [data-preview-frame="1"] .mx-auto.flex {
  width: 100% !important;
  height: min(520px, 60vh) !important;
  max-width: none !important;
  max-height: none !important;
  padding: 64px 24px 24px !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.has-animation [data-preview-frame="1"] svg {
  max-width: 100% !important;
  max-height: 100% !important;
}

@media (max-width: 640px) {
  .toolbar {
    top: calc(12px + env(safe-area-inset-top));
    padding: 10px 12px;
    border-radius: 12px;
    gap: 6px;
  }

  .toolbar-btn {
    width: 36px;
    height: 36px;
    border-radius: 9px;
  }

  .toolbar-btn.is-text {
    padding: 0 8px;
    font-size: 12px;
  }

  .toolbar-sep {
    height: 18px;
    margin: 0 2px;
  }

  .empty-zone {
    padding: 90px 14px 20px;
  }

  .empty-zone-inner {
    --drop-icon-size: 54px;
    width: calc(100vw - 28px);
    height: min(420px, 55vh);
  }

  .has-animation main {
    padding-top: 120px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .has-animation [data-preview-frame="1"] {
    width: calc(100vw - 24px) !important;
  }

  .has-animation [data-preview-frame="1"] .file-tab {
    font-size: 14px;
    padding: 8px 10px;
  }

  .has-animation [data-preview-frame="1"] .mx-auto.flex {
    height: min(420px, 55vh) !important;
    padding: 54px 14px 14px !important;
  }
}

/* Code block */
.code-block {
  background: #1e2230;
  padding: 12px;
  border-radius: 8px;
  overflow: auto;
  font-size: 12px;
}

/* Error */
.error {
  color: #ff6b6b;
}
