:root {
  --bg: #0e1116;
  --panel: #161b23;
  --panel-2: #1d242f;
  --border: #2a3341;
  --text: #e8edf4;
  --muted: #8b97a8;
  --accent: #4f8cff;
  --accent-2: #7c5cff;
  --ok: #3ecf8e;
  --err: #ff6b6b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; }

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.brand .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.tagline { color: var(--muted); margin: 0 0 32px; }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  background: var(--panel);
  padding: 56px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--panel-2);
}
.dropzone .big { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.dropzone .hint { color: var(--muted); font-size: 13px; }
.dropzone input[type="file"] { display: none; }

/* Picker + panels */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}
.panel h3 { margin: 0 0 4px; font-size: 16px; }
.panel .sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

.candidates {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.candidates label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
.candidates label:has(input:checked) {
  border-color: var(--accent);
  background: var(--panel-2);
}

input[type="text"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 16px;
}
input[type="text"]:focus { outline: none; border-color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

.status { margin-top: 14px; font-size: 14px; color: var(--muted); }
.status.error { color: var(--err); }

/* Success */
.success .url-row {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}
.success .url-row input {
  flex: 1;
  margin: 0;
  font-family: ui-monospace, Consolas, monospace;
}
.success .ok { color: var(--ok); font-weight: 600; }

.footnote { color: var(--muted); font-size: 12px; margin-top: 32px; line-height: 1.6; }
.footnote code {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}

/* ---- Viewer wrapper ---- */
.viewer-body { overflow: hidden; height: 100vh; }
.viewer-frame {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.pill {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 17, 22, 0.92);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 10px;
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  z-index: 2147483000;
  font-size: 13px;
}
.pill select {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}
.pill .btn { padding: 7px 14px; border-radius: 999px; font-size: 13px; }
.pill .icon-btn {
  display: inline-flex;
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 11px;
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
}
.pill .icon-btn:hover { color: var(--text); }

/* Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2147483001;
  display: none;
}
.drawer-backdrop.open { display: block; }
.drawer {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(420px, 100vw);
  background: var(--bg);
  border-left: 1px solid var(--border);
  z-index: 2147483002;
  transform: translateX(100%);
  transition: transform 0.2s ease;
  padding: 24px;
  overflow-y: auto;
}
.drawer.open { transform: translateX(0); }
.drawer h2 { margin: 0 0 4px; font-size: 18px; }
.drawer .sub { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.drawer .close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}
