/* We Outreach Tools — design system.
   Plus Jakarta Sans · Outreach Orange reserved for ONE action per surface ·
   restraint over decoration. Synthesized from the design-research pass. */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/fonts/plus-jakarta-sans.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --orange: #f04f3b;
  --orange-hover: #d94535;
  --orange-tint: #fff5f3;
  --slate: #1f2430;
  --slate-strong: #14181f;
  --storm: #545e75;
  --bg: #ffffff;
  --bg-app: #fafafa;
  --line: #e7e9ee;
  --line-soft: #f0f1f4;
  --grey-300: #d4d8e0;
  --grey-400: #9aa2b1;
  --green: #16a34a;
  --green-bg: #ecfdf3;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --amber: #d97706;
  --radius: 10px;
  --radius-sm: 8px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  color: var(--slate);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.45;
}

h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.02em; color: var(--slate-strong); }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--storm); }

/* ── Buttons ──────────────────────────────────────────────── */
button { font-family: inherit; cursor: pointer; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border: none; border-radius: var(--radius-sm);
  background: var(--orange); color: #fff; font-size: 14px; font-weight: 600;
  transition: background 90ms ease, transform 90ms ease;
}
.btn-primary:hover { background: var(--orange-hover); }
.btn-primary:active { transform: scale(0.975); }
.btn-primary:disabled { background: #eceef2; color: var(--grey-400); cursor: not-allowed; transform: none; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 14px; border: 1px solid var(--grey-300); border-radius: 7px;
  background: var(--bg); color: var(--storm); font-size: 13px; font-weight: 500;
  transition: border-color 100ms ease, color 100ms ease, background 100ms ease, transform 90ms ease;
}
.btn-ghost:hover { border-color: var(--grey-400); color: var(--slate-strong); background: #fcfcfd; }
.btn-ghost:active { transform: scale(0.98); }
.btn-ghost svg { width: 15px; height: 15px; }
.btn-ghost.spinning svg { animation: spin 0.8s linear infinite; }

:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 4px; }

/* ── App shell ────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }

.sidebar {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--bg); border-right: 1px solid var(--line); padding: 20px 14px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.brand img { border-radius: 7px; }
.brand span { font-weight: 800; font-size: 15px; letter-spacing: -0.01em; color: var(--slate-strong); }

.sidebar nav { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.navitem {
  display: flex; align-items: center; gap: 11px;
  padding: 0 12px; height: 42px; border-radius: 8px;
  color: var(--storm); font-size: 14px; font-weight: 500;
  border-left: 2px solid transparent;
  transition: background 100ms ease, color 100ms ease;
}
.navitem svg { width: 18px; height: 18px; flex: none; }
.navitem:hover { background: var(--line-soft); color: var(--slate-strong); }
.navitem.active { background: var(--orange-tint); color: var(--orange); font-weight: 600; border-left-color: var(--orange); border-radius: 0 8px 8px 0; }
.navitem.logout { margin-top: auto; color: var(--grey-400); }
.navitem.logout:hover { color: var(--slate-strong); background: var(--line-soft); }

.content { background: var(--bg-app); padding: 36px 44px; min-width: 0; }
.page-head { max-width: 1000px; margin: 0 auto 24px; }
.page-head h1 { font-size: 22px; }

/* ── Cards ────────────────────────────────────────────────── */
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
.page-col { max-width: 1000px; margin: 0 auto; }
.input-card { max-width: 1000px; margin: 0 auto; }
.status-card { max-width: 620px; }

/* ── Dashboard ────────────────────────────────────────────── */
.status-card { padding: 26px 28px; }
.status-head { display: flex; align-items: center; justify-content: space-between; }
.status-title { display: flex; align-items: center; gap: 10px; }
.status-title h2 { font-size: 15px; font-weight: 700; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.ok { background: var(--green); box-shadow: 0 0 0 3px rgba(22,163,74,0.14); }
.dot.bad { background: var(--red); box-shadow: 0 0 0 3px rgba(220,38,38,0.14); }
.dot.checking { background: var(--grey-400); }
.status-state { margin: 14px 0 18px; font-size: 14px; font-weight: 600; }
.status-state.ok { color: var(--green); }
.status-state.bad { color: var(--red); }
.status-state.checking { color: var(--storm); }
.status-hint { color: var(--storm); font-size: 13px; margin: 4px 0 0; }

.kv-list { display: flex; flex-direction: column; gap: 16px; }
.kv { display: grid; grid-template-columns: 120px 1fr; align-items: baseline; gap: 16px; }
.kv > span { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--storm); }
.kv > strong { font-size: 15px; font-weight: 500; color: var(--slate-strong); }
.kv .err { color: var(--red); font-weight: 600; }
.kv.units strong { display: block; }
.kv.units .warn { font-style: normal; font-weight: 600; font-size: 12px; color: var(--amber); margin-left: 8px; }
.meter { margin-top: 8px; height: 6px; background: #e4e6ec; border-radius: 3px; overflow: hidden; max-width: 320px; }
.meter i { display: block; height: 100%; min-width: 6px; background: var(--green); border-radius: 3px; transition: width 400ms var(--ease); }
.meter i.warn { background: var(--amber); }

/* ── Tabs ─────────────────────────────────────────────────── */
.page-head .tabs { position: relative; display: flex; gap: 24px; margin-top: 18px; border-bottom: 1px solid var(--line); }
.tab {
  position: relative; background: none; border: none; padding: 0 0 12px;
  font-size: 14px; font-weight: 500; color: var(--storm);
  transition: color 120ms ease;
}
.tab:hover { color: var(--slate-strong); }
.tab.active { color: var(--slate-strong); font-weight: 700; }
.tab.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--orange); border-radius: 2px 2px 0 0;
}
.tabpane { max-width: 1000px; margin: 0 auto; }

/* ── Run input ────────────────────────────────────────────── */
.input-card { padding: 26px 28px; }
.field-label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--storm); }
.field-hint { margin: 6px 0 14px; font-size: 13px; color: var(--storm); }
textarea {
  width: 100%; min-height: 150px; resize: vertical; padding: 14px;
  border: 1.5px solid var(--grey-300); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; line-height: 1.6; color: var(--slate-strong);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
textarea::placeholder { color: var(--grey-400); }
textarea:focus { outline: none; border-color: var(--grey-400); box-shadow: 0 0 0 3px rgba(240,79,59,0.10); }
.input-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; gap: 16px; }
.input-actions #parse-note { font-size: 13px; }
.run-group { display: flex; align-items: center; gap: 14px; }
.kbd-hint { font-size: 12px; color: var(--grey-400); }

/* ── Results / history shell ──────────────────────────────── */
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.results-actions { display: flex; gap: 10px; }
#results-summary { font-size: 14px; font-weight: 500; }
#results-summary .done { color: var(--green); font-weight: 600; }
.search {
  width: 320px; max-width: 60%; height: 38px; padding: 0 14px;
  border: 1.5px solid var(--grey-300); border-radius: 7px;
  font-family: inherit; font-size: 13px; color: var(--slate-strong);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.search:focus { outline: none; border-color: var(--grey-400); box-shadow: 0 0 0 3px rgba(240,79,59,0.10); }

/* ── Table ────────────────────────────────────────────────── */
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; background: var(--bg); }
.results-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.results-table thead th {
  position: sticky; top: 0; background: var(--bg); z-index: 2;
  text-align: left; padding: 12px 16px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--storm);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.results-table th[title] { cursor: help; }
.results-table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); font-size: 14px; vertical-align: middle; }
.results-table tbody tr:last-child td { border-bottom: none; }
.results-table tbody tr { transition: background 80ms ease; }
.results-table tbody tr:hover { background: #fcfcfd; }
.col-num { text-align: center; }
.results-table td.col-num { text-align: center; }
.col-verdict { width: 104px; }
.col-num { width: 150px; }
.col-source { width: 88px; }
.col-date { width: 112px; white-space: nowrap; }
.col-act { width: 116px; white-space: nowrap; }

.cell-domain { font-weight: 500; color: var(--slate-strong); }
.cell-domain a:hover { color: var(--orange); text-decoration: underline; }
.ic { display: inline-flex; align-items: center; justify-content: center; }
.ic svg { width: 17px; height: 17px; }
.ic.ok { color: var(--green); }
.ic.bad { color: var(--red); }
.cell-skip { color: var(--grey-400); }
.cell-date { color: var(--storm); font-size: 13px; }

/* verdict badge */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.badge svg { width: 13px; height: 13px; }
.badge.pass { background: var(--green-bg); color: var(--green); }
.badge.fail { background: var(--red-bg); color: var(--red); }
.badge.error { background: var(--line-soft); color: var(--storm); }
.badge.snap { animation: snap 200ms cubic-bezier(0.34, 1.56, 0.64, 1); }

/* source label — neutral by default (one-orange-accent rule); Live is the only
   tinted state because it means "we just spent units fetching this fresh". */
.src { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.src.wo_db { color: var(--storm); }
.src.history { color: var(--grey-400); }
.src.live { color: var(--green); }

/* re-run live link */
.rerun { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--storm); white-space: nowrap; }
.rerun svg { width: 13px; height: 13px; flex: none; }
.rerun:hover { color: var(--slate-strong); text-decoration: underline; cursor: pointer; }
.rerun.spinning svg { animation: spin 0.8s linear infinite; }

/* spinner + skeleton */
.spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid var(--line); border-top-color: var(--storm); border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: -2px; }
.skeleton { display: inline-block; height: 13px; width: 64px; border-radius: 3px; background: linear-gradient(90deg, #eceef2 25%, #f6f7f9 50%, #eceef2 75%); background-size: 800px 100%; animation: shimmer 1.4s ease-in-out infinite; }
.skeleton-icon { width: 18px; height: 16px; border-radius: 4px; }
.resolved { animation: resolve 150ms var(--ease); }

.legend { max-width: 1000px; margin: 18px auto 0; font-size: 13px; color: var(--storm); }
.empty { text-align: center; padding: 56px 20px; color: var(--storm); }
.empty svg { width: 30px; height: 30px; color: var(--grey-300); margin-bottom: 12px; }
.empty p { margin: 4px 0; }
.empty .t { font-weight: 600; color: var(--slate-strong); font-size: 15px; }

.banner { max-width: 1000px; margin: 0 auto 16px; padding: 12px 16px; border-radius: 8px; font-size: 13px; border-left: 3px solid; }
.banner.error { background: var(--red-bg); border-color: var(--red); color: #991b1b; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
@keyframes snap { 0% { opacity: 0; transform: scale(0.85); } 60% { transform: scale(1.04); } 100% { opacity: 1; transform: scale(1); } }
@keyframes resolve { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::after { animation: none !important; transition: none !important; }
}

/* ── Login ────────────────────────────────────────────────── */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg-app); }
.login-card {
  display: flex; flex-direction: column; width: 380px; padding: 36px 36px 32px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 1px 3px rgba(20,24,31,0.05), 0 8px 30px rgba(20,24,31,0.06);
}
.login-logo { align-self: flex-start; border-radius: 9px; margin-bottom: 16px; }
.login-card h1 { font-size: 20px; }
.login-card .sub { margin: 6px 0 22px; color: var(--storm); font-size: 13px; }
.login-card label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--storm); margin-bottom: 18px; }
.login-card input {
  height: 44px; padding: 0 14px; border: 1.5px solid var(--grey-300); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; color: var(--slate-strong); text-transform: none; letter-spacing: 0;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.login-card input:focus { outline: none; border-color: var(--grey-400); box-shadow: 0 0 0 3px rgba(240,79,59,0.10); }
.login-card .btn-primary { width: 100%; }
.notice { margin: 0 0 18px; padding: 10px 14px; border-radius: 8px; font-size: 13px; background: var(--line-soft); color: var(--storm); }
.notice.error { background: var(--red-bg); color: var(--red); }

/* ── Link Insertion Finder ──────────────────────────────────────────────── */
.lf-input { width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:var(--radius-sm); font:inherit; color:var(--slate); }
#lf-prospects { width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:var(--radius-sm); font:inherit; line-height:1.6; resize:vertical; min-height:130px; }
.lf-chk { display:inline-flex; align-items:center; gap:6px; font-size:14px; color:var(--slate); }
.lf-pills { font-size:13px; color:var(--storm); }
.lf-pills b { color:var(--storm); font-weight:600; }
.lf-pills span { display:inline-block; background:var(--line-soft); border:1px solid var(--line); border-radius:999px; padding:2px 9px; margin:2px 4px 2px 0; }
.lf-meta { font-size:12px; }
.lf-prow { border:1px solid var(--line); border-radius:var(--radius); margin-bottom:10px; background:var(--bg); overflow:hidden; }
.lf-prow > summary { list-style:none; cursor:pointer; display:flex; align-items:center; gap:12px; padding:13px 16px; font-size:15px; }
.lf-prow > summary::-webkit-details-marker { display:none; }
.lf-prow > summary::before { content:"▸"; color:var(--grey-400); font-size:12px; transition:transform .15s var(--ease); }
.lf-prow[open] > summary::before { transform:rotate(90deg); }
.lf-name { font-weight:600; flex:1; word-break:break-all; }
.lf-count { font-size:13px; font-weight:600; white-space:nowrap; }
.lf-count .g { color:var(--green); } .lf-count .d { color:var(--amber); }
.lf-err { color:var(--red); font-weight:700; font-size:13px; }
.lf-prow.err { background:var(--red-bg); border-color:#fecaca; }
.lf-body { padding:4px 16px 16px; border-top:1px solid var(--line); }
.lf-errmsg { color:var(--red); font-size:13px; padding:12px 0; }
.lf-banner { padding:10px 14px; border-radius:var(--radius-sm); font-size:14px; font-weight:600; }
.lf-banner.err { background:var(--red-bg); color:var(--red); }
.lf-sec { font-size:13px; font-weight:700; margin:14px 0 2px; display:flex; align-items:center; gap:7px; }
.lf-dot { width:9px; height:9px; border-radius:50%; display:inline-block; }
.lf-dot.g { background:var(--green); } .lf-dot.d { background:var(--amber); }
.lf-table { width:100%; border-collapse:collapse; font-size:14px; }
.lf-table th { text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:var(--storm); padding:6px 10px; border-bottom:1px solid var(--line); }
.lf-table td { padding:10px; border-bottom:1px solid var(--line-soft); vertical-align:top; }
.lf-table tr.great { background:var(--green-bg); }
.lf-table tr.decent { background:#fffbeb; }
.lf-ttl { font-weight:600; }
.lf-why { color:var(--storm); font-size:12px; margin-top:3px; }
.lf-url a { color:#2563eb; text-decoration:none; word-break:break-all; font-size:12px; }
.lf-grade { font-weight:700; white-space:nowrap; }
.lf-table tr.great .lf-grade { color:var(--green); }
.lf-table tr.decent .lf-grade { color:var(--amber); }
.lf-band { font-weight:500; font-size:11px; text-transform:capitalize; }
.lf-pending { display:flex; align-items:center; gap:12px; padding:13px 16px; font-size:15px; }
.lf-pending .lf-name { flex:1; }
