/* SPDX-License-Identifier: LicenseRef-Hippocratic-3.0 */
/* Ported from jawafdehi-chat's single page (src/jawafdehi_chat/static/index.html). */
/* Jawafdehi's own fonts and colours (jawafdehi-frontend src/index.css): Noto Sans Devanagari for
   text, Vesper Libre for Nepali headlines, Inter for English ones; navy #0E1F3B, crimson #B5242C. */
@font-face { font-family:"Noto Sans Devanagari"; src:url("/assets/NotoSansDevanagari-wght.woff2") format("woff2"); font-weight:100 900; font-display:swap; }
@font-face { font-family:"Vesper Libre"; src:url("/assets/VesperLibre-Bold.woff2") format("woff2"); font-weight:700; font-display:swap; }
@font-face { font-family:"Inter"; src:url("/assets/Inter-latin-wght.woff2") format("woff2"); font-weight:100 900; font-display:swap; }
:root { --ink:#1F2A37; --muted:#5B6472; --line:#DCE1E8; --bg:#FAFAF7; --sunk:#F2F2EF; --card:#fff; --navy:#0E1F3B; --brand:#B5242C; --brand2:#8E1B22; --blush:#F5E5EA;
        --head:"Vesper Libre","Noto Sans Devanagari",serif; }
html[lang="en"] { --head:"Inter","Noto Sans Devanagari",system-ui,sans-serif; }
* { box-sizing: border-box; }
[hidden] { display:none !important; }
body { margin:0; font-family:"Noto Sans Devanagari","Mukta","Segoe UI",system-ui,-apple-system,sans-serif; color:var(--ink); background:var(--bg); line-height:1.6; -webkit-font-smoothing:antialiased; }
:focus-visible { outline:2px solid var(--brand); outline-offset:2px; }
header { background:rgba(255,255,255,.96); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:5; }
.bar { max-width:1120px; margin:0 auto; padding:10px 20px; display:flex; align-items:center; gap:12px; }
.logo { display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--navy); }
.logo img { height:30px; width:auto; display:block; }
.logo small { color:var(--muted); font-weight:500; font-size:.8rem; border-left:1px solid var(--line); padding-left:10px; white-space:nowrap; }
.spacer { flex:1; }
.seg { display:inline-flex; border:1px solid var(--line); border-radius:8px; overflow:hidden; }
.seg button { border:0; background:#fff; padding:6px 12px; cursor:pointer; font:inherit; color:var(--muted); }
.seg button.on { background:var(--navy); color:#fff; }
.newbtn { border:1px solid var(--line); background:#fff; border-radius:8px; padding:6px 12px; cursor:pointer; font:inherit; }
main { max-width:1120px; margin:0 auto; padding:0 20px 150px; }
#thread { max-width:980px; margin:0 auto; padding-top:8px; }

/* Landing: hero (what this is, what it draws on), the role step, the suggested questions, footer */
/* Desktop: intro beside the archive panel, then the role step. Phone: intro, role step, archive. */
.hero { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(0,1fr); column-gap:40px;
        grid-template-areas:"intro archive" "roles roles" "foot foot"; }
.hero[hidden] { display:none; }
.intro { grid-area:intro; padding:44px 0 32px; }
.archive { grid-area:archive; align-self:start; margin-top:44px; }
.step { grid-area:roles; }
.sitefoot { grid-area:foot; }
.eyebrow { display:inline-flex; align-items:center; gap:8px; color:var(--brand); font-weight:600; font-size:.85rem; letter-spacing:.02em; }
.eyebrow::before { content:""; width:22px; height:2px; background:var(--brand); }
.hero h1 { font-family:var(--head); font-weight:700; color:var(--navy); font-size:clamp(1.7rem, 1.1rem + 2.4vw, 2.7rem); line-height:1.25; margin:.35em 0 .4em; text-wrap:balance; letter-spacing:-.005em; }
html[lang="en"] .hero h1 { letter-spacing:-.02em; line-height:1.15; }
.lead { color:#3D4756; font-size:1.06rem; margin:0 0 18px; max-width:40em; text-wrap:pretty; }
.trust { list-style:none; margin:0 0 22px; padding:0; display:grid; gap:6px; }
.trust li { display:flex; gap:10px; align-items:baseline; font-size:.95rem; }
.trust li::before { content:"✓"; color:var(--brand); font-weight:700; flex:none; }
.ctas { display:flex; flex-wrap:wrap; gap:10px; }
.btn { display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:0 18px; border-radius:10px; font:inherit; font-weight:600; cursor:pointer; text-decoration:none; }
.btn.primary { background:var(--navy); color:#fff; border:1px solid var(--navy); }
.btn.primary:hover { background:#18305A; }
.btn.ghost { background:#fff; color:var(--navy); border:1px solid var(--line); }
.btn.ghost:hover { border-color:var(--navy); }
.archive { background:var(--navy); color:#E8ECF3; border-radius:16px; padding:22px 22px 18px; }
.archive h2 { font-family:var(--head); font-size:1.1rem; color:#fff; margin:0 0 4px; font-weight:700; }
.archive p { margin:0 0 12px; font-size:.86rem; color:#B9C3D3; }
.archive ul { list-style:none; margin:0; padding:0; }
.archive li { padding:9px 0; border-top:1px solid rgba(255,255,255,.12); font-size:.93rem; display:flex; justify-content:space-between; gap:12px; }
.archive li small { color:#B9C3D3; font-size:.78rem; text-align:right; }
.step { border-top:1px solid var(--line); padding:30px 0 8px; scroll-margin-top:64px; }
.step-h { display:flex; align-items:baseline; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:12px; }
.step-h h2 { font-family:var(--head); font-weight:700; color:var(--navy); font-size:1.3rem; margin:0; line-height:1.35; }
.linkbtn { border:0; background:none; padding:4px 0; font:inherit; color:var(--brand2); cursor:pointer; text-decoration:underline; text-underline-offset:3px; min-height:32px; }
.picker { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:14px; }
.sect { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:14px; }
.sect-l { display:block; color:var(--muted); font-size:.78rem; font-weight:600; letter-spacing:.04em; margin-bottom:8px; }
html[lang="en"] .sect-l { text-transform:uppercase; }
.chips { display:flex; flex-direction:column; gap:6px; }
.aud { text-align:left; border:1px solid var(--line); background:var(--bg); border-radius:10px; padding:9px 12px; cursor:pointer; font:inherit; font-size:.92rem; color:var(--ink); min-height:44px; line-height:1.35; }
.aud:hover { border-color:var(--navy); background:#fff; }
.aud[aria-pressed="true"] { background:var(--navy); border-color:var(--navy); color:#fff; }
.rolebar { display:flex; flex-wrap:wrap; align-items:center; gap:6px 12px; background:var(--card); border:1px solid var(--line); border-radius:12px; padding:10px 14px; }
.rolebar b { color:var(--navy); }
.rolebar .blurb { color:var(--muted); font-size:.88rem; flex-basis:100%; }
.qgrid { display:grid; grid-template-columns:repeat(auto-fill, minmax(320px, 1fr)); gap:12px; margin-top:14px; }
.q { display:flex; flex-direction:column; justify-content:space-between; gap:10px; text-align:left; background:var(--card); border:1px solid var(--line); border-radius:12px; padding:14px 16px; cursor:pointer; font:inherit; font-size:.95rem; color:var(--ink); line-height:1.5; transition:border-color .15s, box-shadow .15s, transform .15s; }
.q:hover { border-color:var(--navy); box-shadow:0 6px 18px rgba(14,31,59,.08); transform:translateY(-1px); }
.q .go { color:var(--brand); font-weight:600; font-size:.85rem; }
.skipnote { color:var(--muted); font-size:.92rem; }
.sitefoot { border-top:1px solid var(--line); margin-top:36px; padding:22px 0 8px; display:flex; flex-wrap:wrap; justify-content:space-between; gap:10px 24px; color:var(--muted); font-size:.85rem; }
.sitefoot a { color:var(--navy); }
.sitefoot b { color:var(--navy); }
@media (prefers-reduced-motion: reduce) { .q { transition:none; } .q:hover { transform:none; } }
@media (max-width: 900px) {
  .hero { grid-template-columns:1fr; grid-template-areas:"intro" "roles" "archive" "foot"; }
  .intro { padding:28px 0 24px; }
  .archive { margin-top:28px; }
  .picker { grid-template-columns:repeat(2, minmax(0,1fr)); }
}
.msg { margin:18px 0; }
.msg.user .bubble { background:#fff3f2; border:1px solid #f3d3d0; border-radius:12px; padding:10px 14px; display:inline-block; max-width:100%; }
.msg.bot .bubble { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:12px 16px; }
.bubble h1,.bubble h2,.bubble h3 { font-size:1.05rem; margin:.8em 0 .3em; }
.bubble p { margin:.45em 0; }
.bubble table { border-collapse:collapse; margin:.6em 0; font-size:.92rem; display:block; overflow-x:auto; }
.bubble th,.bubble td { border:1px solid var(--line); padding:4px 8px; vertical-align:top; }
.bubble a { color:var(--brand2); word-break:break-word; }
.status { color:var(--muted); font-size:.85rem; margin:6px 0; display:flex; flex-wrap:wrap; gap:6px; }
.chip { background:#eef1f4; border-radius:999px; padding:2px 10px; }
.chip.live::after { content:" …"; }
.cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:10px; margin-top:10px; }
.card { background:#fff; border:1px solid var(--line); border-left:4px solid var(--brand); border-radius:10px; padding:10px 12px; font-size:.88rem; }
.card.court { border-left-color:#2f5d8a; } .card.document { border-left-color:#6b6b6b; }
.card .kind { font-size:.72rem; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
.card a.t { font-weight:600; color:var(--ink); text-decoration:none; display:block; margin:2px 0 4px; }
.card a.t:hover { color:var(--brand); }
.card .facts { color:var(--muted); }
.card .src a { display:inline-block; margin:2px 6px 0 0; font-size:.8rem; color:var(--brand2); }
.card .sum { margin:4px 0; display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical; overflow:hidden; }
.meta { color:var(--muted); font-size:.75rem; margin-top:6px; }
.err { color:var(--brand2); background:#fff3f2; border:1px solid #f3d3d0; padding:8px 12px; border-radius:8px; }
.composer { position:fixed; bottom:0; left:0; right:0; background:linear-gradient(transparent, var(--bg) 30%); padding:20px 16px 14px; }
.composer form { max-width:980px; margin:0 auto; display:flex; gap:8px; background:#fff; border:1px solid var(--line); border-radius:14px; padding:8px; box-shadow:0 4px 20px rgba(0,0,0,.06); }
.composer textarea { flex:1; border:0; resize:none; font:inherit; padding:6px 8px; outline:none; max-height:160px; }
.composer button { border:0; background:var(--navy); color:#fff; border-radius:10px; padding:0 18px; font:inherit; cursor:pointer; }
.composer button:disabled { background:#8C96A8; cursor:default; }
.composer .devbtn { border:0; background:none; border-radius:0; padding:0 0 0 6px; cursor:pointer; font:inherit; color:var(--brand2); text-decoration:underline; white-space:nowrap; }
.trace { display:none; margin:6px 0 8px; font-size:.8rem; }
body.dev .trace:not(:empty) { display:block; }
.trace h4 { margin:0 0 4px; font-size:.78rem; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; }
.tc { border:1px solid var(--line); border-radius:8px; background:#fafbfc; margin:4px 0; }
.tc summary { cursor:pointer; padding:4px 8px; overflow-wrap:anywhere; }
.tc.bad summary { color:var(--brand2); }
.tc .tb { padding:2px 8px 6px; }
.tc code { display:block; white-space:pre-wrap; overflow-wrap:anywhere; background:#f1f3f5; border-radius:6px; padding:4px 6px; font-size:.76rem; }
.iconbtn { border:1px solid var(--line); background:#fff; border-radius:8px; padding:4px 10px; cursor:pointer; font:inherit; line-height:1.2; }
.scrim { position:fixed; inset:0; background:rgba(0,0,0,.25); z-index:15; }
.drawer { position:fixed; top:0; left:0; bottom:0; width:min(340px, 88vw); background:#fff; border-right:1px solid var(--line); box-shadow:4px 0 20px rgba(0,0,0,.08); z-index:20; display:flex; flex-direction:column; }
.drawer[hidden], .scrim[hidden] { display:none; }
.dhead { display:flex; align-items:center; gap:8px; padding:12px 14px; border-bottom:1px solid var(--line); }
.dhead b { flex:1; }
.dnote { color:var(--muted); font-size:.75rem; padding:6px 14px 0; }
#dlist { overflow:auto; padding:6px 8px 16px; }
.ci { display:flex; align-items:stretch; gap:4px; margin:4px 0; }
.cio { flex:1; min-width:0; text-align:left; border:1px solid var(--line); background:#fbfbfc; border-radius:8px; padding:6px 10px; cursor:pointer; font:inherit; font-size:.88rem; color:var(--ink); }
.cio:hover, .ci.on .cio { border-color:var(--brand); background:#fff; }
.cio span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cio small { color:var(--muted); font-size:.72rem; }
.cid { border:1px solid var(--line); background:#fff; border-radius:8px; cursor:pointer; color:var(--muted); padding:0 10px; font:inherit; }
.cid:hover { color:var(--brand2); border-color:var(--brand2); }
.dempty { color:var(--muted); font-size:.88rem; padding:10px 6px; }
.savewarn { max-width:980px; margin:6px auto 0; color:#8E1B22; background:#FFF3F2; border:1px solid #F3D3D0; border-radius:8px; padding:4px 10px; font-size:.78rem; text-align:center; }
/* Sign-in box on the landing page; the account line (#who) sits in the footer */
.authbox { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; margin:0 0 1em; }
.authbox span { color:var(--muted); font-size:.9rem; }
.who button, .who .lnk { border:0; background:none; padding:0; cursor:pointer; font:inherit; color:var(--brand2); text-decoration:underline; }
.foot { max-width:980px; margin:6px auto 0; color:var(--muted); font-size:.72rem; text-align:center; }
.newbtn, .seg button { white-space:nowrap; }
@media (max-width: 560px) {
  .bar { gap:8px; padding:8px 12px; }
  .logo img { height:24px; }
  .logo small { display:none; }
  main { padding:0 14px 150px; }
  .newbtn, .seg button { padding:5px 8px; font-size:.85rem; }
  .iconbtn { padding:4px 8px; }
  .lead { font-size:1rem; }
  .picker { grid-template-columns:1fr; gap:10px; }
  .chips { flex-direction:row; flex-wrap:wrap; }
  .aud { font-size:.88rem; padding:7px 12px; }
  .qgrid { grid-template-columns:1fr; }
  .archive { padding:18px; }
  .ctas .btn { flex:1 1 auto; white-space:nowrap; padding-left:14px; padding-right:14px; }
}
/* Phones: the header keeps the chats button, logo, "+" (new conversation) and the language switch
   on one line; the new-conversation label would push the switch off screen. */
.nwplus { display:none; font-weight:700; }
@media (max-width: 480px) {
  .nwplus { display:inline; }
  .nwlabel { display:none; }
  .newbtn { padding:5px 11px; }
}
.logo { min-width:0; flex-shrink:1; }
body.chatting .newbtn { display:inline-flex; }
.newbtn { display:none; }
