/* LoomVector Lead Finder. Mirrors the LoomVector site system (assets/css/site.css):
   Light = editorial limestone + copper, Dark = atelier charcoal + champagne.
   Fonts are self-hosted (same files as the WordPress theme): no third-party requests. */

@font-face { font-family: 'Clash Display'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/clash-display-500.woff2') format('woff2'); }
@font-face { font-family: 'Clash Display'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/clash-display-600.woff2') format('woff2'); }
@font-face { font-family: 'Clash Display'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/clash-display-700.woff2') format('woff2'); }
@font-face { font-family: 'Satoshi'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/satoshi-400.woff2') format('woff2'); }
@font-face { font-family: 'Satoshi'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/satoshi-500.woff2') format('woff2'); }
@font-face { font-family: 'Satoshi'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/satoshi-700.woff2') format('woff2'); }
@font-face { font-family: 'Boska'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/boska-400.woff2') format('woff2'); }
@font-face { font-family: 'Boska'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/boska-500.woff2') format('woff2'); }
@font-face { font-family: 'Boska'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/boska-700.woff2') format('woff2'); }
@font-face { font-family: 'Switzer'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/switzer-400.woff2') format('woff2'); }
@font-face { font-family: 'Switzer'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/switzer-500.woff2') format('woff2'); }
@font-face { font-family: 'Switzer'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/switzer-600.woff2') format('woff2'); }

:root {
  color-scheme: light;
  --paper: #E8E2D6;
  --paper-2: #F4EFE6;
  --paper-3: #DDD6C8;
  --ink: #161310;
  --ink-2: #3F3932;
  --mute: #6E665B;
  --line: rgba(22, 19, 16, 0.12);
  --line-strong: rgba(22, 19, 16, 0.22);
  --accent: #B85C38;
  --accent-2: #8C3E22;
  --accent-soft: #E4C4B0;
  --thread-b: #1F4D4A;
  --stop: #9B2C1F;
  --fill: var(--ink);            /* primary control fill */
  --on-fill: var(--paper);
  --shadow: 0 24px 60px rgba(22, 19, 16, 0.08);
  --font-display: "Clash Display", "Syne", ui-sans-serif, sans-serif;
  --font-body: "Satoshi", "Switzer", "DM Sans", system-ui, sans-serif;
  --max: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0C0B0A; --paper-2: #151311; --paper-3: #1C1916;
    --ink: #F4EEE4; --ink-2: #C9C0B3; --mute: #8A8176;
    --line: rgba(244, 238, 228, 0.1); --line-strong: rgba(244, 238, 228, 0.16);
    --accent: #C9A87C; --accent-2: #E4D0A8; --accent-soft: #3A2E20;
    --thread-b: #6FA8A4; --stop: #E6968A;
    --fill: var(--accent); --on-fill: #0C0B0A;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    --font-display: "Boska", "Fraunces", Georgia, serif;
    --font-body: "Switzer", "Satoshi", "DM Sans", system-ui, sans-serif;
  }
}
html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0C0B0A; --paper-2: #151311; --paper-3: #1C1916;
  --ink: #F4EEE4; --ink-2: #C9C0B3; --mute: #8A8176;
  --line: rgba(244, 238, 228, 0.1); --line-strong: rgba(244, 238, 228, 0.16);
  --accent: #C9A87C; --accent-2: #E4D0A8; --accent-soft: #3A2E20;
  --thread-b: #6FA8A4; --stop: #E6968A;
  --fill: var(--accent); --on-fill: #0C0B0A;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --font-display: "Boska", "Fraunces", Georgia, serif;
  --font-body: "Switzer", "Satoshi", "DM Sans", system-ui, sans-serif;
}
html[data-theme="light"] { color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; margin: 0; }
h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); margin-bottom: 20px; }
h2 { font-size: 1.25rem; margin-bottom: 14px; letter-spacing: -0.01em; word-spacing: 0.08em; }
.sub { color: var(--mute); font-size: 0.88rem; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Paper grain, same texture as the marketing site */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.55'/></svg>");
}
html[data-theme="dark"] .grain { opacity: 0.07; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .grain { opacity: 0.07; } }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 80; background: var(--ink); color: var(--paper); padding: 8px 12px; }

.wrap { width: min(var(--max), calc(100% - var(--gutter) * 2)); margin-inline: auto; }
main.wrap { padding-top: 28px; padding-bottom: 72px; }

/* Header: same construction as the site header */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 8px; height: var(--header-h); }
.brand {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; font-size: 1.08rem;
  margin-right: auto; white-space: nowrap;
}
.brand svg { width: 22px; height: 22px; flex-shrink: 0; }
.brand .loom { stroke: var(--ink); }
.brand .weft { stroke: var(--accent); }
.brand .warp { stroke: var(--thread-b); }
.brand em { font-style: normal; color: var(--mute); font-weight: 500; font-family: var(--font-body); font-size: 0.86rem; letter-spacing: 0.02em; margin-left: 2px; }
.nav-links { display: flex; align-items: center; gap: 4px; font-size: 0.92rem; color: var(--ink-2); }
.nav-links a { padding: 8px 12px; position: relative; text-decoration: none; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"]::after, .nav-links a:hover::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 1px; background: var(--accent);
}
.nav-tools { display: flex; align-items: center; gap: 10px; margin-left: 12px; }
.theme-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line-strong); color: var(--ink); }
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }
.theme-btn .sun { display: none; }
.theme-btn .moon { display: block; }
html[data-theme="dark"] .theme-btn .sun { display: block; }
html[data-theme="dark"] .theme-btn .moon { display: none; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .theme-btn .sun { display: block; }
  html:not([data-theme="light"]) .theme-btn .moon { display: none; }
}
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--accent); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 12px; font-size: 0.74rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--accent-2); font-weight: 500; margin-bottom: 14px;
}
.eyebrow i { width: 28px; height: 1px; background: var(--accent); display: inline-block; }

/* Buttons: ink fill (light) / champagne fill (dark), square corners, as on the site */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 44px; padding: 0 18px;
  background: var(--fill); color: var(--on-fill); border: 1px solid var(--fill);
  font-size: 0.88rem; font-weight: 500; letter-spacing: 0.01em; text-decoration: none; cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s var(--ease);
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); transform: translateY(-1px); }
html[data-theme="dark"] .btn:hover { background: var(--accent-2); border-color: var(--accent-2); color: #0C0B0A; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .btn:hover { background: var(--accent-2); border-color: var(--accent-2); color: #0C0B0A; } }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn.small { height: 32px; padding: 0 12px; font-size: 0.8rem; }
.btn.ghost, .btn.danger { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.danger { color: var(--stop); }
.btn.danger:hover { background: var(--stop); border-color: var(--stop); color: var(--paper); }
.btn.logout { height: 40px; }

/* Cards */
.card { background: var(--paper-2); border: 1px solid var(--line-strong); padding: 24px; margin: 0 0 20px; }
.card.narrow { max-width: 420px; margin: 10vh auto 0; }
.card.flush { padding: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.card-head h1, .card-head h2 { margin-bottom: 12px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem; color: var(--ink-2); margin-bottom: 14px; letter-spacing: 0.01em; }
input, select { background: var(--paper); border: 1px solid var(--line-strong); padding: 9px 12px; min-height: 44px; max-width: 100%; border-radius: 0; }
input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 1px var(--accent); }
input[type="number"] { width: 92px; }
input[type="checkbox"] { min-height: 0; accent-color: var(--accent); }
.add-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; margin-top: 18px; }
.add-row .field { margin-bottom: 0; }
form.inline { display: inline-flex; gap: 8px; align-items: center; }
.filters { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
fieldset { border: 0; padding: 0; margin: 0 0 20px; }
legend { font-size: 0.74rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent-2); font-weight: 500; margin-bottom: 12px; padding: 0; }
legend .link { letter-spacing: 0.04em; text-transform: none; font-size: 0.82rem; margin-left: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-block; padding: 8px 14px; border: 1px solid var(--line-strong); cursor: pointer; user-select: none; font-size: 0.9rem; transition: background 0.2s, border-color 0.2s, color 0.2s; }
.chip span:hover { border-color: var(--accent); }
.chip input:checked + span { background: var(--fill); border-color: var(--fill); color: var(--on-fill); font-weight: 500; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.run-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: space-between; margin-top: 10px; }
.check { display: flex; gap: 8px; align-items: center; }

/* Meter */
.meter-row { display: grid; grid-template-columns: 96px 1fr 96px; gap: 14px; align-items: center; margin-bottom: 10px; font-size: 0.9rem; }
.meter-row .num { text-align: right; }
progress { width: 100%; height: 6px; appearance: none; border: 0; background: var(--line-strong); }
progress::-webkit-progress-bar { background: var(--line-strong); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }
.pill { padding: 4px 12px; font-size: 0.74rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; border: 1px solid currentColor; }
.pill.ok { color: var(--thread-b); background: color-mix(in srgb, var(--thread-b) 12%, transparent); }
.pill.stop { color: var(--stop); background: color-mix(in srgb, var(--stop) 10%, transparent); }

.flash { padding: 12px 16px; margin: 0 0 20px; border: 1px solid var(--line-strong); background: var(--paper-2); border-left: 3px solid var(--accent); }
.flash.ok { border-left-color: var(--thread-b); }
.flash.error { border-left-color: var(--stop); color: var(--stop); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--mute); font-weight: 500; white-space: nowrap; }
table.leads .col-biz { min-width: 210px; max-width: 300px; }
table.leads .col-pitch { min-width: 220px; color: var(--ink-2); }
tbody tr:hover td { background: color-mix(in srgb, var(--accent) 5%, transparent); }
td.empty { text-align: center; color: var(--mute); padding: 40px; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.badge { display: inline-block; padding: 2px 10px; font-size: 0.72rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid var(--line-strong); white-space: nowrap; }
.b-c { color: var(--stop); border-color: var(--stop); }
.b-b { color: var(--accent-2); border-color: var(--accent); }
.b-a { color: var(--thread-b); border-color: var(--thread-b); }
.tier { display: inline-block; min-width: 24px; text-align: center; font-family: var(--font-display); font-weight: 600; padding: 1px 7px; background: var(--paper-3); color: var(--ink); }
.t-a { background: var(--fill); color: var(--on-fill); }
.issue { color: var(--stop); }
.keys { margin-top: 8px; }

.site-footer { padding: 28px 0; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--mute); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-footer form { display: none; }   /* desktop has Log out in the header; shown again on phones */

@media (max-width: 720px) {
  .site-header { height: auto; }
  .nav { height: auto; flex-wrap: wrap; padding-top: 8px; padding-bottom: 2px; row-gap: 0; }
  .brand em { display: none; }
  .nav-links { order: 3; flex: 1 0 100%; margin-left: -8px; }
  .nav-links a { padding: 10px 10px; }
  .nav-links a[aria-current="page"]::after, .nav-links a:hover::after { bottom: 4px; }
  .nav-tools { margin-left: 0; gap: 6px; }
  .btn.logout { display: none; }
  .site-footer form { display: block; }
  .meter-row { grid-template-columns: 74px 1fr 82px; }
  .card { padding: 18px; }
  .run-row .btn { width: 100%; }
  /* Leads become stacked cards so call / WhatsApp are reachable without side-scrolling */
  table.leads thead { display: none; }
  table.leads, table.leads tbody { display: block; }
  table.leads tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
  table.leads tr[hidden] { display: none; }
  table.leads td { border: 0; padding: 0; }
  table.leads .col-biz { flex: 1 0 100%; max-width: none; min-width: 0; order: -1; }
  table.leads .col-pitch { flex: 1 0 100%; min-width: 0; font-size: 0.9rem; }
  table.leads td.empty { flex: 1 0 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
