/* ─────────────────────────────────────────────────────────────
   BATCHSITES — Design System & Styles
   ───────────────────────────────────────────────────────────── */

/* ── TOKENS ──────────────────────────────────────────────────── */
:root {
  --bg:           #0b0b14;
  --bg2:          #0f0f1a;
  --card:         #141422;
  --card-hover:   #181830;
  --border:       #1e1e32;
  --border-hover: #2a2a45;
  --accent:       #7c3aed;
  --accent2:      #4f46e5;
  --accent-glow:  rgba(124,58,237,0.25);
  --text:         #f1f5f9;
  --text-muted:   #94a3b8;
  --text-dim:     #4a5568;
  --success:      #10b981;
  --error:        #ef4444;
  --warn:         #f59e0b;
  --info:         #3b82f6;
  --radius:       12px;
  --radius-sm:    8px;
  --radius-lg:    18px;
  --shadow:       0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:    0 12px 48px rgba(0,0,0,0.5);
  --font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --mono:         'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
  --transition:   0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── RESET ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
code { font-family: var(--mono); font-size: 0.85em; background: var(--border); padding: 2px 6px; border-radius: 4px; }

/* ── LOADING SCREEN ──────────────────────────────────────────── */
#loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 1000;
  flex-direction: column;
  gap: 24px;
}
.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.loading-logo {
  font-size: 56px;
  animation: pulse 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 20px var(--accent));
}
.loading-name {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #a78bfa, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.loading-bar {
  width: 180px;
  height: 3px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}
.loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px;
  animation: loading-progress 0.7s ease forwards;
}
@keyframes loading-progress { from { width: 0 } to { width: 70% } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.1); opacity: 0.8; } }

/* ── SETUP WIZARD ────────────────────────────────────────────── */
#setup-wizard {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}
.setup-sidebar {
  width: 320px;
  min-width: 280px;
  background: linear-gradient(160deg, #120c25 0%, #0d0d1e 60%, #0b0b14 100%);
  border-right: 1px solid var(--border);
  padding: 48px 36px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.setup-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-icon {
  font-size: 32px;
  filter: drop-shadow(0 0 12px var(--accent));
}
.brand-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #a78bfa, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.setup-tagline {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}
.setup-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.step-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 0;
}
.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  border: 2px solid var(--border);
  color: var(--text-dim);
  background: var(--card);
  transition: var(--transition);
  flex-shrink: 0;
}
.step-dot.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 16px var(--accent-glow);
}
.step-dot.done {
  border-color: var(--success);
  background: rgba(16,185,129,0.15);
  color: var(--success);
}
.step-dot.done::after { content: '✓'; font-size: 14px; }
.step-label {
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 500;
  transition: var(--transition);
}
.step-label.active { color: var(--text); }
.step-label.done { color: var(--success); }
.step-optional {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-dim);
  opacity: 0.7;
  margin-left: 4px;
  vertical-align: middle;
}
.step-line {
  width: 2px;
  height: 28px;
  background: var(--border);
  margin-left: 15px;
}
.setup-features {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.feature-icon { flex-shrink: 0; }
.setup-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  overflow-y: auto;
}
.setup-card {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.setup-step-header { margin-bottom: 32px; }
.setup-step-icon { font-size: 40px; margin-bottom: 16px; }
.setup-step-header h2 { font-size: 24px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.5px; }
.setup-step-header p { color: var(--text-muted); font-size: 14px; line-height: 1.7; }
.setup-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.setup-nav-right { display: flex; gap: 8px; align-items: center; }
.form-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.test-result { font-size: 13px; }
.test-ok { color: var(--success); }
.test-fail { color: var(--error); }

/* ── PROVIDER TABS ───────────────────────────────────────────── */
.provider-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  background: var(--bg2);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.provider-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}
.provider-tab:hover { background: var(--card-hover); color: var(--text); }
.provider-tab.active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  border: 1px solid var(--border);
}

/* ── FORM ELEMENTS ───────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-label-sm { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.form-hint { font-size: 12px; color: var(--text-dim); margin-top: 6px; line-height: 1.5; }
.form-group-inline { display: flex; flex-direction: column; gap: 6px; }
.input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: var(--transition);
  -webkit-appearance: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input::placeholder { color: var(--text-dim); }
.input-sm { padding: 7px 10px; font-size: 13px; }
select.input { cursor: pointer; }
textarea.input { resize: vertical; min-height: 140px; font-size: 14px; line-height: 1.6; }
.input-with-btn {
  display: flex;
  gap: 8px;
}
.input-with-btn .input { flex: 1; }

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { filter: brightness(1.15); box-shadow: 0 4px 16px var(--accent-glow); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--card-hover); color: var(--text); border-color: var(--border-hover); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 13px 24px; font-size: 15px; width: 100%; }
.btn-danger { color: var(--error) !important; }
.btn-danger:hover { background: rgba(239,68,68,0.1) !important; border-color: rgba(239,68,68,0.3) !important; }
.btn-icon { font-size: 15px; }
.spinner-sm {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* ── BADGES ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-optional { background: rgba(100,116,139,0.2); color: var(--text-dim); }
.badge-queued    { background: rgba(74,85,104,0.3);    color: #718096; }
.badge-generating { background: rgba(124,58,237,0.2); color: #a78bfa; }
.badge-ready     { background: rgba(16,185,129,0.15);  color: var(--success); }
.badge-publishing { background: rgba(59,130,246,0.15); color: var(--info); }
.badge-live      { background: rgba(16,185,129,0.2);   color: var(--success); }
.badge-error     { background: rgba(239,68,68,0.15);   color: var(--error); }

/* ── APP SHELL ───────────────────────────────────────────────── */
#app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── NAV ─────────────────────────────────────────────────────── */
#app-nav {
  height: 56px;
  background: rgba(11,11,20,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-logo { font-size: 22px; filter: drop-shadow(0 0 8px var(--accent)); }
.nav-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, #a78bfa, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-actions { display: flex; align-items: center; gap: 8px; }

/* ── MAIN LAYOUT ─────────────────────────────────────────────── */
#app-main {
  display: grid;
  grid-template-columns: 320px 1fr;
  grid-template-rows: 1fr;
  min-height: calc(100vh - 56px);
  gap: 0;
}
#input-panel {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}
.input-panel-inner { display: flex; flex-direction: column; gap: 20px; height: 100%; }
.input-group { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.input-group .form-label { margin-bottom: 4px; }
.keywords-textarea { flex: 1; min-height: 160px; resize: none; }
.keyword-count { font-size: 12px; color: var(--text-dim); text-align: right; margin-top: 4px; }
.settings-row { display: flex; flex-direction: column; gap: 12px; }
.prompt-textarea { resize: vertical; min-height: 72px; }
.prompt-all-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  color: var(--accent);
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: 99px;
  padding: 1px 7px;
  margin-left: 6px;
  vertical-align: middle;
  text-transform: none;
  letter-spacing: 0;
}

#results-section {
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 20px;
  min-height: 0;
}
#results-header {
  position: sticky;
  top: 56px;
  background: rgba(11,11,20,0.95);
  backdrop-filter: blur(8px);
  z-index: 10;
  padding: 12px 0;
  margin-top: -12px;
}
.results-header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.results-title { font-size: 16px; font-weight: 600; }
.text-muted { color: var(--text-muted); font-size: 13px; }
#publish-all-btn { margin-left: auto; }

/* ── TILE GRID ───────────────────────────────────────────────── */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  align-content: start;
}
.no-results {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  gap: 16px;
  color: var(--text-dim);
  text-align: center;
}
.no-results-icon { font-size: 48px; opacity: 0.3; }
.no-results p { font-size: 15px; }

/* ── SITE CARDS ──────────────────────────────────────────────── */
.site-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition);
  opacity: 0;
  transform: translateY(8px);
  role: listitem;
}
.site-card.card-visible { opacity: 1; transform: translateY(0); }
.site-card:hover { border-color: var(--border-hover); box-shadow: 0 4px 20px rgba(0,0,0,0.3); transform: translateY(-1px); }
.site-card[data-status="live"] { border-color: rgba(16,185,129,0.3); }
.site-card[data-status="error"] { border-color: rgba(239,68,68,0.3); }
.site-card[data-status="generating"] { border-color: rgba(124,58,237,0.3); }

.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-title { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.keyword-text { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-time { font-size: 11px; color: var(--text-dim); white-space: nowrap; flex-shrink: 0; }
.card-slug { font-family: var(--mono); font-size: 12px; color: var(--text-dim); padding: 4px 8px; background: var(--bg2); border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-words { font-size: 12px; color: var(--text-muted); }
.site-url { font-size: 13px; color: var(--success); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-url:hover { text-decoration: underline; }
.site-error { font-size: 12px; color: var(--error); line-height: 1.4; padding: 8px; background: rgba(239,68,68,0.08); border-radius: 6px; border: 1px solid rgba(239,68,68,0.2); }
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.card-actions .btn { flex: 1; min-width: 0; }

/* ── STATUS DOT ──────────────────────────────────────────────── */
.status-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}
.status-queued    { background: rgba(74,85,104,0.3);    color: #718096; }
.status-generating { background: rgba(124,58,237,0.2); color: #a78bfa; }
.status-ready     { background: rgba(16,185,129,0.15);  color: var(--success); }
.status-publishing { background: rgba(59,130,246,0.15); color: var(--info); }
.status-live      { background: rgba(16,185,129,0.2);   color: var(--success); }
.status-error     { background: rgba(239,68,68,0.15);   color: var(--error); }
.spinner-sm { flex-shrink: 0; }

/* ── MODAL ───────────────────────────────────────────────────── */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#modal-overlay.active { display: flex; animation: fadeIn 0.2s ease; }
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s ease;
}
.modal-preview {
  max-width: 960px;
  height: 85vh;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h2 { font-size: 17px; font-weight: 600; }
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: var(--transition);
}
.modal-close:hover { background: var(--card-hover); color: var(--text); }
.modal-body { overflow-y: auto; padding: 22px; flex: 1; }
#preview-iframe {
  width: 100%;
  flex: 1;
  border: none;
  background: #fff;
}
.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.preview-url {
  flex: 1;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg2);
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── SETTINGS MODAL ──────────────────────────────────────────── */
.settings-modal-wrap { max-width: 520px; }
.settings-modal { display: flex; flex-direction: column; gap: 0; }
.settings-section { padding: 20px 0; }
.settings-section:first-child { padding-top: 0; }
.settings-section h3 { font-size: 14px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.settings-divider { height: 1px; background: var(--border); margin: 4px 0; }
.settings-footer { padding-top: 20px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.privacy-note { font-size: 12px; color: var(--text-dim); display: flex; align-items: flex-start; gap: 8px; line-height: 1.5; padding: 10px 14px; background: var(--bg2); border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* ── TOASTS ──────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 14px;
  pointer-events: all;
  min-width: 280px;
  max-width: 380px;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.toast-visible { opacity: 1; transform: translateX(0); }
.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--error); }
.toast-warn    { border-left: 3px solid var(--warn); }
.toast-info    { border-left: 3px solid var(--info); }
.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-success .toast-icon { color: var(--success); }
.toast-error   .toast-icon { color: var(--error); }
.toast-warn    .toast-icon { color: var(--warn); }
.toast-info    .toast-icon { color: var(--info); }
.toast-msg { flex: 1; line-height: 1.4; }

/* ── ANIMATIONS ──────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px) scale(0.98) } to { opacity: 1; transform: translateY(0) scale(1) } }
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--card) 25%, var(--card-hover) 50%, var(--card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: 4px;
}

/* ── SCROLLBAR ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  #app-main { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  #input-panel { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .keywords-textarea { min-height: 120px; }
  #results-header { position: static; }
}
@media (max-width: 640px) {
  #setup-wizard { flex-direction: column; }
  .setup-sidebar { width: 100%; height: auto; padding: 28px 24px; position: static; }
  .setup-features { display: none; }
  .setup-main { padding: 24px 16px; }
  .setup-card { padding: 28px 20px; }
  .setup-steps { flex-direction: row; justify-content: center; gap: 12px; }
  .step-line { display: none; }
  .step-label { display: none; }
  .tile-grid { grid-template-columns: 1fr; }
  #toast-container { bottom: 16px; right: 16px; left: 16px; }
  .toast { min-width: 0; max-width: 100%; }
  #app-nav { padding: 0 16px; }
  #input-panel { padding: 16px; }
  #results-section { padding: 16px; }
  .modal { margin: 0; border-radius: var(--radius); }
  .modal-preview { height: 100vh; max-width: 100%; border-radius: 0; }
}

/* ── FREE BADGE (Ollama) ─────────────────────────────────────── */
.badge-free {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(16,185,129,0.2);
  color: var(--success);
  letter-spacing: 0.3px;
  vertical-align: middle;
  margin-left: 2px;
}

/* ── OLLAMA INFO BOX ─────────────────────────────────────────── */
.ollama-info-box {
  background: rgba(16,185,129,0.06);
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
.ollama-info-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--success);
}
.ollama-info-steps {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
}
.ollama-info-steps code { font-size: 12px; }
.ollama-cmd-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  overflow: hidden;
}
.ollama-cmd-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  min-width: 0;
}
.ollama-cmd-label {
  font-size: 11px;
  color: var(--text-dim);
  min-width: 64px;
  flex-shrink: 0;
  padding-top: 1px;
}
.ollama-cmd-row code {
  background: transparent;
  padding: 0;
  color: #a78bfa;
  font-size: 12px;
  word-break: break-all;
  overflow-wrap: anywhere;
  min-width: 0;
}
.ollama-info-note {
  font-size: 12px;
  color: var(--success);
  padding-top: 4px;
  border-top: 1px solid rgba(16,185,129,0.15);
}

/* ── CLAUDE PROXY INFO BOX ────────────────────────────────────── */
.proxy-info-box {
  background: rgba(99,102,241,0.06);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 20px;
}
.proxy-info-box > div { margin-bottom: 10px; }
.proxy-info-box > div:last-child { margin-bottom: 0; }
.proxy-info-title { font-weight: 600; color: var(--text-primary); font-size: 14px; margin-bottom: 8px; }
.proxy-info-steps { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-muted); }
.proxy-info-note { font-size: 12px; color: #a78bfa; padding-top: 4px; border-top: 1px solid rgba(99,102,241,0.15); }

/* ── AGENTIC INFO BOXES ───────────────────────────────────────── */
.setup-info-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(124,58,237,0.08);
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}
.setup-info-box .info-icon { color: var(--accent); flex-shrink: 0; }
.gen-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
  padding: 8px 12px;
  background: rgba(124,58,237,0.06);
  border: 1px solid rgba(124,58,237,0.15);
  border-radius: var(--radius-sm);
}
.gen-info .info-icon { color: var(--accent); }

/* ── CARD DETAIL LINE (step progress) ────────────────────────── */
.site-detail {
  font-size: 12px;
  color: #a78bfa;
  display: flex;
  align-items: center;
  gap: 6px;
}
.site-detail::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 2px solid rgba(167,139,250,0.4);
  border-top-color: #a78bfa;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ── SELECTION MODE ──────────────────────────────────────────── */
.tile-grid.selection-mode .site-card {
  cursor: pointer;
}
.tile-grid.selection-mode .site-card:hover {
  border-color: var(--accent);
  background: var(--card-hover);
}
.site-card.card-selected {
  border-color: var(--accent) !important;
  background: rgba(124,58,237,0.08) !important;
  box-shadow: 0 0 0 2px rgba(124,58,237,0.2) !important;
}

/* ── SELECTION CHECKBOX ──────────────────────────────────────── */
.card-sel-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: transparent;
  background: var(--bg2);
  transition: var(--transition);
  flex-shrink: 0;
}
.card-sel-check.checked {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 10px var(--accent-glow);
}
.tile-grid.selection-mode .site-card:hover .card-sel-check:not(.checked) {
  border-color: var(--accent);
  color: rgba(124,58,237,0.4);
}

/* ── CORRECTION PANEL ────────────────────────────────────────── */
#correction-panel {
  background: var(--card);
  border: 1px solid rgba(124,58,237,0.35);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 4px;
  box-shadow: 0 4px 20px rgba(124,58,237,0.12);
  animation: slideUp 0.2s ease;
}
.correction-inner { display: flex; flex-direction: column; gap: 12px; }
.correction-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.correction-label { font-size: 13px; color: var(--text-muted); }
.correction-select-btns { display: flex; gap: 6px; }
.correction-textarea {
  min-height: 72px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.6;
}
.correction-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 640px) {
  .correction-top { flex-direction: column; align-items: flex-start; }
  .correction-actions { flex-direction: column; align-items: stretch; }
  .correction-actions .btn { width: 100%; justify-content: center; }
}
