/* The founding desk page, in ClientFile's own design system (frontend/src/css/app.css in the clientfile repo):
   Deep Forest Green, sage, warm off-white; Manrope headings, Inter text. Fonts are served from here (/fonts), since
   the page's security policy loads nothing from other sites. */
@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(/fonts/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 500; font-display: swap; src: url(/fonts/inter-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(/fonts/inter-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Manrope; font-weight: 600; font-display: swap; src: url(/fonts/manrope-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Manrope; font-weight: 700; font-display: swap; src: url(/fonts/manrope-latin-700-normal.woff2) format("woff2"); }

:root {
  --green: #183F36; --green-2: #22564a; --sage: #A8B9AE; --pale: #EDF3EF; --ground: #F7F7F4; --surface: #FFFFFF;
  --ink: #202522; --muted: #707671; --line: #E1E4E0;
  --you-bg: var(--green); --you-ink: #FFFFFF; --desk-bg: var(--pale); --desk-ink: var(--ink);
  --shadow: 0 1px 2px rgba(24, 63, 54, .06), 0 8px 28px rgba(24, 63, 54, .08);
  --heading: Manrope, Inter, system-ui, sans-serif; --body: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0f1714; --surface: #16211d; --ink: #e8eeea; --muted: #9fb0a6; --line: #263630; --pale: #1d2b26;
    --you-bg: #A8B9AE; --you-ink: #0f1714; --desk-bg: #1d2b26; --desk-ink: #e8eeea; --green-2: #c4d3c9;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--ground);
       color: var(--ink); font: 16px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── top bar ───────────────────────────────────────────────── */
.top { background: var(--green); color: #fff; }
.top-in { max-width: 820px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px;
          justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.mark { width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .18); }
.word { font: 700 19px/1 var(--heading); letter-spacing: -.01em; }
.pill { font-size: 12.5px; font-weight: 500; color: var(--pale); background: rgba(255, 255, 255, .1);
        border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; padding: 4px 11px; white-space: nowrap; }

/* ── page ──────────────────────────────────────────────────── */
.page { flex: 1; width: 100%; max-width: 820px; margin: 0 auto; padding: 28px 16px 32px; display: flex;
        flex-direction: column; gap: 18px; }
.hero h1 { font: 700 clamp(24px, 4.4vw, 32px)/1.2 var(--heading); letter-spacing: -.02em; margin: 0 0 8px;
           color: var(--ink); }
.lede { margin: 0 0 14px; color: var(--muted); font-size: 16.5px; max-width: 46em; }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.facts li { font-size: 13.5px; color: var(--muted); background: var(--surface); border: 1px solid var(--line);
            border-radius: 999px; padding: 5px 12px; }
.facts b { color: var(--green-2); font-weight: 600; }
@media (prefers-color-scheme: dark) { .hero h1 { color: var(--ink); } }

/* ── the chat card ─────────────────────────────────────────── */
.chat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
        display: flex; flex-direction: column; min-height: 420px; max-height: 72vh; max-height: 72dvh; overflow: hidden; }
.log { flex: 1; overflow-y: auto; padding: 22px 18px 8px; display: flex; flex-direction: column; gap: 14px;
       scroll-behavior: smooth; overscroll-behavior: contain; }
.row { display: flex; gap: 10px; align-items: flex-end; animation: rise .22s ease-out; }
.row.visitor { justify-content: flex-end; }
.avatar { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
          background: var(--green); color: #fff; font: 700 13px/1 var(--heading); }
@media (prefers-color-scheme: dark) { .avatar { background: var(--sage); color: #0f1714; } }
.msg { max-width: min(78%, 560px); padding: 11px 15px; border-radius: 18px; overflow-wrap: anywhere; font-size: 15.5px; }
.msg.desk { background: var(--desk-bg); color: var(--desk-ink); border-bottom-left-radius: 6px; }
.msg.visitor { background: var(--you-bg); color: var(--you-ink); border-bottom-right-radius: 6px; white-space: pre-wrap; }
.row.notice { justify-content: center; }
.msg.notice { max-width: 92%; background: transparent; color: var(--muted); font-size: 13.5px; text-align: center;
              padding: 4px 8px; }
.msg p { margin: 0 0 8px; } .msg p:last-child { margin: 0; }
.msg ul { margin: 0 0 8px; padding-left: 20px; } .msg ul:last-child { margin-bottom: 0; }
.msg li { margin: 2px 0; }
.msg strong { font-weight: 600; }

.typing { display: flex; gap: 10px; align-items: flex-end; padding: 0 18px 10px; }
.dots { display: inline-flex; gap: 4px; background: var(--desk-bg); border-radius: 18px; border-bottom-left-radius: 6px;
        padding: 14px 16px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .4; animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }

form { display: flex; gap: 10px; align-items: flex-end; margin: 0; padding: 12px 14px; border-top: 1px solid var(--line);
       background: var(--surface); }
textarea { flex: 1; font: inherit; font-size: 16px; color: var(--ink); background: var(--ground); border: 1px solid var(--line);
           border-radius: 22px; padding: 11px 16px; resize: none; min-height: 46px; max-height: 180px; line-height: 1.45;
           outline: none; transition: border-color .15s, box-shadow .15s; }
textarea:focus { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(168, 185, 174, .35); }
textarea::placeholder { color: var(--muted); }
button { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--green); color: #fff;
         display: grid; place-items: center; cursor: pointer; transition: background .15s, transform .1s; }
button svg { width: 20px; height: 20px; }
button:hover { background: var(--green-2); } button:active { transform: scale(.96); }
@media (prefers-color-scheme: dark) { button { background: var(--sage); color: #0f1714; } button:hover { background: #c4d3c9; } }
button:disabled { opacity: .45; cursor: default; transform: none; }
.via { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
       opacity: .65; margin-bottom: 4px; }

.privacy { display: flex; gap: 10px; align-items: flex-start; margin: 0; font-size: 13px; color: var(--muted); }
.privacy svg { flex: none; width: 16px; height: 16px; margin-top: 2px; }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: .9; transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .row, .dots i { animation: none; } .log { scroll-behavior: auto; } }

@media (max-width: 560px) {
  .pill { display: none; }
  .page { padding: 18px 12px 20px; gap: 14px; }
  .hero h1 { font-size: 23px; }
  .lede { font-size: 15px; margin-bottom: 10px; }
  .facts li { font-size: 12.5px; padding: 4px 10px; }
  .chat { border-radius: 14px; min-height: 64vh; min-height: 64dvh; max-height: 78vh; max-height: 78dvh; }
  .msg { max-width: 86%; }
  .log { padding: 16px 12px 6px; }
  form { padding: 10px; }
}
