/* run-target.css — styling for the run-target picker modal and the
   "Run location" settings section. New classes only (`.modal-overlay`,
   `.modal-box`, `.modal-actions`, `.btn*`, `.alert*` come from style.css), so
   nothing that existed before is restyled. */

/* ── picker modal ──────────────────────────────────────────────────────── */
/* New classes only; dark/light come from the existing CSS variables. */
.qt-rt-box { max-width: 620px; width: 100%; max-height: 92vh; overflow-y: auto; }
.qt-rt-intro { margin: 0 0 14px; color: var(--text-muted); font-size: 14px; }

/* Three selectable cards (shared server / local runner / another region) */
.qt-rt-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.qt-rt-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  font-size: 14px;
  line-height: 1.4;
  min-height: 84px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.qt-rt-card:hover { border-color: var(--primary); }
.qt-rt-card:focus-visible,
.qt-rt-card:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.qt-rt-card.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 35%, transparent);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}
.qt-rt-card.is-selected::after {
  content: "\2713 selected";
  display: block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
}
.qt-rt-card.is-disabled {
  opacity: .55;
  cursor: not-allowed;
}
.qt-rt-card.is-disabled:hover { border-color: var(--border); }

.qt-rt-hint { font-size: 12px; color: var(--text-muted); display: block; }
/* ``display: block`` above would beat the UA's ``[hidden]`` rule, so an element
   the code hides would stay visible (the "no destination matches" line showed
   even with a full list). Same pitfall documented in auth.css. */
.qt-rt-hint[hidden], .qt-rt-list[hidden], .qt-rt-cost[hidden],
.qt-rt-region[hidden], .qt-rt-card[hidden] { display: none; }

/* External run: search + grouped destination list */
.qt-rt-region { margin: 4px 0 12px; }
.qt-rt-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.qt-rt-search {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
}
.qt-rt-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  max-height: 190px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.qt-rt-group {
  position: sticky;
  top: 0;
  padding: 6px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-muted, var(--surface));
  border-bottom: 1px solid var(--border);
}
.qt-rt-dest {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 14px;
  border-left: 3px solid transparent;
}
.qt-rt-dest:hover { background: var(--surface-muted, rgba(0,0,0,.04)); }
.qt-rt-dest:focus-visible,
.qt-rt-dest:focus { outline: 2px solid var(--primary); outline-offset: -2px; }
.qt-rt-dest.is-selected {
  border-left-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  font-weight: 600;
}
.qt-rt-dest-id { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.qt-rt-dest-reason {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--danger-strong, #b91c1c);
}
.qt-rt-dest.is-disabled {
  cursor: not-allowed;
  opacity: .6;
  background: transparent;
}
.qt-rt-dest.is-disabled:hover { background: transparent; }

.qt-rt-estimate { margin: 8px 0 0; font-size: 13px; color: var(--text-muted); min-height: 1em; }

/* Compact run summary */
.qt-rt-summary {
  margin: 4px 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-muted, rgba(0,0,0,.04));
  border: 1px solid var(--border);
  font-size: 14px;
}

/* Cost disclosure (external runs only) */
.qt-rt-cost {
  margin: 0 0 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
}
.qt-rt-cost.is-error {
  border-color: rgba(252, 129, 129, 0.5);
  background: rgba(252, 129, 129, 0.1);
}
.qt-rt-cost-notice { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.qt-rt-cost-lines { margin: 0; display: grid; gap: 4px; }
.qt-rt-cost-lines > div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.qt-rt-cost-lines dt { color: var(--text-muted); font-weight: 400; }
.qt-rt-cost-lines dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.qt-rt-cost-total {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 6px;
  font-size: 15px;
}
.qt-rt-cost-total dt, .qt-rt-cost-total dd { font-weight: 700 !important; }

.qt-rt-remember {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 4px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-muted);
}
.qt-rt-remember input { margin-top: 2px; }
.qt-rt-error {
  margin: 12px 0 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(252, 129, 129, 0.12);
  color: var(--danger-strong, #b91c1c);
  border: 1px solid rgba(252, 129, 129, 0.25);
  font-size: 13px;
}

/* ── responsive: one column on phones, comfortable spacing ──────────────── */
@media (max-width: 640px) {
  .qt-rt-box { max-width: 100%; max-height: 92vh; padding: 16px; }
  .qt-rt-cards { grid-template-columns: 1fr; }
  .qt-rt-card { min-height: 0; }
  .qt-rt-list { max-height: 42vh; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
}

/* ── settings: runner switches (Profile → Runner) ───────────────────────── */
/* "Run my scenarios and crawls from another country or region": the per-account
   switch, inline under the runner cards. The provider is never named in the UI
   — only the PLACE a run would come from. */
.rt-settings-row .rt-settings-label {
  margin-top: 4px;
}
.rt-settings-row .rt-settings-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}
.rt-settings-row .rt-settings-label:has(input:disabled) {
  opacity: 0.6;
  cursor: not-allowed;
}
.rt-settings-label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.rt-settings-label input { margin-top: 3px; }
.rt-settings-select {
  width: 100%;
  max-width: 420px;
  margin-top: 8px;
  padding: 0.6rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 16px;
}
