/* ============================================================
   Find Backlinks — page styles (depends on styles.css tokens)
   ============================================================ */

/* head-nav / head-pill-link / head-pill-active live in styles.css */

/* ---------- finder grid ---------- */
.finder-console {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.finder-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

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

.panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-accent {
  border-color: rgba(255, 178, 36, 0.35);
  background:
    linear-gradient(180deg, rgba(255, 178, 36, 0.06), transparent 50%),
    var(--bg-2);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 178, 36, 0.12);
  border: 1px solid rgba(255, 178, 36, 0.3);
  color: var(--accent);
  font-size: 0.85rem;
  flex: 0 0 auto;
}

.panel-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.panel-desc {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
}

.panel-desc code {
  font-family: var(--mono);
  font-size: 0.8em;
  color: var(--accent);
  background: rgba(255, 178, 36, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ---------- fields ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder { color: var(--muted); }

.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--line-2); }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

.field select {
  font-family: var(--font);
  cursor: pointer;
}

/* ---------- buttons ---------- */
.btn {
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 11px 16px;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s ease, filter 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:active { transform: translateY(1px) scale(0.99); }

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

.btn-primary {
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 22px rgba(255, 178, 36, 0.2);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); }

.btn-ghost {
  color: var(--ink);
  background: var(--card);
  border-color: var(--line-2);
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-block { width: 100%; }

.btn-sm {
  font-size: 0.8rem;
  padding: 7px 12px;
}

.btn-row {
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 0.78rem;
  padding: 7px 11px;
}
.btn-row:hover:not(:disabled) { filter: brightness(1.06); }

.btn-quiet {
  color: var(--ink-2);
  background: transparent;
  border-color: var(--line);
  font-size: 0.78rem;
  padding: 7px 10px;
}
.btn-quiet:hover:not(:disabled) {
  color: var(--accent);
  border-color: var(--accent);
}

.create-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

/* ---------- status line ---------- */
.search-status {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ink-2);
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-s);
  min-height: 1.4em;
}

.search-status.is-busy {
  color: var(--accent);
  border-color: rgba(255, 178, 36, 0.4);
}

.search-status.is-ok {
  color: var(--ok);
  border-color: rgba(61, 220, 151, 0.35);
}

.search-status.is-err {
  color: var(--bad);
  border-color: rgba(255, 107, 107, 0.4);
}

/* ---------- bulk bar ---------- */
.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
}

.bulk-bar .check-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 0.88rem;
  color: var(--ink-2);
}

.bulk-bar .check-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.bulk-count {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
}

.bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

/* ---------- table ---------- */
.table-wrap {
  position: relative;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--bg-2);
  min-height: 120px;
}

.opp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.opp-table th {
  text-align: left;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: var(--card);
  white-space: nowrap;
}

.opp-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.opp-table tbody tr {
  animation: row-in 0.25s ease both;
  transition: background 0.15s ease;
}

.opp-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

.opp-table tbody tr:last-child td { border-bottom: none; }

.col-check { width: 36px; }

.opp-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.opp-url {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-2);
  text-decoration: none;
  word-break: break-all;
  max-width: 340px;
  display: inline-block;
  transition: color 0.15s ease;
}
.opp-url:hover { color: var(--accent); }

.opp-title {
  display: block;
  font-family: var(--font);
  font-size: 0.84rem;
  color: var(--ink);
  margin-bottom: 3px;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  background: var(--card);
  white-space: nowrap;
}

.badge-directory {
  color: #7dd3fc;
  border-color: rgba(125, 211, 252, 0.35);
  background: rgba(125, 211, 252, 0.08);
}
.badge-guest {
  color: var(--accent);
  border-color: rgba(255, 178, 36, 0.35);
  background: rgba(255, 178, 36, 0.08);
}
.badge-forum {
  color: #c4b5fd;
  border-color: rgba(196, 181, 253, 0.35);
  background: rgba(196, 181, 253, 0.08);
}
.badge-resource {
  color: var(--ok);
  border-color: rgba(61, 220, 151, 0.35);
  background: rgba(61, 220, 151, 0.08);
}
.badge-list {
  color: #f9a8d4;
  border-color: rgba(249, 168, 212, 0.35);
  background: rgba(249, 168, 212, 0.08);
}
.badge-news {
  color: #fcd34d;
  border-color: rgba(252, 211, 77, 0.35);
  background: rgba(252, 211, 77, 0.08);
}
.badge-submit {
  color: var(--ok);
  border-color: rgba(61, 220, 151, 0.4);
  background: rgba(61, 220, 151, 0.1);
}
.badge-other {
  color: var(--muted);
}

.opp-cat-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.src-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: lowercase;
}

.query-cell {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.table-empty {
  display: none;
  padding: 36px 18px;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.84rem;
  color: var(--muted);
}

.table-wrap.is-empty .table-empty { display: block; }
.table-wrap.is-empty .opp-table { display: none; }

/* ---------- create progress ---------- */
.create-progress {
  color: var(--muted);
}

.create-progress .progress-track {
  height: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

#createProgressBar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  background-size: 200% 100%;
  transition: width 0.35s ease;
  animation: progress-shimmer 1.6s linear infinite;
}

#createProgressText {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- how-to ---------- */
.howto {
  margin: 0 0 clamp(48px, 8vw, 88px);
  padding: clamp(22px, 3vw, 32px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
}

.howto-title {
  margin: 0 0 18px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.howto-steps {
  margin: 0;
  padding-left: 1.3em;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--ink-2);
  font-size: 0.95rem;
}

.howto-steps strong { color: var(--ink); }

.howto-steps code {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--accent);
  background: rgba(255, 178, 36, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
}

.howto-note {
  margin: 18px 0 0;
  padding: 12px 14px;
  font-size: 0.86rem;
  color: var(--muted);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
}

.howto-note strong { color: var(--ink-2); }

/* ---------- flags / score ---------- */
.flag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.flag {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--muted);
}

.flag-created {
  color: var(--ok);
  border-color: rgba(61, 220, 151, 0.4);
  background: rgba(61, 220, 151, 0.1);
}

.flag-visited {
  color: #7dd3fc;
  border-color: rgba(125, 211, 252, 0.35);
  background: rgba(125, 211, 252, 0.08);
}

.flag-note {
  color: var(--accent);
  border-color: rgba(255, 178, 36, 0.35);
  background: rgba(255, 178, 36, 0.08);
}

.score-chip {
  display: inline-block;
  margin-left: 6px;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(255, 178, 36, 0.1);
  border: 1px solid rgba(255, 178, 36, 0.25);
  padding: 2px 6px;
  border-radius: 6px;
  vertical-align: middle;
}

/* ---------- helper ---------- */
.helper-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-2);
}

.helper-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.helper-head strong {
  font-size: 0.88rem;
  color: var(--ink);
}

.helper-panel {
  margin-top: 10px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.helper-checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.helper-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}

.helper-checks input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.helper-status {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
}

.btn-ghost.is-on,
.btn.is-on {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 178, 36, 0.08);
}

/* ---------- a11y ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .bulk-actions { margin-left: 0; width: 100%; }
  .create-actions { grid-template-columns: 1fr; }
  .opp-url, .opp-title { max-width: 200px; }
  .query-cell { display: none; }
}

/* ---------- reduced motion inherits styles.css ---------- */
