:root {
  --bg: #0f1220;
  --panel: #171a2b;
  --panel-2: #1e2236;
  --text: #e8eaf2;
  --muted: #9aa0b8;
  --accent: #6c8cff;
  --accent-2: #4f6ef0;
  --me: #2b6cff;
  --them: #333952;
  --border: #2a2f47;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #1b2036 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.topbar {
  text-align: center;
  padding: 40px 20px 10px;
  max-width: 780px;
  margin: 0 auto;
}
.topbar h1 { font-size: 1.9rem; margin: 0 0 8px; }
.tagline { color: var(--muted); margin: 0 auto; max-width: 620px; }

main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px;
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 48px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .05s;
  outline: none;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); background: var(--panel-2); }
.dropzone.dragover { border-color: var(--accent); background: var(--panel-2); transform: scale(1.005); }
.drop-icon { font-size: 2.4rem; }
.drop-title { font-size: 1.15rem; font-weight: 600; margin: 10px 0 4px; }
.drop-sub { color: var(--muted); margin: 0; font-size: .95rem; }
.link { color: var(--accent); text-decoration: underline; }

/* Options */
.options {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  margin: 18px 4px;
  color: var(--muted);
  font-size: .95rem;
}
.opt { display: inline-flex; align-items: center; gap: 8px; }
.opt.checkbox { cursor: pointer; }
.options select,
.options input[type="text"] {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: .95rem;
}
.options input[type="text"] {
  width: 120px;
}
.options input[type="text"]::placeholder { color: #6b7192; }

/* Status */
.status {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 12px 0;
  color: var(--text);
}
.spinner {
  width: 20px; height: 20px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Results */
.results {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  margin-top: 12px;
}
@media (max-width: 760px) {
  .results { grid-template-columns: 1fr; }
}
.col h2 { font-size: 1.05rem; margin: 0 0 10px; }
.preview-col img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}
.output-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.actions { display: flex; gap: 8px; }

#output {
  width: 100%;
  min-height: 340px;
  resize: vertical;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 1rem;
  line-height: 1.6;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.hint { color: var(--muted); font-size: .85rem; margin: 10px 2px 0; }

/* Buttons */
.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .05s, background .15s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent-2); color: #fff; }
.btn.primary:hover { background: var(--accent); }
.btn.primary.copied { background: #2fbf6b; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn.ghost:hover { color: var(--text); border-color: var(--accent); }

.foot {
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  padding: 30px 20px 40px;
}
