:root {
  --bg: #0b0c0f;
  --surface: #13151a;
  --surface-2: #1a1d24;
  --border: #23262e;
  --border-hover: #343845;
  --text: #e8eaee;
  --text-dim: #8a8f9c;
  --accent: #7c9cff;
  --accent-hover: #93adff;
  --danger: #ff7a7a;
  --radius: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

[hidden] {
  display: none !important;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 8vh 20px 40px;
  -webkit-font-smoothing: antialiased;
}

.app {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.header {
  text-align: center;
}

.header h1 {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.subtitle {
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* Dropzone */
.dropzone {
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
  outline: none;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--border-hover);
  background: var(--surface-2);
}

.dropzone.dragover {
  border-color: var(--accent);
  background: var(--surface-2);
}

.placeholder {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.icon {
  width: 44px;
  height: 44px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.primary-text {
  font-size: 1.05rem;
}

.secondary-text {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.link {
  color: var(--accent);
}

kbd {
  font-family: inherit;
  font-size: 0.85em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 7px;
}

.preview {
  display: flex;
  justify-content: center;
  width: 100%;
}

.preview img {
  max-width: 100%;
  max-height: 260px;
  border-radius: 10px;
  image-rendering: pixelated;
  background: #fff;
}

/* Result */
.result {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: rise 0.25s ease;
}

.result-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.result-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.result-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 8px 8px 16px;
  transition: border-color 0.18s ease;
}

.result-box:focus-within {
  border-color: var(--accent);
}

.result-text {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  padding: 2px 0;
  outline: none;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hover) transparent;
  -webkit-user-select: all;
  user-select: all;
}

.btn {
  background: var(--accent);
  color: #0b0c0f;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn:hover {
  background: var(--accent-hover);
}

.btn:active {
  transform: scale(0.97);
}

.btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  line-height: normal;
  font-family: inherit;
  text-decoration: none;
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-hover);
}

.btn-secondary:hover {
  background: var(--border);
}

.result-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
}

.clear-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.15s ease;
}

.clear-btn:hover {
  color: var(--text);
}

/* Error */
.error {
  text-align: center;
  color: var(--danger);
  font-size: 0.92rem;
  animation: rise 0.25s ease;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  body {
    padding-top: 5vh;
  }
  .btn {
    padding: 10px 14px;
  }
}
