:root {
  --bg: #f7f2e8;
  --panel: #fffdf8;
  --text: #111111;
  --muted: #5b5b5b;
  --line: #d5c8b6;
  --brand: #0f7b6c;
  --brand-soft: #d8f3ef;
  --warn: #b94700;
  --error: #a52a2a;
  --ok: #1b7d2e;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 20%, #fef6de 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, #dff5f1 0%, transparent 35%),
    var(--bg);
  padding: 20px;
}

.bg-orb {
  position: fixed;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(36px);
  z-index: 0;
}

.orb-a {
  width: 240px;
  height: 240px;
  background: rgba(15, 123, 108, 0.2);
  top: -70px;
  right: -60px;
}

.orb-b {
  width: 180px;
  height: 180px;
  background: rgba(185, 71, 0, 0.17);
  bottom: -50px;
  left: -30px;
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 24px;
  animation: rise 0.35s ease-out;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--brand-soft);
  color: #085248;
  padding: 6px 10px;
  font-size: 0.83rem;
}

.header-controls {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.language-switcher-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.language-switcher-select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;

  overflow: hidden;
}

.actions-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  grid-column: 1 / -1;
}

.main-actions-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.action-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff9f981 0%, #faf0f075 100%);
}

.action-section-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.action-divider {
  height: 1px;
  background:
    linear-gradient(90deg, rgba(15, 123, 108, 0.18), rgba(213, 200, 182, 1), rgba(185, 71, 0, 0.18));
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-results-meta {
  font-size: 0.88rem;
  color: var(--muted);
}

.search-results-empty {
  margin: 0;
}

.search-result-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-summary-kv {
  margin-bottom: 0;
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.search-result-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(180deg, #fffdfa 0%, #f9f6ef 100%);
}

.search-result-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-result-link {
  color: var(--brand);
  font-size: 0.92rem;
  text-decoration: none;
  word-break: break-all;
}

.search-result-link:hover {
  text-decoration: underline;
}

.search-result-description {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.scan-start-card {
  display: flex;
  flex-direction: column;
}

/* --- Scan queue styles --- */
.scan-queue-file-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}
.scan-queue-file-row:last-child { border-bottom: none; }
.scan-queue-file-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.scan-queue-tasks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0;
}
.scan-queue-task-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f2e854;
}
.scan-queue-task-index { flex-shrink: 0; }
.scan-queue-task-info { flex: 1 1 auto; min-width: 0; }
.scan-queue-task-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}
.scan-queue-task-actions { flex-shrink: 0; align-self: center; }

.badge-ok  { background: #d4f7e8; color: #0a6640; border-color: #a0dcc0; }
.badge-err { background: #fde8e8; color: #8b1a1a; border-color: #f4b8b8; }
.badge-warn { background: #fff3cd; color: #7a5900; border-color: #f5d98a; }
.badge-run { background: #dbeafe; color: #1a4e8b; border-color: #93c5fd; }
.badge-pending { background: var(--bg); color: var(--muted); border-color: var(--line); }

.btn-xs {
  padding: 3px 8px;
  font-size: 0.8rem;
  border-radius: 6px;
}


.search-start-card {
  display: flex;
  flex-direction: column;
}

.scan-start-card .scan-bottom-meta {
  margin-top: auto;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 1.02rem;
}

.menu-buttons {
  display: flex;
  gap: 10px;
}

.menu-buttons-split > .btn {
  flex: 1 1 220px;
}

.actions-secondary-row .btn {
  white-space: normal;
  text-align: center;
  min-height: 48px;
}

.btn {
  border: 1px solid var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn.ghost {
  border-style: dashed;
}

.btn.danger {
  background: #ffe8e8;
  border-color: #de7c7c;
  color: #6f1111;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-compact {
  padding: 5px 8px;
  font-size: 0.82rem;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  text-align: center;
}

.kv {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  font-size: 0.94rem;
  margin-bottom: 30px;
}

.kv hr {
  grid-column: 1 / -1;
  width: 100%;
  margin: 8px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.kv .muted,
.muted {
  color: var(--muted);
}

.kv > strong {
  justify-self: end;
  width: fit-content;
  max-width: 100%;
}

.kv > span {
  justify-self: start;
  width: fit-content;
  max-width: 100%;
  white-space: nowrap;
}

.kv > strong:empty {
  width: 0;
  min-width: 0;
}

.job-id-cell {
  display: inline-block;
  max-width: min(100%, 180px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "IBM Plex Mono", monospace;
}

label {
  display: block;
  font-size: 0.9rem;
}

input[type="text"],
input[type="password"],
input[type="file"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
}

.form-row {
  margin-bottom: 12px;
}

.search-helper {
  margin-bottom: 14px;
  font-size: 0.88rem;
}

.mode-switch-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  background: #fff;
  font-size: 0.88rem;
}

.toggle-pill.active {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.queue-task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.queue-task-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  overflow: visible;
  min-width: 0;
}

.queue-task-row input[type="text"],
.queue-task-row input[type="number"],
.queue-task-row select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.queue-task-main-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.queue-full-row {
  width: 100%;
}

.queue-mini-toggle {
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  justify-content: flex-start;
  min-height: 36px;
  padding: 6px 10px;
  background: #fff;
}

.queue-task-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--muted);
}

.queue-task-summary span {
  border: 1px dashed var(--line);
  border-radius: 999px;
  padding: 4px 8px;
}

.queue-task-overrides {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.search-subtitle {
  margin: 10px 0 8px;
  font-size: 0.92rem;
}

.queue-inline-row {
  display: grid;
  grid-template-columns: auto 120px;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.queue-inline-row label {
  margin: 0;
}

.queue-inline-row input[type="number"] {
  width: 120px;
}

.queue-geo-city-row {
  margin-bottom: 0;
  align-items: stretch;
}

.queue-geo-toggle {
  min-height: 38px;
}

.queue-city-select-wrap {
  min-width: 0;
  flex: 1 1 auto;
}

.queue-city-select-wrap select,
.queue-city-select-wrap input[type="text"] {
  width: 100%;
  min-width: 0;
  height: 38px;
}

.queue-city-input-wrap {
  position: relative;
}

.queue-category-row {
  margin-bottom: 0;
}

.queue-category-wrap {
  width: 100%;
}

.queue-category-wrap .category-panel {
  max-height: 220px;
}

.queue-anti-dup-row {
  margin-bottom: 0;
}

.queue-downloads-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}

.queue-download-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.queue-download-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid #eee2d3;
  padding-bottom: 6px;
}

.queue-download-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.search-actions-row {
  margin-top: 10px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 0.92rem;
}

.toggle-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.geo-city-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 12px;
}

.geo-city-toggle {
  margin-bottom: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  white-space: nowrap;
}

.geo-city-input-wrap {
  position: relative;
  flex: 1 1 auto;
}

.geo-city-input-wrap input[type="text"] {
  height: 42px;
  margin: 0;
}

.city-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 330px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  z-index: 20;
}

.city-suggestions.hidden {
  display: none;
}

.city-suggestion-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #f0ece5;
  background: #fff;
  color: var(--text);
  text-align: left;
  padding: 9px 11px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.92rem;
}

.city-suggestion-item:last-child {
  border-bottom: 0;
}

.city-suggestion-item:hover,
.city-suggestion-item.active {
  background: #f7efe6;
}

.city-suggestion-empty {
  padding: 9px 11px;
  color: var(--muted);
  font-size: 0.9rem;
}

.category-dropdown-wrap {
  position: relative;
}

.category-toggle-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-toggle-btn {
  flex: 1 1 auto;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-clear-btn {
  flex: 0 0 auto;
  color: var(--muted);
  border-color: var(--line);
  min-width: 32px;
  min-height: 38px;
}

.category-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 425px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  z-index: 20;
}

.category-panel.hidden {
  display: none;
}

.category-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.92rem;
  border-bottom: 1px solid #f0ece5;
  margin-bottom: 0;
}

.category-check-row:last-child {
  border-bottom: 0;
}

.category-check-row:hover {
  background: #f7efe6;
}

.category-check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .geo-city-row {
    flex-direction: column;
  }
}

.file-input-shell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}

.file-picker-btn {
  margin: 0;
  white-space: nowrap;
}

.file-picker-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
}

.file-input-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  margin-bottom: 12px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #faf6ef;
  font-size: 0.86rem;
}

.scan-control-block {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff9f981 0%, #faf0f075 100%);
}

.scan-control-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.scan-control-head-stack {
  align-items: flex-start;
}

.slider-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 12px;
  align-items: center;
  padding: 0 4px;
}

.slider-input {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
}

.slider-input::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #eadfce 0%, #e4d2b8 100%);
}

.slider-input::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #eadfce 0%, #e4d2b8 100%);
}

.slider-input::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -5px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--brand);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.slider-input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--brand);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.slider-number {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
}

.slider-footnote {
  margin-top: 8px;
  font-size: 0.84rem;
}

.threshold-block {
  overflow: hidden;
}

.threshold-editor {
  display: grid;
  gap: 12px;
}

.threshold-stage {
  padding: 8px 4px 0;
}

.threshold-stage-inner {
  position: relative;
  min-height: 88px;
  padding: 28px 6px 0;
}

.threshold-track-base {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 52px;
  height: 8px;
  border-radius: 999px;
  background: #f1e4d2;
  border: 1px solid #dfcfb7;
}

.threshold-segment {
  position: absolute;
  top: 10px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  min-width: 36px;
  padding: 0 8px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1c1c1c;
}

.threshold-segment-c {
  background: rgba(234, 191, 112, 0.35);
}

.threshold-segment-b {
  background: rgba(15, 123, 108, 0.22);
}

.threshold-segment-a {
  background: rgba(185, 71, 0, 0.2);
}

.threshold-segment-label {
  white-space: nowrap;
}

.threshold-handle {
  position: absolute;
  top: 40px;
  z-index: 3;
  width: 24px;
  height: 24px;
  margin-left: -12px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  cursor: grab;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
}

.threshold-handle:active {
  cursor: grabbing;
}

.threshold-handle:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.threshold-handle-label {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(20, 20, 20, 0.9);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
}

.threshold-handle-b {
  background: #0f7b6c;
}

.threshold-handle-a {
  background: #b94700;
}

.threshold-controls-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.threshold-point-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
}

.threshold-point-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 700;
}

.threshold-point-tag-b {
  background: #0f7b6c;
}

.threshold-point-tag-a {
  background: #b94700;
}

.scan-settings-summary {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.scan-settings-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.scan-settings-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scan-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f6efe2;
  border: 1px solid #e0d1b9;
  font-size: 0.84rem;
}

.recent-job-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.running-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.running-task-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.running-task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.running-task-item .alert {
  flex: 1 1 auto;
  margin: 0;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.alert {
  margin: 10px 0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
}

.alert.info {
  background: #eaf7f5;
  color: #0b5f54;
  border: 1px solid #b5e5dc;
}

.running-indicator-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 999px;
  background: #79ceb8;
  box-shadow: 0 0 0 0 rgba(121, 206, 184, 0.45);
  vertical-align: middle;
  animation: running-indicator-pulse 1.6s ease-in-out infinite;
}

@keyframes running-indicator-pulse {
  0% {
    opacity: 0.35;
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(121, 206, 184, 0.4);
  }
  50% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 4px rgba(121, 206, 184, 0.12);
  }
  100% {
    opacity: 0.35;
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(121, 206, 184, 0);
  }
}

.alert.warn {
  background: #fff2e8;
  color: #7c3300;
  border: 1px solid #ffd2b8;
}

.alert.error {
  background: #ffecec;
  color: #7b1f1f;
  border: 1px solid #ffc0c0;
}

.progress-wrap {
  margin-top: 10px;
}

.progress-track {
  width: 100%;
  height: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: #faf6ef;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0f7b6c, #18a28f);
  transition: width 0.25s ease;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 0.88rem;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  text-align: left;
}

.table th:last-child,
.table td:last-child {
  text-align: right;
  font-family: "IBM Plex Mono", monospace;
}

.footer-links {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1f9d7d;
  margin-right: 6px;
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0% { opacity: 0.25; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 0.25; transform: scale(0.92); }
}

.reset-view-more {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.reset-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 20, 24, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.reset-modal-overlay-enter {
  animation: rise 0.2s ease-out;
}

.reset-modal {
  width: min(90vw, 900px);
  height: 85vh;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.reset-modal-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.reset-modal-body {
  flex: 1;
  overflow: auto;
  padding: 0 10px 10px;
}

.anti-dup-split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr);
  gap: 12px;
  overflow: hidden;
}

.anti-dup-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-top: 0;
  /* border-radius: 12px; */
  /* background: linear-gradient(180deg, #fffdfa 0%, #f8f3ea 100%); */
  padding: 12px;
}

.anti-dup-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.anti-dup-pane-body {
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.anti-dup-filter-row {
  margin-bottom: 10px;
}

.keyword-links-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.scan-results-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.scan-results-summary-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.scan-results-summary-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.scan-results-summary-copy p {
  margin: 0;
}

.scan-results-summary-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.keyword-links-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fffafa3d 0%, #f6e5e563 100%);
  padding: 12px;
}

.keyword-links-card-head {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 34px;
  padding: 6px;
}

.icon-trash {
  display: inline-flex;
  width: 16px;
  height: 16px;
}

.icon-trash svg {
  width: 100%;
  height: 100%;
}

.scan-result-card {
  gap: 10px;
  background: linear-gradient(180deg, #fffafa3d 0%, #f6e5e563 100%);
  padding: 10px;
}

.scan-result-card-head {
  align-items: flex-start;
  gap: 6px;
}

.scan-result-card-date-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.scan-result-age {
  white-space: nowrap;
}

.scan-result-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.keyword-links-card-title {
  min-width: 0;
  word-break: break-word;
}

.keyword-links-card-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eaf7f5;
  color: #0b5f54;
  border: 1px solid #b5e5dc;
  font-size: 0.78rem;
  white-space: nowrap;
}

.keyword-links-card-badge-blacklisted {
  background: #fff2e8;
  color: #7c3300;
  border-color: #ffd2b8;
}

.keyword-links-card-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.keyword-links-card-action {
  flex: 1;
}

.modal-file-path {
  margin: 10px 0 12px;
  word-break: break-all;
}

.anti-dup-table th,
.anti-dup-table td {
  text-align: left;
  vertical-align: top;
}

.anti-dup-action-cell {
  width: 1%;
  white-space: nowrap;
}

.anti-dup-link-cell {
  word-break: break-all;
}

.modal-loading-more {
  margin: 12px 0 4px;
  text-align: center;
}

.reset-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.reset-table th,
.reset-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 20px;
  /* text-align: left; */
}

.reset-table th:nth-child(2),
.reset-table td:nth-child(2),
.reset-table th:nth-child(3),
.reset-table td:nth-child(3) {
  font-family: "IBM Plex Mono", monospace;
}

@media (max-width: 840px) {
  .app-shell {
    max-width: 640px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .anti-dup-split-layout {
    grid-template-columns: 1fr;
  }

  .keyword-links-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  body {
    padding: 10px;
  }

  .header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-controls {
    width: 100%;
    justify-content: space-between;
  }

  .slider-inline {
    grid-template-columns: 1fr;
  }

  .file-input-shell {
    align-items: flex-start;
    flex-direction: column;
  }

  .threshold-controls-grid {
    grid-template-columns: 1fr;
  }

  .search-results-list {
    max-height: none;
  }

  .queue-task-row {
    padding: 8px;
  }

  .queue-inline-row {
    grid-template-columns: 1fr;
  }

  .queue-inline-row input[type="number"] {
    width: 100%;
  }

  .queue-geo-city-row {
    flex-direction: column;
  }

  .queue-download-row {
    grid-template-columns: 1fr;
  }

  .scan-control-head,
  .scan-settings-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .reset-modal {
    width: 94vw;
    height: 78vh;
  }

  .app-shell {
    border-radius: 12px;
    padding: 14px;
  }

  .title {
    font-size: 1.3rem;
  }
}

/* -- Warmup ----------------------------------------------- */
.warmup-account-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.warmup-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #faf6ef;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.84rem;
}

.btn-chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  padding: 0 2px;
  font-size: 0.8rem;
  line-height: 1;
}

.btn-chip-remove:hover {
  color: #c00;
}
