:root {
  --bg: #0f1115;
  --panel: #161a22;
  --panel-2: #1d2230;
  --text: #e6e8ee;
  --muted: #97a0b3;
  --accent: #5b8cff;
  --accent-2: #7be0a4;
  --warn: #f0b95c;
  --danger: #ef6b6b;
  --border: #262c3a;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Pretendard", "Noto Sans KR", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Consolas, monospace; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.brand a { color: var(--text); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.container {
  max-width: 1180px; margin: 24px auto; padding: 0 16px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
}
h2 { margin: 0 0 8px; font-weight: 600; }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; font-weight: 500;
  transition: background 0.12s, border-color 0.12s, transform 0.04s;
}
.btn:hover:not(:disabled) { background: #232938; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--primary { background: var(--accent); color: #0b1020; border-color: transparent; }
.btn--primary:hover:not(:disabled) { background: #6e9bff; }
.btn--ghost { background: transparent; }

.banner {
  margin: 10px 0 14px;
  padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel-2);
}
.banner--warn { border-color: #4b3a14; background: #2a230f; color: #fbe7b3; }
.banner--info { border-color: #1f3a5b; background: #14233a; }

.dropzone {
  margin-top: 14px;
  border: 2px dashed #2c3447;
  border-radius: 14px;
  background: #11141c;
  padding: 36px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  min-height: 240px;
}
.dropzone:hover { border-color: #41507a; background: #131826; }
.dropzone.dragover { border-color: var(--accent); background: #15203a; }
.dropzone__inner { pointer-events: none; }
.dropzone__icon { font-size: 28px; opacity: 0.7; margin-bottom: 6px; }
.dropzone__title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }

.dropzone__preview {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.dropzone__preview img {
  max-width: 360px; max-height: 360px;
  border-radius: 8px; border: 1px solid var(--border);
  background: #000;
}
.dropzone__filename { color: var(--muted); font-size: 12px; }

.result-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px;
}
@media (max-width: 800px) { .result-grid { grid-template-columns: 1fr; } }
.result-figure {
  background: #0a0d14; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px; display: flex; flex-direction: column; gap: 6px;
}
.figure-label { color: var(--muted); font-size: 12px; }
.result-figure img {
  width: 100%; height: auto; display: block; border-radius: 6px; background: #000;
  image-rendering: -webkit-optimize-contrast;
}

.controls {
  margin-top: 16px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.controls label { display: block; margin-bottom: 6px; }
.controls input[type=range] {
  width: 100%; accent-color: var(--accent);
}

details.meta {
  margin-top: 14px; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px;
}
details.meta summary { cursor: pointer; color: var(--muted); }
details.meta .mono { margin-top: 8px; line-height: 1.7; }
