/* LeadRafter — shared styles.
   Direction: job-site clarity. Cool slate paper, asphalt ink, one hi-vis orange for the action that matters (Send / Call).
   Wide signage display face for headings; status is always shown as color + word. */
:root {
  --paper: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --ink: #141c24;
  --ink-2: #3c4855;
  --muted: #6a7684;
  --line: #dde2e8;
  --line-2: #c9d0d8;
  --accent: #e8590c;
  --accent-ink: #ffffff;
  --accent-soft: #fdeadf;
  --focus: #2b6cb0;

  --s-reply: #1f5fa8;   --s-reply-bg: #e3eefa;
  --s-follow: #6b3fb5;  --s-follow-bg: #eee7fa;
  --s-call: #9a5b00;    --s-call-bg: #fcefd6;
  --s-answer: #1d7a45;  --s-answer-bg: #e0f3e8;
  --s-wait: #5b6672;    --s-wait-bg: #eceff2;
  --s-urgent: #c0322b;  --s-urgent-bg: #fbe4e2;

  --shadow: 0 1px 2px rgba(20, 28, 36, .06), 0 4px 16px rgba(20, 28, 36, .06);
  --radius: 10px;
  --f-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1418; --surface: #171e24; --surface-2: #1c242b; --ink: #e9eef2; --ink-2: #c3ccd5; --muted: #8d99a6;
    --line: #28323b; --line-2: #36414c; --accent: #ff7a2f; --accent-ink: #1a0c03; --accent-soft: #3a2214; --focus: #79b2ec;
    --s-reply: #8cbcf0; --s-reply-bg: #182b40; --s-follow: #c2a5f2; --s-follow-bg: #2a2140; --s-call: #f1bd62; --s-call-bg: #3a2b12;
    --s-answer: #79d3a0; --s-answer-bg: #15301f; --s-wait: #a5b0bb; --s-wait-bg: #232c34; --s-urgent: #f28a83; --s-urgent-bg: #3d1a18;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1418; --surface: #171e24; --surface-2: #1c242b; --ink: #e9eef2; --ink-2: #c3ccd5; --muted: #8d99a6;
  --line: #28323b; --line-2: #36414c; --accent: #ff7a2f; --accent-ink: #1a0c03; --accent-soft: #3a2214; --focus: #79b2ec;
  --s-reply: #8cbcf0; --s-reply-bg: #182b40; --s-follow: #c2a5f2; --s-follow-bg: #2a2140; --s-call: #f1bd62; --s-call-bg: #3a2b12;
  --s-answer: #79d3a0; --s-answer-bg: #15301f; --s-wait: #a5b0bb; --s-wait-bg: #232c34; --s-urgent: #f28a83; --s-urgent-bg: #3d1a18;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--f-body); }
h1, h2, h3 { font-family: var(--f-display); font-stretch: 112%; letter-spacing: -0.01em; text-wrap: balance; margin: 0; line-height: 1.1; }
p { margin: 0; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); background: var(--accent); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.big { min-height: 48px; padding: 0 22px; font-size: 15px; }
.btn.danger { color: var(--s-urgent); border-color: var(--s-urgent); background: transparent; }
.btn svg { width: 18px; height: 18px; flex: none; }
.icon-btn { width: 40px; padding: 0; }

/* ---------- form fields ---------- */
.field { display: grid; gap: 6px; align-content: start; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 12.5px; }
.input, .textarea, .select { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); }
.textarea { resize: vertical; line-height: 1.55; }
.input:focus, .textarea:focus, .select:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }

/* ---------- status chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 20px; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.reply_ready { color: var(--s-reply); background: var(--s-reply-bg); }
.chip.followup_ready { color: var(--s-follow); background: var(--s-follow-bg); }
.chip.call_new, .chip.call_list { color: var(--s-call); background: var(--s-call-bg); }
.chip.answered { color: var(--s-answer); background: var(--s-answer-bg); }
.chip.waiting, .chip.closed { color: var(--s-wait); background: var(--s-wait-bg); }
.chip.won { color: var(--s-answer); background: var(--s-answer-bg); }
.chip.urgent { color: var(--s-urgent); background: var(--s-urgent-bg); }
.chip.plain { color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); }
.chip.plain::before { display: none; }

/* ---------- toast ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 50; display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); }
.toast { background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 500; animation: rise .2s ease-out; }
.toast.error { background: var(--s-urgent); color: #fff; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- brand mark ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex: none; border-radius: 7px; background: var(--ink); display: grid; place-items: center; }
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font-family: var(--f-display); font-stretch: 118%; font-weight: 800; font-size: 17px; letter-spacing: -0.01em; white-space: nowrap; }
