/* ══════════════════════════════════════════════════════════════
   COMPLIANTBID — Intake desk
   Same charter as compliantbid.com: deep ink + warm paper + one
   oxblood accent, Source Serif 4 (authority) + Inter (clarity).
   Mobile-first; the patrons answer from their phones.
   ══════════════════════════════════════════════════════════════ */

/* ── self-hosted fonts (no external requests) ─────────────────── */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/assets/fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/assets/fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/assets/fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/assets/fonts/inter-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/assets/fonts/source-serif-4-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/assets/fonts/source-serif-4-latin-600-normal.woff2') format('woff2'); }

:root {
  --paper: #faf8f4;
  --paper-2: #f3efe7;
  --card: #fffdf9;
  --ink: #16202e;
  --ink-2: #35404e;
  --ink-3: #6a7787;
  --line: #e2dccf;
  --line-2: #ece7dc;
  --accent: #9a3b2e;
  --accent-2: #7f3125;
  --accent-wash: #f4e9e5;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --r: 6px;
  --r-sm: 4px;
  --lift: 0 1px 2px rgba(22, 32, 46, .05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper); color: var(--ink-2);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-feature-settings: 'kern', 'liga', 'calt';
}
h1 { font-family: var(--serif); font-weight: 600; color: var(--ink); line-height: 1.14; letter-spacing: -.012em; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
strong { color: var(--ink); font-weight: 600; }
::selection { background: rgba(154, 59, 46, .14); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 6px; font-size: 14px; font-weight: 600; }
.skip:focus { left: 12px; color: #fff; }

/* ── brand ────────────────────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.mark-wrap { display: inline-flex; }
.mark-wrap.big svg { width: 40px; height: 40px; }
.word { font-family: var(--serif); font-weight: 600; font-size: 18px; letter-spacing: -.01em; line-height: 1; }
.word b { font-weight: 600; color: var(--ink); }
.word .accent { color: var(--accent); }

/* ── buttons (from the site) ──────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-size: 15px; font-weight: 600; letter-spacing: -.005em; line-height: 1;
  padding: 12px 20px; border-radius: var(--r-sm); border: 1px solid transparent; cursor: pointer;
  transition: background .18s, border-color .18s, color .18s, transform .1s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-2); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink-3); }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); background: rgba(22, 32, 46, .03); }
.btn-lg { padding: 14px 26px; font-size: 16px; }

/* ══ GATE (access code) ═══════════════════════════════════════ */
.body-gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.gate { width: 100%; max-width: 440px; }
.gate-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--lift); padding: 34px 30px 30px;
}
.gate-card.center { text-align: center; }
.gate-card .brand { margin-bottom: 22px; }
.gate-kicker { font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.gate h1 { font-size: 27px; margin: 8px 0 0; }
.gate-lede { margin-top: 12px; color: var(--ink-3); font-size: 15.5px; }
.gate-error {
  margin-top: 16px; background: var(--accent-wash); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--r-sm); padding: 12px 14px; color: var(--ink-2); font-size: 14.5px;
}
.gate-form { margin-top: 22px; display: grid; gap: 12px; }
.gate-form label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.gate-form input {
  font-family: var(--sans); font-size: 24px; font-weight: 600; letter-spacing: .32em;
  text-align: center; text-transform: uppercase; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 16px 14px; width: 100%; transition: border-color .18s, box-shadow .18s;
}
.gate-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(154, 59, 46, .12); }
.gate-form input::placeholder { color: var(--ink-3); opacity: .55; letter-spacing: .18em; font-weight: 500; }
.gate-form .btn { width: 100%; margin-top: 4px; }
.gate-foot { margin-top: 18px; font-size: 13.5px; color: var(--ink-3); }

/* ══ APP (conversation) ═══════════════════════════════════════ */
.body-app { height: 100dvh; overflow: hidden; }
.app { display: flex; flex-direction: column; height: 100dvh; max-width: 760px; margin: 0 auto;
  background: var(--paper); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }

.app-head { flex: none; background: var(--paper); border-bottom: 2px solid var(--ink);
  padding: env(safe-area-inset-top) 0 0; }
.app-head-in { padding: 14px 18px; display: flex; align-items: center; gap: 14px; }
.app-head .brand .word { font-size: 16px; }
.head-meta { margin-left: auto; text-align: right; min-width: 0; }
.head-client { font-family: var(--serif); font-weight: 600; color: var(--ink); font-size: 15px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-sol { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-sol .due { color: var(--accent); font-weight: 600; }
@media (max-width: 560px) {
  .app-head-in { flex-wrap: wrap; gap: 4px 12px; }
  .head-meta { text-align: left; margin-left: 0; width: 100%; }
  .head-sol { white-space: normal; }
}

/* thread */
.thread { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden;
  padding: 22px 18px 8px; display: flex; flex-direction: column; gap: 14px;
  scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }
.msg { display: flex; max-width: 88%; }
.msg-assistant { align-self: flex-start; }
.msg-client { align-self: flex-end; }
.msg-body { font-size: 15.5px; line-height: 1.55; border-radius: var(--r); padding: 12px 15px; white-space: pre-wrap; word-wrap: break-word; }
.msg-assistant .msg-body { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  color: var(--ink-2); box-shadow: var(--lift); }
.msg-client .msg-body { background: var(--ink); color: #eef0f3; border: 1px solid var(--ink); }
.msg.system .msg-body { background: var(--paper-2); border: 1px dashed var(--line); color: var(--ink-3);
  font-size: 14px; border-left: 3px solid var(--ink-3); }
.msg .cursor { display: inline-block; width: 7px; height: 15px; background: var(--accent);
  margin-left: 1px; vertical-align: -2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* composer */
.composer { flex: none; background: var(--paper); border-top: 1px solid var(--line);
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
.composer-in { display: grid; gap: 10px; }
.composer-row { display: flex; align-items: flex-end; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 6px 6px 8px;
  transition: border-color .18s, box-shadow .18s; }
.composer-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(154, 59, 46, .1); }
#input { flex: 1 1 auto; border: none; background: transparent; resize: none;
  font-family: var(--sans); font-size: 16px; line-height: 1.5; color: var(--ink);
  padding: 8px 4px; max-height: 140px; }
#input:focus { outline: none; }
#input::placeholder { color: var(--ink-3); opacity: .7; }
.iconbtn { flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--r-sm); border: 1px solid transparent;
  background: transparent; color: var(--ink-3); cursor: pointer; transition: color .18s, background .18s; }
.iconbtn:hover { color: var(--ink); background: rgba(22, 32, 46, .04); }
.iconbtn.send { background: var(--accent); color: #fff; }
.iconbtn.send:hover { background: var(--accent-2); }
.iconbtn:disabled { opacity: .5; cursor: not-allowed; }
.composer-actions { display: flex; gap: 10px; }
.composer-actions .btn { flex: 1 1 auto; font-size: 14px; padding: 11px 14px; }
.composer-note { font-size: 12.5px; color: var(--ink-3); text-align: center; margin: 0; }
.composer-note.err { color: var(--accent); font-weight: 600; }

/* uploader panel ("Just upload everything") */
.uploader { flex: none; border-top: 1px solid var(--line); background: var(--paper-2);
  max-height: 60dvh; overflow-y: auto; }
.uploader-in { padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 10px; max-width: 760px; margin: 0 auto; }
.uploader-title { font-family: var(--serif); font-weight: 600; color: var(--ink); font-size: 18px; }
.uploader-sub { font-size: 14px; color: var(--ink-3); }
.filepick { display: inline-block; }
.filepick input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.filepick .btn { display: inline-flex; }
.filepick input:focus-visible + .btn { outline: 2px solid var(--accent); outline-offset: 2px; }
.picked { display: grid; gap: 6px; }
.picked .pf { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; }
.picked .pf .x { color: var(--ink-3); }
.picked .pf.bad { border-color: var(--accent); color: var(--accent); }
.uploader-note-l { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-top: 4px; }
.uploader-note-l .opt { font-weight: 500; letter-spacing: normal; text-transform: none; }
#bulk-note { font-family: var(--sans); font-size: 15px; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; width: 100%; resize: vertical; line-height: 1.5; }
#bulk-note:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(154, 59, 46, .1); }
.uploader-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.uploader-actions .btn { flex: 1 1 auto; }
@media (max-width: 560px) { .uploader-actions .btn { flex: 1 1 100%; } }

/* confirmation */
.done { text-align: center; padding: 8px 6px; }
.done .mark-wrap { justify-content: center; margin-bottom: 18px; }
.done h1 { font-size: 26px; }
.done p { margin-top: 14px; color: var(--ink-2); font-size: 16px; }
.done-foot { color: var(--ink-3); font-size: 14.5px; }
.app .done { margin: auto; max-width: 480px; }

/* a small toast for upload feedback */
.toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  background: var(--ink); color: #eef0f3; font-size: 14px; padding: 10px 16px; border-radius: var(--r-sm);
  box-shadow: 0 6px 20px rgba(22,32,46,.2); z-index: 60; max-width: 90%; text-align: center; }
.toast.err { background: var(--accent); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; scroll-behavior: auto !important; } }
