/* TenderDesk base – tokens, type, components. No external fonts or requests. */
:root {
  --ink: #0b1f3a; --text: #1d2a3f; --muted: #5a6779; --faint: #8a95a5;
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f1f3f6; --border: #e1e5eb; --border-strong: #cdd3dc;
  --accent: #0f6b66; --accent-hover: #0b5753; --accent-soft: #e4f2f0; --accent-ink: #08423f;
  --green: #17803d; --green-soft: #e6f5ea; --green-ink: #0f5a29;
  --amber: #b45309; --amber-soft: #fdf1dc; --amber-ink: #7c3a07;
  --red: #b42318; --red-soft: #fcebe9; --red-ink: #7a1a12;
  --blue: #2457a6; --blue-soft: #e7eefa;
  --radius: 10px; --radius-sm: 6px; --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(11,31,58,.06); --shadow: 0 1px 3px rgba(11,31,58,.08), 0 4px 14px rgba(11,31,58,.05); --shadow-lg: 0 12px 40px rgba(11,31,58,.18);
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0; letter-spacing: -0.015em; }
h1 { font-size: 1.75rem; font-weight: 650; } h2 { font-size: 1.25rem; font-weight: 650; } h3 { font-size: 1rem; font-weight: 650; } h4 { font-size: .9rem; font-weight: 650; }
p { margin: 0 0 .75em; } a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.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; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 1000; }
.skip-link:focus { left: 8px; text-decoration: none; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: .9rem; } .xs { font-size: .8667rem; } .nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; } .eyebrow { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.stack > * + * { margin-top: 12px; } .row { display: flex; gap: 12px; align-items: center; } .row.wrap { flex-wrap: wrap; } .spread { justify-content: space-between; } .grow { flex: 1 1 auto; min-width: 0; }
.hidden { display: none !important; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 8px 16px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); border-radius: var(--radius-sm); font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none; transition: background .12s, border-color .12s, box-shadow .12s; line-height: 1.2; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; } .btn-dark:hover { background: #162f55; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); } .btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { color: var(--red); border-color: #e7b9b4; } .btn-danger:hover { background: var(--red-soft); }
.btn-sm { min-height: 32px; padding: 5px 11px; font-size: .82rem; } .btn-lg { min-height: 46px; padding: 11px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; } .link-btn:hover { text-decoration: underline; }

/* Forms */
label { font-weight: 600; font-size: .85rem; color: var(--ink); }
.field { display: flex; flex-direction: column; gap: 6px; }
input[type=text], input[type=search], input[type=email], input[type=number], input[type=date], input[type=tel], input[type=url], select, textarea { width: 100%; min-height: 38px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; font-size: .92rem; }
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--accent); flex: none; margin: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: .92rem; cursor: pointer; color: var(--text); }
input[type=range] { width: 100%; accent-color: var(--accent); }
.hint { font-size: .8667rem; color: var(--muted); }

/* Pills / badges */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: .8125rem; font-weight: 700; letter-spacing: .03em; white-space: nowrap; line-height: 1.6; border: 1px solid transparent; }
.pill.green { background: var(--green-soft); color: var(--green-ink); border-color: #bfe3ca; }
.pill.amber { background: var(--amber-soft); color: var(--amber-ink); border-color: #f1d9a8; }
.pill.red { background: var(--red-soft); color: var(--red-ink); border-color: #f1c4bf; }
.pill.blue { background: var(--blue-soft); color: #1b4286; border-color: #c6d6f1; }
.pill.neutral { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.pill.accent { background: var(--accent-soft); color: var(--accent-ink); border-color: #bfdeda; }
.pill.dark { background: var(--ink); color: #fff; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-lg { font-size: .85rem; padding: 4px 14px; }
.tag-low { font-size: .75rem; font-weight: 650; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.demo-badge { display: inline-flex; align-items: center; background: #fff4d6; color: #7a4b00; border: 1px solid #f0cf7b; font-size: .75rem; font-weight: 800; letter-spacing: .08em; padding: 3px 9px; border-radius: 4px; white-space: nowrap; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; } .card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-body { padding: 20px; }
.notice { display: flex; gap: 12px; padding: 12px 16px; border-radius: var(--radius); border: 1px solid; font-size: .9rem; align-items: flex-start; }
.notice.info { background: var(--blue-soft); border-color: #c6d6f1; color: #17366b; }
.notice.warn { background: var(--amber-soft); border-color: #f1d9a8; color: var(--amber-ink); }
.notice.danger { background: var(--red-soft); border-color: #f1c4bf; color: var(--red-ink); }
.notice.ok { background: var(--green-soft); border-color: #bfe3ca; color: var(--green-ink); }
.notice.neutral { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.notice svg { flex: none; margin-top: 2px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--border); background: #fbfbfc; white-space: nowrap; }
.table th button { background: none; border: 0; font: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit; font-weight: inherit; cursor: pointer; padding: 0; display: inline-flex; gap: 4px; align-items: center; }
.table th button:hover { color: var(--ink); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; } .table tbody tr.clickable:hover td { background: #f8fafb; }

/* Modal / toast */
.modal-backdrop { position: fixed; inset: 0; background: rgba(11,31,58,.5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 900; }
.modal { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 24px 12px; }
.modal-body { padding: 4px 24px 16px; overflow: auto; } .modal-foot { padding: 14px 24px 20px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--border); }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 6px; cursor: pointer; color: var(--muted); display: inline-flex; } .icon-btn:hover { background: var(--surface-2); color: var(--ink); }
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: .88rem; box-shadow: var(--shadow-lg); animation: toast-in .18s ease-out; max-width: 90vw; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
.spinner.dark { border-color: var(--border-strong); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty h3 { margin-bottom: 6px; color: var(--ink); }
.legal-line { font-size: .8rem; color: var(--muted); max-width: 820px; }
.ai-banner { display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: var(--amber-soft); border: 1px solid #f1d9a8; border-left: 4px solid var(--amber); color: var(--amber-ink); font-weight: 750; font-size: .8rem; letter-spacing: .05em; border-radius: var(--radius-sm); }
.ai-banner.verified { background: var(--green-soft); border-color: #bfe3ca; border-left-color: var(--green); color: var(--green-ink); }
.ai-banner small { font-weight: 500; letter-spacing: 0; margin-left: auto; text-align: right; }

/* ---------- Phase 2: evidence status, score basis, provisional ---------- */
.ev { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px 2px 8px; border-radius: 6px; font-size: .8125rem; font-weight: 750; letter-spacing: .03em; white-space: nowrap; line-height: 1.55; border: 1.5px solid; }
.ev-verified { background: var(--green); color: #fff; border-color: var(--green); }
.ev-unverified { background: var(--amber-soft); color: var(--amber-ink); border: 1.5px dashed var(--amber); }
.ev-conflict { background: var(--red); color: #fff; border-color: var(--red-ink); }
.ev-demo { background: repeating-linear-gradient(135deg, #eef2f8, #eef2f8 6px, #e1e8f4 6px, #e1e8f4 12px); color: #1b4286; border: 1.5px dotted #6f8bbd; }
.tag-prov { font-size: .75rem; font-weight: 750; letter-spacing: .05em; color: var(--amber-ink); background: var(--amber-soft); border: 1px dashed var(--amber); border-radius: 999px; padding: 1px 9px; white-space: nowrap; }
.basis { display: inline-block; font-size: .75rem; font-weight: 750; letter-spacing: .04em; padding: 1px 8px; border-radius: 4px; white-space: nowrap; border: 1px solid; line-height: 1.6; }
.b-verified { background: var(--green-soft); color: var(--green-ink); border-color: #bfe3ca; }
.b-customer { background: var(--blue-soft); color: #1b4286; border-color: #c6d6f1; }
.b-inferred { background: #fff; color: var(--amber-ink); border: 1px dashed var(--amber); font-style: italic; }
.b-unknown { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--faint); }
.src-compact { font-size: .8125rem; color: var(--muted); }
.empty h1 { font-size: 1.2rem; margin-bottom: 6px; color: var(--ink); }
