/* Curen CRM. Curen brand (see DESIGN.md at the repo root): Newsreader headings with italic accent words, Public Sans
   text, sage neutrals, one green accent, hairline rules. Light by default; follows the system dark setting.
   Self-hosted fonts only; no inline styles (CSP style-src 'self'). */
[hidden] { display: none !important; }
/* ---- Curen design tokens (copied from DESIGN.md; keep in step with curen-home/public/static/home.css) ---- */
@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader-normal.woff2") format("woff2"); font-weight: 300 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader-italic.woff2") format("woff2"); font-weight: 300 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("/fonts/public-sans-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
:root {
  --bg: #f3f6f4; --paper: #fbfcfb; --surface: #ffffff; --sunk: #e9efeb;
  --ink: #12201b; --ink-2: #26352f; --muted: #4a5a53; --line: #d3ddd8; --line-strong: #76887f;
  --accent: #0b6b4f; --accent-strong: #08573f; --on-accent: #ffffff; --accent-soft: #dcefe6; --accent-tint: #eef7f2;
  --green: #086447; --green-soft: #d8f0e4; --amber: #8a5a00; --amber-dot: #c98a12; --amber-soft: #fbefd5;
  --red: #b3261e; --red-dot: #d23c31; --red-soft: #fbe9e7; --grey: #5b6963; --grey-soft: #e9efeb;
  --shadow: 158 30% 20%; --focus: #0b6b4f;
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --step--2: 0.8125rem; --step--1: 0.875rem; --step-0: 1rem; --step-1: 1.1875rem;
  --step-2: clamp(1.35rem, 1.15rem + 0.8vw, 1.75rem); --step-3: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 72px;
  --r: 12px; --r-sm: 8px; --r-pill: 999px;
  --elev-1: 0 1px 2px hsl(var(--shadow) / .06); --elev-2: 0 18px 44px -28px hsl(var(--shadow) / .55);
  --ease: cubic-bezier(.2, .7, .2, 1); --measure: 68ch;
  color-scheme: light;
}
/* Legacy names used by this app's rules, mapped onto the tokens. */
:root { --surface-2: var(--sunk); --text: var(--ink); --border: var(--line); --accent-text: var(--on-accent); --danger: var(--red); --ok: var(--green);
  --warn: var(--amber-dot); --radius: var(--r); font-family: var(--font-body); }
@media (prefers-color-scheme: dark) { :root {
  --bg: #0a0c0b; --paper: #0e110f; --surface: #121614; --sunk: #080a09;
  --ink: #f1f5f3; --ink-2: #d3dbd7; --muted: #9da8a3; --line: #222926; --line-strong: #56625c;
  --accent: #5cc9a0; --accent-strong: #84dcb9; --on-accent: #04120c; --accent-soft: #12271f; --accent-tint: #0f1c17;
  --green: #6fd8ad; --green-soft: #10261d; --amber: #f0c36b; --amber-dot: #e8b04a; --amber-soft: #2a2010;
  --red: #ff8a80; --red-dot: #ff6b5f; --red-soft: #33120f; --grey: #a3aea9; --grey-soft: #1a201d;
  --shadow: 200 20% 1%; --focus: #84dcb9;
  color-scheme: dark;
} }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--accent-soft); color: var(--ink); }
a { color: var(--accent); text-underline-offset: .2em; text-decoration-thickness: 1px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 450; letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
h1 em, h2 em, h3 em { color: var(--accent); font-weight: 380; }
h1 { font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.4rem); letter-spacing: -0.03em; line-height: 1.08; margin: 0 0 1rem; font-weight: 420; }
h2 { font-size: 1.3rem; margin: 0 0 0.75rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.topbar { display: flex; align-items: center; gap: 0.75rem 1.5rem; padding: 0.7rem max(16px, 2.5vw); min-height: 64px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.55rem; font-family: var(--font-display); font-size: 1.35rem; font-weight: 450; letter-spacing: -0.02em; }
.brand em { color: var(--accent); font-weight: 380; }
.nav { display: flex; gap: 0.25rem; flex: 1; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--ink-2); padding: 0.45rem 0.85rem; border-radius: var(--r-pill); border: 1px solid transparent; font-size: 0.9rem; font-weight: 500;
  transition: border-color .2s var(--ease), background .2s var(--ease); }
.nav a:hover { border-color: var(--border); color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); background: var(--accent-tint); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); font-weight: 600; }
.who { display: flex; align-items: center; gap: 0.5rem; color: var(--muted); font-size: 0.9rem; }

.view { padding: clamp(1.25rem, 2.5vw, 2.25rem) max(16px, 2.5vw) 3rem; max-width: 1400px; margin: 0 auto; outline: none; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--elev-1); }
.auth { max-width: 420px; margin: 8vh auto 0; }
.stack > * + * { margin-top: 0.75rem; }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 160px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }

label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--ink-2); margin-bottom: 0.3rem; }
input, select, textarea { width: 100%; padding: 0.6rem 0.75rem; min-height: 44px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font: inherit; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
input:hover, select:hover, textarea:hover { border-color: var(--ink-2); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea { min-height: 80px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.view:focus, .view:focus-visible { outline: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.55rem 1.05rem; min-height: 40px; border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 0.9rem; font-weight: 600; line-height: 1.2; cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease); }
.btn:hover { border-color: var(--ink-2); background: var(--paper); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--red-soft); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-quiet:hover { border-color: var(--border); background: transparent; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

.error { color: var(--danger); font-size: 0.9rem; min-height: 1.2em; }
.toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 0.7rem 1.1rem; border-radius: var(--r-pill); z-index: 20; font-weight: 500; box-shadow: 0 18px 40px -18px hsl(var(--shadow) / .6); max-width: calc(100% - 2rem); }

.toolbar { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.toolbar h1 { margin: 0; flex: 1; }
.toolbar input { max-width: 280px; }

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 0.75rem; overflow-x: auto; padding-bottom: 0.5rem; }
.column { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem; min-height: 200px; }
.column h2 { display: flex; justify-content: space-between; font-family: var(--font-body); font-size: 0.75rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-2);
  border-top: 1px solid var(--ink); padding-top: 0.5rem; }
.deal { display: block; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 0.7rem 0.8rem; margin-bottom: 0.5rem; box-shadow: var(--elev-1); transition: border-color .2s var(--ease), box-shadow .25s var(--ease); }
.deal:hover { border-color: var(--accent); box-shadow: var(--elev-2); }
.deal .name { font-weight: 600; overflow-wrap: anywhere; }
.deal .meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.85rem; margin-top: 0.25rem; }
.score { display: inline-block; padding: 0.05rem 0.55rem; border-radius: 999px; font-size: 0.78rem; font-weight: 650; background: var(--grey-soft); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.score.hot { color: var(--green); background: var(--green-soft); }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; border-left: 1px solid var(--line-strong); padding: 0 0 1rem 1rem; margin-left: 4px; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: .35rem; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline .when { font-size: 0.8rem; color: var(--muted); }
.timeline .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.chip { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 0.05rem 0.5rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); margin-right: 0.35rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
th { font-size: 0.72rem; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: 0.1em; }
tbody tr:hover { background: var(--accent-tint); }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 0.6rem; border-radius: 8px;
  overflow-wrap: anywhere; user-select: all; }
.reasons { margin: 0.25rem 0 0; padding-left: 1.1rem; }
.empty { color: var(--muted); font-size: 0.9rem; padding: 0.5rem; }

label.check { display: flex; align-items: center; gap: 0.5rem; color: var(--text); font-size: 0.95rem; margin: 0; }
label.check input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--accent); }

fieldset.card { margin: 0; }
legend { font-weight: 600; padding: 0 0.25rem; }

/* call coach */
h3 { font-size: 1.1rem; margin: 1rem 0 0.4rem; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.transcript { max-height: 420px; overflow: auto; background: var(--surface-2); padding: 0.6rem; border-radius: 8px; font-size: 0.9rem; }
.quote { margin: 0.25rem 0 0.25rem 0.25rem; padding-left: 0.6rem; border-left: 3px solid var(--border); color: var(--muted); font-style: italic; }
.scores th { width: 9rem; text-transform: none; font-size: 0.9rem; color: var(--text); }
.scores meter { width: min(60%, 220px); vertical-align: middle; }
.warn { border: 1px solid var(--warn); border-left-width: 3px; background: var(--amber-soft); border-radius: var(--r-sm); padding: 0.65rem 0.9rem; color: var(--text); }
.warn p { margin: 0.2rem 0; }
.row-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.scroll { overflow-x: auto; }
td.weak { color: var(--danger); font-weight: 650; }
.score-chip { color: var(--text); }
.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; }

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