:root {
  --bg: #0d0f16;
  --bg-grad: radial-gradient(1200px 600px at 15% -10%, #1b2340 0%, transparent 55%),
             radial-gradient(1000px 500px at 110% 10%, #2a1b40 0%, transparent 50%),
             #0d0f16;
  --surface: #161922;
  --surface-2: #1c202c;
  --surface-3: #232838;
  --border: #2a2f40;
  --border-light: #383f54;
  --accent: #6d8cff;
  --accent-2: #9b6dff;
  --accent-grad: linear-gradient(135deg, #6d8cff 0%, #9b6dff 100%);
  --accent-grad-h: linear-gradient(135deg, #82a0ff 0%, #ac82ff 100%);
  --text: #eef0f7;
  --muted: #8b91a8;
  --muted-2: #5f6478;
  --green: #34d399;
  --red: #f87171;
  --yellow: #fbbf60;
  --cyan: #4dd8e6;
  --log-bg: #0a0b11;
  --log-fg: #c7cbdb;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }

::selection { background: rgba(109, 140, 255, 0.35); }

body {
  margin: 0;
  background: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── header ─────────────────────────────────────────────────────────────── */

.hdr {
  background: linear-gradient(90deg, rgba(22, 25, 34, 0.9), rgba(28, 22, 45, 0.9));
  backdrop-filter: blur(10px);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
}
.hdr-title {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.lang-switch {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 3px;
}
.lang-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active {
  background: var(--accent-grad);
  color: white;
  box-shadow: 0 2px 8px rgba(109, 140, 255, 0.35);
}

.subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 18px 20px 8px;
}

/* ── site tabs ──────────────────────────────────────────────────────────── */

.site-tabs {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 18px 20px 0;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  max-width: 420px;
  align-self: center;
  width: calc(100% - 40px);
}
.site-tab {
  flex: 1;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 9px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.site-tab:hover { color: var(--text); }
.site-tab.active {
  background: var(--accent-grad);
  color: white;
  box-shadow: 0 4px 14px rgba(109, 140, 255, 0.35);
}

/* ── drop zone ──────────────────────────────────────────────────────────── */

.drop-zone {
  margin: 0 20px 6px;
  max-width: 640px;
  width: calc(100% - 40px);
  align-self: center;
  background: var(--surface);
  border: 2px dashed var(--border-light);
  border-radius: 16px;
  text-align: center;
  padding: 28px 16px 24px;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.drop-zone.drag-over {
  background: var(--surface-3);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(109, 140, 255, 0.15), var(--shadow);
  transform: scale(1.01);
}
.drop-zone.has-one { border-color: var(--accent); border-style: solid; }
.drop-zone.has-two { border-color: var(--green); border-style: solid; box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12), var(--shadow-sm); }

.drop-icon { font-size: 38px; margin-bottom: 6px; filter: drop-shadow(0 4px 10px rgba(109, 140, 255, 0.35)); }
.drop-hint { font-size: 14px; color: var(--muted); margin-bottom: 14px; white-space: pre-line; line-height: 1.5; }

.btn-row { display: flex; justify-content: center; gap: 10px; }

/* ── buttons ────────────────────────────────────────────────────────────── */

.btn {
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent-grad);
  color: white;
  box-shadow: 0 4px 14px rgba(109, 140, 255, 0.35);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 6px 18px rgba(109, 140, 255, 0.45); }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  border: 1px solid var(--border-light);
}
.btn-secondary:hover { background: var(--surface-3); border-color: var(--muted-2); }

.btn-run {
  background: var(--accent-grad);
  color: white;
  font-size: 16px;
  padding: 13px 34px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(109, 140, 255, 0.4);
}
.btn-run:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.btn-run:disabled {
  background: var(--surface-2);
  color: var(--muted-2);
  box-shadow: none;
  cursor: not-allowed;
}

/* ── file cards ─────────────────────────────────────────────────────────── */

.cards-area {
  padding: 2px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 640px;
  width: 100%;
  align-self: center;
}

.card {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: var(--shadow-sm);
  animation: cardIn 0.18s ease;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card-icon { font-size: 18px; margin-right: 10px; }
.card-name { flex: 1; font-size: 13px; word-break: break-all; color: var(--text); }
.card-remove {
  background: none;
  border: none;
  color: var(--red);
  font-size: 15px;
  cursor: pointer;
  padding: 4px 9px;
  border-radius: 6px;
  transition: background 0.15s;
}
.card-remove:hover { background: rgba(248, 113, 113, 0.15); }

/* ── status / output ────────────────────────────────────────────────────── */

.status-row, .out-row {
  max-width: 640px;
  width: 100%;
  align-self: center;
  padding-left: 20px;
  padding-right: 20px;
}

.status-row { display: flex; align-items: center; gap: 8px; padding-top: 12px; font-size: 13px; }
.status-text { color: var(--muted); }

.out-row { display: flex; align-items: baseline; gap: 8px; padding-top: 6px; font-size: 13px; flex-wrap: wrap; }
.out-label { font-weight: 700; color: var(--text); }
.out-path { color: var(--cyan); font-style: italic; word-break: break-all; }

.run-wrap { text-align: center; padding: 18px 0 14px; }

/* ── log ─────────────────────────────────────────────────────────────────── */

.log-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 20px 20px;
  min-height: 200px;
  max-width: 640px;
  width: 100%;
  align-self: center;
}
.log-title {
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.log {
  flex: 1;
  background: var(--log-bg);
  color: var(--log-fg);
  font-family: "Cascadia Code", "Consolas", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.55;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow-y: auto;
  white-space: pre-wrap;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.4);
}
.log .ok   { color: var(--green); }
.log .warn { color: var(--yellow); }
.log .err  { color: var(--red); }
.log .info { color: var(--cyan); }

/* ── scrollbar ──────────────────────────────────────────────────────────── */

.log::-webkit-scrollbar { width: 8px; }
.log::-webkit-scrollbar-track { background: transparent; }
.log::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
.log::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

.privacy-note {
  text-align: center;
  color: var(--muted-2);
  font-size: 11px;
  max-width: 640px;
  margin: -8px auto 20px;
  padding: 0 20px;
}
