/* RankPilot — dark control-room design system.
   Palette: deep OLED black + midnight blue surfaces, blue data accents,
   amber CTA, green/amber/red status. Fonts: Fira Code (headings/numbers),
   Fira Sans (body). Dense 8–32px spacing rhythm. */

:root {
  --bg: #07090d;
  --surface: #0d1117;
  --surface-2: #131a24;
  --surface-3: #1a2332;
  --border: #1f2937;
  --border-soft: #182130;
  --text: #e6edf3;
  --text-dim: #8b98a9;
  --text-faint: #566173;
  --blue: #3b82f6;
  --blue-deep: #1e40af;
  --amber: #d97706;
  --amber-bright: #f59e0b;
  --green: #22c55e;
  --red: #ef4444;
  --mono: 'Fira Code', ui-monospace, monospace;
  --sans: 'Fira Sans', system-ui, sans-serif;
  --r: 10px;
  --r-sm: 6px;
}

/* ---------- light mode (toggle in the top bar, saved per browser) ---------- */
:root[data-theme="light"] {
  --bg: #eef1f6;
  --surface: #ffffff;
  --surface-2: #f2f5fa;
  --surface-3: #e4e9f1;
  --border: #cfd9e6;
  --border-soft: #e1e7f0;
  --text: #17202e;
  --text-dim: #46536a;
  --text-faint: #7c8aa0;
  --blue: #2563eb;
  --blue-deep: #1e40af;
  --amber: #b45309;
  --amber-bright: #d97706;
  --green: #15803d;
  --red: #dc2626;
}
:root[data-theme="light"] body {
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(37, 99, 235, .08), transparent 60%),
    var(--bg);
}
:root[data-theme="light"] .topbar { background: rgba(255, 255, 255, .85); }
:root[data-theme="light"] .log-row:nth-child(odd) { background: rgba(23, 32, 46, .03); }
:root[data-theme="light"] .log-row.success .log-msg { color: #15803d; }
:root[data-theme="light"] .log-row.warn .log-msg { color: #b45309; }
:root[data-theme="light"] .log-row.error .log-msg { color: #b91c1c; }
:root[data-theme="light"] .nav-item.active { background: rgba(37, 99, 235, .1); color: #1e40af; }
:root[data-theme="light"] .chip.active { background: rgba(37, 99, 235, .1); color: #1e40af; }
:root[data-theme="light"] .pill.pending { color: #33507a; border-color: #9db6d8; }
:root[data-theme="light"] .pill.done { color: #15803d; }
:root[data-theme="light"] .pill.running, :root[data-theme="light"] .pill.needs_approval, :root[data-theme="light"] .pill.p2 { color: #b45309; }
:root[data-theme="light"] .pill.failed, :root[data-theme="light"] .pill.hurt, :root[data-theme="light"] .pill.p1 { color: #b91c1c; }
:root[data-theme="light"] .live-chip { color: #15803d; border-color: rgba(21, 128, 61, .45); }
:root[data-theme="light"] .btn-danger { color: #b91c1c; }
:root[data-theme="light"] .brand-mark { filter: drop-shadow(0 0 6px rgba(217, 119, 6, .35)); }
:root[data-theme="light"] tr:hover td { background: rgba(23, 32, 46, .03); }

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(30, 64, 175, .12), transparent 60%),
    var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100dvh;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea {
  font-family: inherit; font-size: 14px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 8px 10px; width: 100%;
}
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 1px;
}
h2 { font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim); }
.mono { font-family: var(--mono); }

/* ---------- sidebar ---------- */
.sidebar {
  width: 232px; flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border-soft);
  padding: 20px 14px 14px; gap: 20px;
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.brand-mark { width: 30px; height: 30px; color: var(--amber-bright); flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, .45)); }
.brand-name { font-family: var(--mono); font-weight: 700; font-size: 17px; letter-spacing: .02em; }
.brand-sub { font-family: var(--mono); font-size: 10px; color: var(--text-faint); letter-spacing: .12em; }

.site-picker { display: flex; flex-direction: column; gap: 6px; }
.picker-label { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: none; border: none; color: var(--text-dim);
  padding: 8px 10px; border-radius: var(--r-sm); font-size: 13.5px;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: linear-gradient(90deg, rgba(59,130,246,.16), rgba(59,130,246,.05)); color: #cfe0ff; }
.badge {
  margin-left: auto; font-family: var(--mono); font-size: 10.5px;
  background: var(--surface-3); color: var(--text-dim);
  border-radius: 99px; padding: 1px 7px; min-width: 20px; text-align: center;
}
.badge:empty { display: none; }

.budget-box { border: 1px solid var(--border-soft); border-radius: var(--r); padding: 10px 12px; background: var(--surface-2); }
.budget-head { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-dim); margin-bottom: 7px; }
.budget-bar { height: 5px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.budget-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--blue), var(--amber-bright)); border-radius: 99px; transition: width .4s ease-out; }

/* ---------- main / topbar ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px; border-bottom: 1px solid var(--border-soft);
  background: rgba(13, 17, 23, .8); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 40;
}
.activity { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-dim); min-width: 0; }
#activityText { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; }
.pulse.on { background: var(--green); box-shadow: 0 0 0 0 rgba(34,197,94,.5); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
@media (prefers-reduced-motion: reduce) { .pulse.on { animation: none; } }

.top-actions { display: flex; align-items: center; gap: 14px; }
.health { position: relative; width: 40px; height: 40px; }
.health-ring { width: 40px; height: 40px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 4; }
.ring-val { fill: none; stroke: var(--green); stroke-width: 4; stroke-linecap: round;
  stroke-dasharray: 100.5; stroke-dashoffset: 100.5; transition: stroke-dashoffset .6s ease-out, stroke .3s; }
.health span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 10.5px; font-weight: 600; }

.theme-toggle {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
  border-radius: var(--r-sm); width: 36px; height: 36px;
  display: grid; place-items: center; transition: color .15s, border-color .15s;
}
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle:hover { color: var(--text); border-color: var(--blue); }

.btn-cycle {
  background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 8px 14px; font-size: 12.5px; transition: color .15s, border-color .15s;
}
.btn-cycle:hover { color: var(--text); border-color: var(--blue); }

.master-switch {
  font-family: var(--mono); font-weight: 700; font-size: 13px; letter-spacing: .12em;
  border: none; border-radius: var(--r-sm); padding: 10px 26px; color: #08130a;
  background: linear-gradient(180deg, #34d363, #1fa04a);
  box-shadow: 0 0 18px rgba(34, 197, 94, .35), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .1s, box-shadow .2s;
}
.master-switch:active { transform: scale(.97); }
.master-switch.stop {
  color: #fff; background: linear-gradient(180deg, #f26b6b, #d32f2f);
  box-shadow: 0 0 18px rgba(239, 68, 68, .35), inset 0 1px 0 rgba(255,255,255,.2);
}

/* ---------- views / cards ---------- */
.view { display: none; padding: 20px 24px 40px; flex-direction: column; gap: 16px; }
.view.active { display: flex; }
.card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--r); padding: 16px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r);
  padding: 12px 14px;
}
.stat .v { font-family: var(--mono); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }
.stat.good .v { color: var(--green); }
.stat.warn .v { color: var(--amber-bright); }
.stat.bad .v { color: var(--red); }
.stat.info .v { color: var(--blue); }

.live-chip {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; color: var(--green);
  border: 1px solid rgba(34,197,94,.4); padding: 2px 8px; border-radius: 99px;
}

/* log feed */
.log-feed { display: flex; flex-direction: column; gap: 1px; max-height: 480px; overflow-y: auto; font-size: 12.5px; }
.log-row { display: flex; gap: 10px; padding: 6px 8px; border-radius: var(--r-sm); }
.log-row:nth-child(odd) { background: rgba(255,255,255,.015); }
.log-time { font-family: var(--mono); font-size: 11px; color: var(--text-faint); flex-shrink: 0; padding-top: 1px; }
.log-msg { color: var(--text-dim); word-break: break-word; }
.log-row.success .log-msg { color: #7ee2a1; }
.log-row.warn .log-msg { color: #f3c46f; }
.log-row.error .log-msg { color: #f08f8f; }
.log-site {
  font-family: var(--mono); font-size: 10.5px; color: var(--amber-bright);
  flex-shrink: 0; min-width: 118px; padding-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.log-area {
  font-family: var(--mono); font-size: 10.5px; color: var(--text-faint);
  flex-shrink: 0; min-width: 52px; padding-top: 1px;
}

.plan-text {
  font-family: var(--sans); font-size: 13px; color: var(--text-dim);
  white-space: pre-wrap; word-break: break-word; max-height: 300px; overflow-y: auto;
}

.approval-list, .offpage-list, .mind-list, .dict-list, .schedule-list { display: flex; flex-direction: column; gap: 10px; }
.approval-item, .offpage-item, .mind-item, .dict-item, .schedule-item {
  border: 1px solid var(--border-soft); border-radius: var(--r-sm);
  padding: 10px 12px; background: var(--surface-2); font-size: 13px;
}
.approval-item { border-left: 3px solid var(--amber-bright); }
.item-title { font-weight: 600; margin-bottom: 3px; }
.item-sub { color: var(--text-dim); font-size: 12.5px; white-space: pre-wrap; word-break: break-word; }
.item-actions { display: flex; gap: 8px; margin-top: 8px; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-faint); text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { padding: 8px 10px; border-bottom: 1px solid var(--border-soft); color: var(--text-dim); vertical-align: top; word-break: break-word; }
tr:hover td { background: rgba(255,255,255,.02); }
td .t-title { color: var(--text); }

.pill {
  display: inline-block; font-family: var(--mono); font-size: 10.5px; padding: 2px 8px;
  border-radius: 99px; border: 1px solid var(--border); white-space: nowrap;
}
.pill.pending { color: #9db6d8; border-color: #33507a; }
.pill.running { color: var(--amber-bright); border-color: rgba(245,158,11,.5); }
.pill.done { color: var(--green); border-color: rgba(34,197,94,.45); }
.pill.failed, .pill.hurt { color: var(--red); border-color: rgba(239,68,68,.5); }
.pill.needs_approval { color: var(--amber-bright); border-color: rgba(245,158,11,.5); }
.pill.skipped { color: var(--text-faint); }
.pill.p1 { color: #ff9d9d; border-color: rgba(239,68,68,.4); }
.pill.p2 { color: var(--amber-bright); border-color: rgba(245,158,11,.4); }

/* chips / buttons */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
  font-size: 12px; padding: 4px 12px; border-radius: 99px; transition: all .15s;
}
.chip:hover { color: var(--text); }
.chip.active { background: rgba(59,130,246,.15); border-color: var(--blue); color: #cfe0ff; }

.btn-accent {
  background: linear-gradient(180deg, var(--amber-bright), var(--amber)); color: #1a1103;
  font-weight: 600; border: none; border-radius: var(--r-sm); padding: 9px 18px; font-size: 13px;
  transition: filter .15s, transform .1s;
}
.btn-accent:hover { filter: brightness(1.08); }
.btn-accent:active { transform: scale(.97); }
.btn-ghost {
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  border-radius: var(--r-sm); padding: 8px 14px; font-size: 13px; transition: all .15s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-faint); }
.btn-ghost.small { padding: 5px 10px; font-size: 12px; }
.btn-danger {
  background: none; border: 1px solid rgba(239,68,68,.5); color: #f08f8f;
  border-radius: var(--r-sm); padding: 5px 12px; font-size: 12px;
}
.btn-danger:hover { background: rgba(239,68,68,.12); }

.add-task { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.add-task input { flex: 2; min-width: 220px; }
.add-task select { flex: 0 0 140px; width: auto; }

.money-kw { margin-bottom: 16px; }
.money-kw label { font-size: 12px; color: var(--text-dim); display: block; margin-bottom: 6px; }
.money-kw .row { display: flex; gap: 8px; }

.hint { font-size: 12.5px; color: var(--text-faint); margin-bottom: 10px; }
.sub-h { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 8px; }
#mindText { margin-bottom: 10px; resize: vertical; }
#btnMind { margin-bottom: 16px; }
.mind-item.merged { border-left: 3px solid var(--green); }
.mind-item.new { border-left: 3px solid var(--blue); }

.dict-item { border-left: 3px solid var(--blue-deep); }
.dict-topic { font-family: var(--mono); font-size: 10.5px; color: var(--blue); text-transform: uppercase; letter-spacing: .08em; }

.schedule-item { display: flex; gap: 12px; align-items: flex-start; }
.day-num {
  font-family: var(--mono); font-weight: 700; font-size: 15px; color: var(--amber-bright);
  background: var(--surface-3); border-radius: var(--r-sm); width: 34px; height: 34px;
  display: grid; place-items: center; flex-shrink: 0;
}
.schedule-item input, .schedule-item textarea { margin-top: 4px; }
.schedule-item .grow { flex: 1; }

/* modals */
.modal-back {
  position: fixed; inset: 0; background: rgba(3, 5, 8, .72); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-back.open { display: flex; }
.modal {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r);
  padding: 22px; width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 12px;
  max-height: 90dvh; overflow-y: auto;
}
.modal-wide { max-width: 1100px; }
.modal h2 { margin-bottom: 4px; }
.modal label { font-size: 12.5px; color: var(--text-dim); display: flex; flex-direction: column; gap: 5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-height: 0; }
.diff-grid h3 { font-family: var(--mono); font-size: 11px; color: var(--text-faint); text-transform: uppercase; margin-bottom: 6px; }
.diff-grid pre {
  background: var(--bg); border: 1px solid var(--border-soft); border-radius: var(--r-sm);
  padding: 10px; font-family: var(--mono); font-size: 11.5px; line-height: 1.5;
  overflow: auto; max-height: 55dvh; white-space: pre-wrap; word-break: break-all;
}
@media (max-width: 900px) { .diff-grid { grid-template-columns: 1fr; } }

.empty { color: var(--text-faint); font-size: 13px; padding: 14px 4px; text-align: center; }

/* ---------- Profiles: the picture-set tagging grid ---------- */
.pool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.pool-card {
  background: var(--surface-2); border: 2px solid var(--border-soft); border-radius: var(--r-sm);
  padding: 8px; cursor: pointer; transition: border-color .15s, background .15s;
}
.pool-card:hover { border-color: var(--text-faint); }
.pool-card.picked { border-color: var(--blue); background: rgba(59,130,246,.10); }
.pool-card.used { opacity: .5; }
.pool-card.skipped { opacity: .45; }
.pool-shots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; margin-bottom: 7px; }
.pool-shots img {
  width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 4px; display: block;
  background: var(--surface-3);
}
.pool-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin-bottom: 5px; }
.pool-meta .t-title { font-size: 12.5px; }

/* ---------- Site Structure page ---------- */
.structure-list { display: flex; flex-direction: column; gap: 14px; }
.struct-item { background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--r-sm); padding: 12px 14px; }
.struct-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.struct-note { font-size: 12.5px; color: var(--text-dim); margin-top: 10px; padding-left: 10px; border-left: 2px solid var(--border); }
.field-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.field-chip { font-family: var(--mono); font-size: 10.5px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--border); }
.field-chip.yes { color: var(--green); border-color: rgba(34,197,94,.4); }
.field-chip.no  { color: var(--text-faint); }

/* ---------- Performance page (hand-drawn SVG charts) ---------- */
.trend { font-family: var(--mono); font-size: 11.5px; white-space: nowrap; }
.trend.up   { color: var(--green); }
.trend.down { color: var(--red); }
.trend.flat { color: var(--text-faint); }

.perf-charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; }
.perf-chart { background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--r-sm); padding: 10px 12px 4px; }
.perf-chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.spark { width: 100%; height: 120px; display: block; overflow: visible; }
.spark-line { fill: none; stroke: var(--blue); stroke-width: 1.8; vector-effect: non-scaling-stroke;
  stroke-linejoin: round; stroke-linecap: round; }
.spark-fill { fill: var(--blue); opacity: .13; stroke: none; }
.spark-ax { fill: var(--text-faint); font-family: var(--mono); font-size: 9px; }

@media (max-width: 900px) { .perf-charts { grid-template-columns: 1fr; } }

.google-accounts { display: flex; flex-direction: column; gap: 8px; }
.google-acct {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: var(--r-sm); padding: 9px 12px;
}

/* ---------- Problems page ---------- */
.problem-list { display: flex; flex-direction: column; gap: 10px; }
.problem-item {
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-left: 3px solid var(--text-faint); border-radius: var(--r-sm); padding: 12px 14px;
}
.problem-item.needs_you { border-left-color: var(--red); }
.problem-item.open      { border-left-color: var(--amber-bright); }
.problem-item.fixed     { border-left-color: var(--green); opacity: .75; }
.problem-meta  { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); margin-top: 6px; }
.problem-tried { font-size: 12px; color: var(--text-dim); margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--border); }
.problem-you   { font-size: 12.5px; color: var(--amber-bright); margin-top: 8px; }

/* ---------- All Websites control board ---------- */
#sitesTable td { vertical-align: middle; }
#sitesTable input.site-tick { width: auto; margin: 0; cursor: pointer; }
#sitesTable tr.row-picked td { background: rgba(59,130,246,.10); }
#sitesTable a { color: var(--blue); text-decoration: none; }
#sitesTable a:hover { text-decoration: underline; }
.pill.skipped { color: var(--text-faint); border-color: var(--border); }

/* ---------- Add Websites (bulk import from the AISEO list) ---------- */
.imp-toolbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.imp-toolbar input[type="search"] { flex: 1; min-width: 240px; }
.imp-check { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-dim); white-space: nowrap; cursor: pointer; }
.imp-check input { width: auto; margin: 0; cursor: pointer; }

.imp-actions {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 10px 0 12px; border-top: 1px solid var(--border-soft); margin-top: 4px;
}
.imp-count { font-family: var(--mono); font-size: 12px; color: var(--text-dim); margin-left: auto; }

.imp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.imp-group-head {
  grid-column: 1 / -1; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-faint); padding: 12px 2px 2px; border-bottom: 1px solid var(--border-soft);
}
.imp-item {
  display: flex; gap: 10px; align-items: flex-start; padding: 9px 11px;
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--r-sm);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.imp-item:hover { border-color: var(--text-faint); }
.imp-item.picked { border-color: var(--blue); background: rgba(59,130,246,.10); }
.imp-item.taken { opacity: .62; cursor: not-allowed; }
.imp-item.taken:hover { border-color: var(--border-soft); }
.imp-item input { width: auto; margin: 2px 0 0; flex: 0 0 auto; cursor: pointer; }
.imp-item.taken input { cursor: not-allowed; }
.imp-body { min-width: 0; flex: 1; }
.imp-dom { font-size: 13px; color: var(--text); word-break: break-all; }
.imp-meta { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.imp-warn { font-size: 11px; color: var(--amber-bright); margin-top: 3px; }

/* progress list */
.imp-queue { display: flex; flex-direction: column; gap: 8px; }
.imp-job { background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--r-sm); padding: 10px 12px; }
.imp-job.working { border-color: var(--blue); }
.imp-job.failed  { border-color: rgba(239,68,68,.5); }
.imp-job.needs_setup { border-color: rgba(245,158,11,.5); }
.imp-job.ready   { border-color: rgba(34,197,94,.4); }
.imp-job-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.imp-job-name { font-size: 13px; color: var(--text); flex: 1; min-width: 160px; word-break: break-all; }
.imp-job-step { font-size: 12px; color: var(--text-dim); margin-top: 5px; }
.imp-job-err  { font-size: 12px; color: #f08f8f; margin-top: 5px; word-break: break-word; }
.imp-bar { height: 5px; background: var(--surface-3); border-radius: 99px; overflow: hidden; margin-top: 7px; }
.imp-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue-deep), var(--blue)); transition: width .4s; }
.imp-job.ready .imp-bar > i { background: var(--green); }

@media (max-width: 900px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: column; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .imp-list { grid-template-columns: 1fr; }
}
