/* Kaveree Pursuits. Kaveree's brand: white, navy #203562, a thin green #40b843 accent, Geist, drawing-sheet hairlines. */
:root {
  --navy: #203562; --navy-deep: #15244a; --navy-ink: #0d1730;
  --green: #40b843; --green-ink: #26802a;
  --ink: #0e1726; --muted: #556074; --faint: #8a93a3;
  --paper: #f5f7fa; --white: #fff; --line: #dfe1e6; --field: #c3c8d2;
  --amber: #b26a00; --amber-bg: #fff4e0; --red: #b42318; --red-bg: #fdecea; --green-bg: #eaf6ea;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", monospace;
  --r: 10px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--white); color: var(--ink); font: 15px/1.55 var(--sans); }
a { color: var(--navy); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
main:focus, main:focus-visible { outline: none; }
h1, h2, h3 { color: var(--navy); line-height: 1.15; letter-spacing: -0.015em; margin: 0; font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(26px, 4vw, 34px); }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
.mono, .label { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Bar */
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px; padding: 10px max(16px, calc((100vw - 1120px) / 2)); background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 40px; width: auto; margin: -4px 0; }
.brand span { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--navy); border-left: 1px solid var(--line); padding-left: 12px; }
.bar nav { display: flex; gap: 4px; margin-left: auto; }
.bar nav a { text-decoration: none; padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.bar nav a:hover { color: var(--navy); background: var(--paper); }
.bar nav a[aria-current="page"] { color: var(--navy); background: var(--paper); box-shadow: inset 0 -2px 0 var(--green); }

main { max-width: 1120px; margin: 0 auto; padding: 32px 16px 96px; outline: none; }
.loading { color: var(--muted); }

/* Buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--field); background: var(--white); color: var(--navy); font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--navy); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-deep); }
.btn.quiet { border-color: transparent; background: transparent; padding-inline: 10px; }
.btn.quiet:hover { background: var(--paper); }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { min-height: 32px; padding: 4px 10px; font-size: 13.5px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; border: 1px solid var(--field); border-radius: 8px; padding: 9px 11px; background: var(--white); min-height: 40px;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(32,53,98,.12); }
label.field { display: grid; gap: 6px; font-weight: 500; font-size: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }

/* Cards and sheet details */
.card { border: 1px solid var(--line); border-radius: var(--r); background: var(--white); padding: 20px; }
.card.paper { background: var(--paper); border-color: transparent; }
.sheet-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 16px; margin-bottom: 24px; border-bottom: 1px solid var(--line); position: relative; }
.sheet-head::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 56px; height: 2px; background: var(--green); }
.sheet-head p { margin: 6px 0 0; color: var(--muted); max-width: 60ch; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  linear-gradient(var(--white), rgba(255,255,255,.92)), repeating-linear-gradient(0deg, transparent 0 23px, #e9edf3 23px 24px), repeating-linear-gradient(90deg, transparent 0 23px, #e9edf3 23px 24px); }
.login form { width: min(400px, 100%); display: grid; gap: 16px; padding: 32px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px -24px rgba(13,23,48,.25); }
.login img { height: 40px; width: auto; justify-self: start; }
.login .err { color: var(--red); font-size: 14px; min-height: 1.2em; margin: 0; }

/* Welcome note */
.welcome { position: relative; padding: 22px 24px 22px 26px; border-radius: var(--r); background: var(--paper); margin-bottom: 28px; border-left: 3px solid var(--green); }
.welcome p { margin: 0 0 10px; max-width: 66ch; }
.welcome .sig { font-weight: 600; color: var(--navy); }

/* Drop zone */
.drop { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 36px 20px; border: 1.5px dashed var(--field); border-radius: 14px; background: var(--white); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--navy); background: #f8fafd; }
.drop strong { color: var(--navy); font-size: 17px; }
.drop svg { color: var(--navy); }
.drop .progress { width: min(360px, 100%); }
progress { width: 100%; height: 6px; appearance: none; border: 0; border-radius: 99px; background: var(--line); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--green); }
progress::-moz-progress-bar { background: var(--green); }

/* Pursuit list */
.list { display: grid; gap: 0; border-top: 1px solid var(--line); margin-top: 28px; }
.item { display: grid; grid-template-columns: 112px 1fr auto; gap: 16px; align-items: center; padding: 16px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.item:hover { background: #fafbfd; }
.item h3 { font-size: 16.5px; margin-bottom: 2px; }
.item .meta { color: var(--muted); font-size: 13.5px; }
.steps-mini { display: flex; gap: 6px; }
.steps-mini span { width: 22px; height: 4px; border-radius: 2px; background: var(--line); }
.steps-mini span.on { background: var(--green); }
.empty { padding: 32px 4px; color: var(--muted); }

/* Due chip */
.due { display: inline-grid; gap: 1px; padding: 6px 10px; border-radius: 8px; background: var(--paper); text-align: left; min-width: 96px; }
.due b { font-size: 15px; color: var(--navy); font-weight: 600; font-variant-numeric: tabular-nums; }
.due small { font-family: var(--mono); font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.due.soon { background: var(--amber-bg); } .due.soon b { color: var(--amber); }
.due.urgent { background: var(--red-bg); } .due.urgent b { color: var(--red); }
.due.past b { color: var(--faint); }

.pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; background: var(--paper); color: var(--muted); white-space: nowrap; }
.pill.go, .pill.won, .pill.strong { background: var(--green-bg); color: var(--green-ink); }
.pill.maybe, .pill.ok, .pill.drafting { background: #eef1f8; color: var(--navy); }
.pill.pass, .pill.lost, .pill.weak { background: var(--red-bg); color: var(--red); }
.pill.unknown { background: var(--paper); color: var(--faint); }

/* Leads */
.lead { display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: start; padding: 18px 4px; border-bottom: 1px solid var(--line); }
.lead h3 { font-size: 16.5px; line-height: 1.3; }
.lead h3 a { color: var(--navy); text-decoration: none; }
.lead h3 a:hover { text-decoration: underline; text-decoration-color: var(--green); text-underline-offset: 3px; }
.lead .meta { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.lead .why { margin: 8px 0 0; font-size: 14.5px; max-width: 70ch; }
.lacts { margin-top: 12px; gap: 6px; }
.lscore { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--line); background: var(--white); }
.lscore b { font-size: 17px; color: var(--navy); font-variant-numeric: tabular-nums; }
.lscore.go { border-color: var(--green); } .lscore.go b { color: var(--green-ink); }
.lscore.maybe { border-color: var(--navy); }

/* Pursuit page */
.back { display: inline-block; margin-bottom: 14px; text-decoration: none; color: var(--muted); font-size: 14px; }
.back:hover { color: var(--navy); }
.p-head { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: start; padding-bottom: 20px; border-bottom: 1px solid var(--line); position: relative; }
.p-head::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 56px; height: 2px; background: var(--green); }
.p-head .meta { margin-top: 8px; color: var(--muted); }
.p-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.p-actions select { width: auto; min-height: 40px; }

.tabs { display: flex; gap: 2px; margin: 22px 0 26px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 12px 16px 13px; color: var(--muted); font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button .n { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--field); font-family: var(--mono); font-size: 11px; }
.tabs button.done .n { background: var(--green); border-color: var(--green); color: #fff; }
.tabs button[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--navy); }
.tabs button[aria-selected="true"] .n { border-color: var(--navy); }
.tabs button.done[aria-selected="true"] .n { border-color: var(--green); }

.runbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--r); background: var(--paper); margin-bottom: 24px; }
.runbar p { margin: 0; flex: 1 1 260px; color: var(--muted); font-size: 14px; }
.runbar select { width: auto; min-height: 40px; background: var(--white); }
.working { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 24px; }
.working .t { font-variant-numeric: tabular-nums; font-family: var(--mono); color: var(--muted); font-size: 13px; margin-left: auto; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: blink 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; opacity: .8; } }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.facts > div { padding: 14px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.facts b { display: block; color: var(--navy); font-weight: 600; margin-top: 4px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 32px 0 10px; }
.section-title h2 { font-size: 18px; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 10px 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }
.pg { font-family: var(--mono); font-size: 11.5px; color: var(--faint); white-space: nowrap; }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.scroll-x { overflow-x: auto; }

.check { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; padding: 11px 4px; border-bottom: 1px solid var(--line); align-items: start; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--green-ink); }
.check.done span.txt { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--field); }
.check .kind { display: block; margin-top: 3px; }
.check q { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; quotes: "“" "”"; }
.meter { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.meter progress { width: 120px; }

.verdict { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; padding: 22px; border-radius: var(--r); background: var(--paper); }
.verdict .score { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; background: var(--white); border: 3px solid var(--line); }
.verdict .score b { font-size: 28px; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1; }
.verdict.go .score { border-color: var(--green); } .verdict.maybe .score { border-color: var(--navy); } .verdict.pass .score { border-color: var(--red); }
.verdict h2 { font-size: 24px; text-transform: capitalize; }
.factor { display: grid; grid-template-columns: 200px 90px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }

.sec { border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 14px; }
.sec > header { display: flex; gap: 14px; align-items: start; justify-content: space-between; padding: 16px 18px; flex-wrap: wrap; }
.sec > header .num { font-family: var(--mono); color: var(--green-ink); font-size: 12px; margin-right: 8px; }
.sec .answers { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; max-width: 70ch; }
.sec .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.sec .body { padding: 0 18px 18px; }
.sec textarea { min-height: 260px; font-size: 14.5px; }
.sec .confirms { margin-top: 8px; font-size: 13px; color: var(--amber); }
.redo { display: flex; gap: 8px; margin-top: 10px; }
.redo input { flex: 1; }

/* Library */
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.filters button { border: 1px solid var(--line); background: var(--white); border-radius: 99px; padding: 6px 12px; cursor: pointer; color: var(--muted); font-size: 14px; }
.filters button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.lib button.entry { text-align: left; border: 1px solid var(--line); background: var(--white); border-radius: var(--r); padding: 16px; cursor: pointer; display: grid; gap: 6px; align-content: start; min-height: 120px; }
.lib button.entry:hover { border-color: var(--navy); }
.lib .entry h3 { font-size: 15px; }
.lib .entry p { margin: 0; font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.flag { color: var(--amber); font-size: 12px; }

dialog { border: 0; border-radius: 14px; padding: 0; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 30px 80px -20px rgba(13,23,48,.45); }
dialog::backdrop { background: rgba(13,23,48,.35); }
dialog form, dialog .dlg { padding: 24px; display: grid; gap: 14px; }
dialog textarea { min-height: 300px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--navy-ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; transition: .2s; pointer-events: none; max-width: calc(100vw - 32px); z-index: 50; }
#toast.on { opacity: 1; transform: translateX(-50%); }
#toast.err { background: var(--red); }

@media (max-width: 760px) {
  main { padding-top: 22px; }
  .bar { gap: 10px; }
  .brand span { display: none; }
  .bar nav a { padding: 7px 9px; }
  .item { grid-template-columns: 1fr; gap: 8px; }
  .lead { grid-template-columns: 44px 1fr; gap: 12px; }
  .lead .due { grid-column: 2; grid-row: 1; justify-self: start; margin-bottom: 4px; }
  .lead .lbody { grid-column: 2; }
  .lead .lscore { grid-row: 1 / span 2; width: 44px; height: 44px; }
  .item .due { justify-self: start; }
  .p-head { grid-template-columns: 1fr; }
  .p-actions { justify-content: flex-start; }
  .grid2 { grid-template-columns: 1fr; }
  .factor { grid-template-columns: 1fr auto; }
  .factor .note { grid-column: 1 / -1; }
  .verdict { grid-template-columns: 1fr; }
  .login form { padding: 24px; }
}
@media print { .bar, .tabs, .runbar, .p-actions, .btn { display: none !important; } }
