/* ---------- fonts (self-hosted) ---------- */
@font-face { font-family: 'Mukta'; font-weight: 400; font-display: swap; src: url(/fonts/mukta-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122, U+2190-2199; }
@font-face { font-family: 'Mukta'; font-weight: 600; font-display: swap; src: url(/fonts/mukta-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122, U+2190-2199; }
@font-face { font-family: 'Mukta'; font-weight: 700; font-display: swap; src: url(/fonts/mukta-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122, U+2190-2199; }
@font-face { font-family: 'Mukta'; font-weight: 400; font-display: swap; src: url(/fonts/mukta-devanagari-400-normal.woff2) format('woff2'); unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF; }
@font-face { font-family: 'Mukta'; font-weight: 600; font-display: swap; src: url(/fonts/mukta-devanagari-600-normal.woff2) format('woff2'); unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF; }
@font-face { font-family: 'Mukta'; font-weight: 700; font-display: swap; src: url(/fonts/mukta-devanagari-700-normal.woff2) format('woff2'); unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF; }
@font-face { font-family: 'Tiro'; font-weight: 400; font-display: swap; src: url(/fonts/tiro-devanagari-hindi-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2190-2199; }
@font-face { font-family: 'Tiro'; font-weight: 400; font-display: swap; src: url(/fonts/tiro-devanagari-hindi-devanagari-400-normal.woff2) format('woff2'); unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF; }

/* ---------- tokens ---------- */
:root {
  --coat: #1C2230;      /* advocate's coat */
  --coat-2: #2A3244;
  --paper: #EEF1F3;     /* page */
  --sheet: #FFFFFF;     /* cards */
  --manila: #E6D9B8;    /* case-file tab */
  --ink: #1F2633;       /* text */
  --muted: #667085;
  --line: #DCE1E6;
  --red: #A8322A;       /* declined / rejected */
  --green: #2D6A4F;     /* accepted */
  --blue: #2E4A7D;      /* forwarded */
  --amber: #8A5A12;     /* waiting */
  --serif: 'Tiro', Georgia, 'Noto Serif Devanagari', serif;
  --sans: 'Mukta', -apple-system, 'Segoe UI', 'Noto Sans Devanagari', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--paper); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- trilingual text: English, then one quiet line of Hinglish + Hindi ---------- */
.tri { display: inline-flex; flex-direction: column; line-height: 1.25; }
.tri .alt { font-size: .74em; font-weight: 400; color: var(--muted); display: flex; flex-wrap: wrap; column-gap: .7em; margin-top: 1px; }
.tri .hi { font-family: var(--sans); }
.tri.inline { display: inline; }
.tri.inline .alt { display: inline; margin-left: .45em; }
.tri.inline .alt .hi { margin-left: .5em; }
button .tri .alt, .on-dark .tri .alt { color: inherit; opacity: .72; }
h1 .tri .alt, h2 .tri .alt, h3 .tri .alt { font-family: var(--sans); font-size: .5em; margin-top: 4px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--coat); color: #fff;
  display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-name { font-family: var(--serif); font-size: 20px; line-height: 1; }
.brand-sub { font-size: 11px; opacity: .7; margin-top: 3px; }
#userbox { display: flex; gap: 6px; align-items: center; }
.who { text-align: right; font-size: 13px; line-height: 1.2; margin-right: 4px; }
.who small { opacity: .65; display: block; }
.icon-btn { background: transparent; border: 1px solid rgba(255,255,255,.22); color: #fff; padding: 7px; border-radius: 8px; display: inline-flex; }
.icon-btn:hover { background: rgba(255,255,255,.08); }

main { max-width: 760px; margin: 0 auto; padding: 20px 16px 80px; }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; color: var(--ink); }
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 23px; line-height: 1.2; margin-bottom: 14px; }
h3 { font-size: 18px; line-height: 1.3; }
.muted { color: var(--muted); font-size: 14px; }

/* ---------- forms ---------- */
label { display: block; font-size: 14px; font-weight: 600; margin: 16px 0 6px; }
input, select, textarea { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 16px; background: #fff; color: var(--ink); }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,74,125,.12); }
::placeholder { color: #A0A8B5; }

/* ---------- buttons ---------- */
button { cursor: pointer; border: 1px solid transparent; border-radius: 8px; padding: 10px 16px; font: inherit;
  font-size: 15px; font-weight: 600; background: var(--coat); color: #fff; text-align: center; }
button:hover { background: var(--coat-2); }
button.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
button.secondary:hover { background: #F6F7F9; }
button.success { background: var(--green); }
button.danger { background: #fff; color: var(--red); border-color: #E7C3BF; }
button.danger:hover { background: #FBF1F0; }
button.danger.solid { background: var(--red); color: #fff; }
button.link { background: none; border: none; color: var(--blue); padding: 6px 0; font-weight: 600; }
button.block { width: 100%; margin-top: 22px; padding: 13px; }
button:disabled { opacity: .55; cursor: default; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.actions .link { margin-left: auto; }

/* ---------- tabs (underline) ---------- */
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; color: var(--muted); border: none; border-radius: 0; padding: 8px 0 10px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; text-align: left; flex-shrink: 0; }
.tabs button:hover { background: none; color: var(--ink); }
.tabs button.active { color: var(--ink); border-bottom-color: var(--coat); }

/* ---------- panels ---------- */
.panel { background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; padding: 22px 20px; }
.hint { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); margin-top: 14px; }
.hint svg { flex-shrink: 0; margin-top: 2px; }

/* ---------- auth ---------- */
.auth-hero { background: var(--coat); color: #fff; margin: -20px -16px 0; padding: 36px 24px 72px; }
.auth-hero h1 { color: #fff; max-width: 15em; }
.auth-hero .tri .alt { color: #fff; opacity: .65; }
.steps { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 14px; max-width: 30em; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; font-size: 15px; }
.steps .n { width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35);
  display: grid; place-items: center; font-family: var(--serif); font-size: 14px; }
.auth-card { position: relative; margin: -44px auto 0; max-width: 440px; }
.auth-card .tabs { margin-bottom: 6px; }

/* ---------- case file (query card) ---------- */
.cases { display: grid; gap: 10px; }
.case { position: relative; background: var(--sheet); border: 1px solid var(--line); border-radius: 0 12px 12px 12px;
  padding: 18px 20px 16px; margin-top: 30px; }
.case-tab { position: absolute; top: -27px; left: -1px; background: var(--manila); color: #5B4A22;
  font-size: 13px; font-weight: 600; padding: 4px 14px 3px; border-radius: 8px 8px 0 0; border: 1px solid #D6C79F; border-bottom: none; }
.case-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.case-type { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.case-desc { margin: 12px 0 0; white-space: pre-wrap; color: #39414F; font-size: 15px; line-height: 1.6; }
.case-date { font-size: 13px; color: var(--muted); margin-top: 12px; }
.case-wait { font-size: 14px; color: var(--muted); margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }

/* rubber stamp status */
.stamp { flex-shrink: 0; transform: rotate(-4deg); border: 2px solid currentColor; border-radius: 6px;
  padding: 3px 9px 2px; font-family: var(--serif); font-size: 15px; line-height: 1.2; color: var(--amber); background: rgba(255,255,255,.6); }
.stamp .tri .alt { color: currentColor; opacity: .8; font-family: var(--sans); }
.st-ACCEPTED { color: var(--green); }
.st-FORWARDED { color: var(--blue); }
.st-DECLINED, .st-REJECTED { color: var(--red); }
.st-CLOSED { color: #6B7280; }

/* note from operator / lawyer */
.note { margin-top: 14px; padding: 10px 14px; background: #F7F8FA; border-left: 3px solid var(--manila); border-radius: 0 8px 8px 0; font-size: 14px; }
.note b { display: block; font-size: 13px; margin-bottom: 2px; }

/* person (lawyer or client) revealed after acceptance */
.person { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.person-head { display: flex; gap: 12px; align-items: center; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--coat); color: #fff; display: grid; place-items: center;
  font-family: var(--serif); font-size: 17px; flex-shrink: 0; }
.person-role { font-size: 13px; color: var(--muted); }
.person-name { font-weight: 600; font-size: 17px; line-height: 1.25; }
.contact-list { list-style: none; padding: 0; margin: 12px 0 0 56px; display: grid; gap: 6px; font-size: 15px; }
.contact-list li { display: flex; gap: 9px; align-items: center; }
.contact-list svg { color: var(--muted); flex-shrink: 0; }
.locked { display: flex; gap: 8px; align-items: center; margin-top: 14px; font-size: 14px; color: var(--muted); }

/* ---------- operator filters ---------- */
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.filter { flex-shrink: 0; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.filter:hover { background: #fff; border-color: #B9C1CC; }
.filter .count { background: var(--paper); border-radius: 999px; padding: 0 8px; font-size: 13px; }
.filter.active { background: var(--coat); color: #fff; border-color: var(--coat); }
.filter.active .count { background: rgba(255,255,255,.18); }
.filter.urgent .count { background: #F6E7C8; color: var(--amber); }
.case-people { display: grid; gap: 4px; margin-top: 12px; font-size: 14px; }
.case-people span { color: var(--muted); display: inline-block; min-width: 56px; }

/* ---------- lists (lawyers, clients, types) ---------- */
.list { background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-main { min-width: 0; display: flex; gap: 12px; align-items: flex-start; }
.list-sub { font-size: 14px; color: var(--muted); margin-top: 2px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-size: 12px; background: var(--paper); border-radius: 6px; padding: 2px 8px; color: #48505E; }
.pill-off { font-size: 12px; color: var(--red); border: 1px solid #E7C3BF; border-radius: 999px; padding: 0 8px; margin-left: 6px; vertical-align: middle; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; }
.toolbar h2 { margin: 0; }

/* ---------- empty ---------- */
.empty { text-align: center; color: var(--muted); padding: 48px 16px; border: 1px dashed #C9D0D8; border-radius: 12px; }
.empty .tri .alt { justify-content: center; }
.empty button { margin-top: 14px; }

/* ---------- modal / toast ---------- */
.modal { position: fixed; inset: 0; background: rgba(20,24,33,.5); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.modal-card { background: #fff; width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; border-radius: 16px 16px 0 0; padding: 22px 20px 24px; }
.modal-card h3 { margin-bottom: 4px; }
@media (min-width: 640px) { .modal { align-items: center; } .modal-card { border-radius: 14px; padding: 26px; } }
.hidden { display: none !important; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--coat); color: #fff;
  padding: 12px 18px; border-radius: 10px; z-index: 60; font-size: 14px; max-width: min(92%, 520px); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.toast.err { background: var(--red); }
.timeline { list-style: none; padding: 0; margin: 16px 0 0; border-left: 2px solid var(--line); }
.timeline li { padding: 0 0 14px 16px; position: relative; font-size: 14px; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--manila); border: 2px solid #fff; }
.checks { display: grid; grid-template-columns: 1fr; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; }
.checks label { font-weight: 400; display: flex; gap: 10px; align-items: center; margin: 6px 0; }
.checks input { width: 18px; height: 18px; accent-color: var(--coat); }

@media (min-width: 720px) {
  main { padding-top: 28px; }
  .auth-hero { margin: -28px calc(50% - 50vw) 0; padding: 56px calc(50vw - 360px) 88px; }
  h1 { font-size: 38px; }
  .checks { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) { .who { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* language selector */
select.lang { width: auto; padding: 6px 28px 6px 10px; font-size: 14px; border-radius: 8px; appearance: none; -webkit-appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23667085' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center; }
select.lang.on-dark { background-color: transparent; color: #fff; border-color: rgba(255,255,255,.25);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23ffffff' stroke-width='1.5'/%3E%3C/svg%3E"); }
select.lang.on-dark option { color: var(--ink); }
.auth-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.auth-top select { flex-shrink: 0; margin-top: 4px; }
.steps li .tri .alt { color: #fff; }
.case-people a { color: var(--blue); }
.note b .tri .alt { display: none; }
