/* Theme: court paperwork - stamp-violet ink on paper, red tape as the one accent. */
:root {
  --gold: #3d2e7c;        /* stamp violet: primary (name kept so existing rules keep working) */
  --gold-dark: #2a1f5c;
  --gold-soft: #4b3d96;
  --tape: #b0201f;        /* red tape: used sparingly */
  --bg: #fbfbfc;
  --bg-2: #f1f2f6;
  --bg-3: #e6e8ef;
  --line: #d9dbe4;
  --line-2: #c4c7d4;
  --text: #1e2240;
  --text-2: #3f4463;
  --muted: #646a82;
  --danger: #b42318;
  --ok: #2f6b3a;
  --head: 'Spectral', Georgia, serif;
  --body: 'Public Sans', system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 16px; line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-dark); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
::selection { background: var(--gold); color: #fff; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--head); font-weight: 700; color: var(--text); letter-spacing: -.01em; }
h2 { font-size: 34px; line-height: 1.2; margin: 0 0 20px; }
h3 { font-size: 21px; margin: 0 0 16px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* ---------- header ---------- */
.topbar { background: #fff; color: var(--text); border-top: 5px solid var(--tape); border-bottom: 1px solid var(--line); padding: 10px clamp(16px, 5vw, 40px); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; position: sticky; top: 0; z-index: 20; }
.brand { font-family: var(--head); font-weight: 700; font-size: 21px; color: var(--text); padding: 10px 0; }
.brand:hover { color: var(--gold); text-decoration: none; }
.topbar nav { display: flex; gap: clamp(12px, 2.4vw, 22px); font-size: 14.5px; font-weight: 500; flex-wrap: wrap; }
.topbar nav a { color: var(--text-2); padding-bottom: 2px; border-bottom: 2px solid transparent; }
.topbar nav a:hover { color: var(--gold); text-decoration: none; border-bottom-color: var(--line-2); }
.topbar nav a.active { color: var(--gold); font-weight: 700; border-bottom-color: var(--gold); }
.menu-btn { display: none; background: none; border: 1.5px solid var(--line-2); color: var(--text); font-size: 20px; border-radius: 4px; padding: 4px 10px; cursor: pointer; }
@media (max-width: 760px) {
  .menu-btn { display: block; }
  .topbar nav { display: none; width: 100%; flex-direction: column; gap: 0; padding-bottom: 6px; }
  .topbar nav.open { display: flex; }
  .topbar nav a { padding: 10px 2px; border-bottom: 1px solid var(--line); }
  .topbar nav a.active { border-bottom-color: var(--line); }
}

/* ---------- layout ---------- */
.page { padding: 72px clamp(16px, 6vw, 40px); }
.band { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.wrap { max-width: 820px; margin: 0 auto; }
.hero { padding: clamp(56px, 12vw, 112px) clamp(20px, 6vw, 40px) 96px; max-width: 900px; margin: 0 auto; }
.hero h1 { font-size: clamp(34px, 7vw, 58px); line-height: 1.08; margin: 0 0 24px; padding-left: clamp(16px, 3vw, 28px); border-left: 6px solid var(--tape); max-width: 16ch; }
.hero p { font-size: 19px; line-height: 1.7; color: var(--text-2); max-width: 62ch; margin: 0 0 36px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.lead { font-size: 17px; line-height: 1.8; color: var(--text-2); margin: 0 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.center { text-align: center; }
.gold { color: var(--gold-soft); }
.warn { color: #8a5a00; }
.row { display: flex; gap: 10px; align-items: center; }
.wrap-row { flex-wrap: wrap; }
.grow { flex: 1; min-width: 200px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-bottom: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--gold); color: var(--bg); border: 1.5px solid var(--gold); padding: 12px 22px; border-radius: 4px; font: 600 15px var(--body); cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .15s, color .15s, border-color .15s; }
.btn:hover { background: var(--gold-dark); border-color: var(--gold-dark); color: var(--bg); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: wait; }
.btn-outline { background: transparent; color: var(--gold); }
.btn-outline:hover { background: var(--gold); color: var(--bg); }
.btn-outline-light { background: transparent; color: var(--text); border-color: var(--text-2); }
.btn-outline-light:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--bg-3); color: var(--text); border-color: var(--muted); }
.btn-light { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-light:hover { background: var(--gold); border-color: var(--gold); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid #e3a8a2; }
.btn-danger:hover { background: #fbe7e6; color: var(--danger); border-color: var(--danger); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #3a8448; border-color: #3a8448; color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 13.5px; }
.link-strong { display: inline-block; margin-bottom: 24px; font-weight: 600; font-size: 14.5px; }

/* ---------- forms ---------- */
.input { width: 100%; padding: 11px 12px; background: #fff; color: var(--text); border: 1px solid var(--line-2); border-radius: 4px; font: 15px var(--body); }
.input::placeholder { color: #7d8590; }
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(61,46,124,.15); }
.input-lg { padding: 14px 18px; font-size: 16px; border-width: 1.5px; margin-bottom: 14px; }
textarea.input { resize: vertical; }
select.input { cursor: pointer; }
.field-label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.field-label.inline .input { margin-top: 0; }
.checks { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.checks legend { margin-bottom: 6px; padding: 0; }
.checks label { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--text-2); cursor: pointer; }
.checks input { accent-color: var(--gold); width: 16px; height: 16px; }
.form-error { color: var(--danger); font-size: 13.5px; }
.file-label { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
input[type=file] { font: 14px var(--body); color: var(--text-2); }
input[type=file]::file-selector-button { background: var(--bg-3); color: var(--text); border: 1px solid var(--line-2); border-radius: 3px; padding: 7px 12px; margin-right: 10px; cursor: pointer; font: 600 13px var(--body); }

/* ---------- panels ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 26px; margin-bottom: 22px; }
.band .panel { background: #fff; }
.panel.narrow { max-width: 400px; }
.panel-title { font-family: var(--head); font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.notice { background: #f0eef8; border: 1px solid #cfc8ea; border-radius: 4px; padding: 16px 20px; font-size: 14.5px; color: var(--text); margin-bottom: 20px; }
.notice.dark { background: var(--bg-2); border-color: var(--line); text-align: center; }
.callout { background: var(--text); color: var(--bg); border-radius: 4px; padding: 26px 30px; display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap; margin-bottom: 36px; }
.callout .eyebrow { color: #b9b3da; }
.callout .btn { background: #fff; color: var(--text); border-color: #fff; }
.callout .btn:hover { background: var(--bg-3); border-color: var(--bg-3); color: var(--text); }
.callout-title { font-family: var(--head); font-size: 20px; font-weight: 700; }
.callout .gold { color: #fff; border-bottom: 2px solid var(--tape); }
.eyebrow { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.steps { font-size: 16px; line-height: 1.9; color: var(--text-2); margin: 0 0 36px; padding-left: 22px; }

/* keyword tables */
.kw-group { margin-bottom: 28px; }
.kw-title, .court-title { font: 700 19px var(--head); color: var(--text); margin-bottom: 10px; }
.kw-table { background: #fff; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.kw-row { display: flex; padding: 13px 20px; border-bottom: 1px solid var(--line); gap: 16px; flex-wrap: wrap; }
.kw-row:last-child { border-bottom: 0; }
.kw-name { flex: 1 1 220px; font-weight: 600; font-size: 14.5px; }
.kw-keys { font-size: 14.5px; color: var(--gold); font-family: ui-monospace, Consolas, monospace; }

/* directory cards */
.adv-card { border: 1px solid var(--line); border-radius: 4px; padding: 20px 24px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; background: #fff; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--gold); color: var(--bg); display: flex; align-items: center; justify-content: center; font: 700 18px var(--head); flex-shrink: 0; }
.adv-main { flex: 1; min-width: 180px; }
.adv-name { font-weight: 600; font-size: 16.5px; }
.adv-line { font-size: 14.5px; color: var(--text-2); margin-top: 2px; }
.adv-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.adv-actions { display: flex; gap: 10px; }
.report-link { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.report-form { border: 1px solid var(--line); border-radius: 4px; padding: 14px; margin-top: 10px; max-width: 380px; }
.report-form .input { padding: 9px 10px; font-size: 14px; }

/* drafts */
.court-group { margin-bottom: 26px; }
.draft { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 16px 20px; margin-bottom: 10px; }
.draft-head { font-weight: 600; font-size: 15.5px; }
.draft-sub { font-size: 14px; color: var(--muted); margin-top: 3px; }
.draft a { display: inline-block; margin-top: 8px; font-size: 13.5px; font-weight: 600; }

/* admin */
.admin { background: var(--bg-2); border-top: 3px solid var(--gold); }
.tag { display: inline-block; background: var(--text); color: var(--bg); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 6px 14px; border-radius: 2px; margin-bottom: 16px; }
.admin-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; }
.stat b { display: block; font: 700 24px var(--head); color: var(--gold); }
.stat span { font-size: 13px; color: var(--muted); }
.list-panel { padding: 18px 20px; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.list-head h3 { margin: 0; }
.item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.item:last-child { border-bottom: 0; }
.item-main { font-size: 14.5px; flex: 1; min-width: 220px; }
.item-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.pill { font-size: 12px; font-weight: 700; color: var(--gold); text-transform: uppercase; margin-right: 8px; letter-spacing: .04em; }
.empty { font-size: 14px; color: var(--muted); font-style: italic; padding: 8px 4px; }
.tools { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.status { font-size: 13.5px; color: var(--gold); margin-top: 8px; min-height: 1em; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: 20px; padding: 5px 6px 5px 14px; font-size: 13px; color: var(--text-2); }
.chip button { background: var(--gold); color: var(--bg); border: none; width: 22px; height: 22px; border-radius: 50%; font-weight: 700; cursor: pointer; line-height: 1; }
.chip button:hover { background: var(--danger); color: #fff; }
.contacts { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.contacts .input { padding: 8px 10px; }
.edit-form { display: flex; flex-direction: column; gap: 8px; max-width: 440px; width: 100%; padding: 6px 0; }
.edit-form .input { padding: 9px 10px; font-size: 14px; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.reg-detail { font-size: 13px; color: var(--text-2); margin-top: 6px; line-height: 1.6; }
.reg-detail b { color: var(--muted); font-weight: 600; }
details summary { cursor: pointer; color: var(--gold); font-size: 13px; margin-top: 4px; }

/* contact */
.contact { background: var(--text); color: var(--bg); min-height: 70vh; }
.contact h2 { color: var(--bg); font-size: 28px; }
.contact .eyebrow { color: #b9b3da; }
.contact-name { font-size: 17px; font-weight: 600; }
.contact a { color: #fff; font-size: 16px; font-weight: 600; text-decoration: underline; text-decoration-color: var(--tape); text-underline-offset: 4px; }
.contact-addr { font-size: 16px; line-height: 1.6; }

/* Adv. Ruby Singh: photos and credit */
.hero-split { max-width: 1120px; display: grid; grid-template-columns: 1fr minmax(260px, 420px); gap: clamp(20px, 4vw, 48px); align-items: end; padding-bottom: 0; }
.hero-text { padding-bottom: 96px; align-self: center; }
.hero-photo { margin: 0; position: relative; }
.hero-photo img { display: block; width: 100%; height: auto; max-height: 640px; object-fit: contain; object-position: bottom; }
.hero-photo figcaption { position: absolute; left: 0; bottom: 28px; background: rgba(255,255,255,.94); padding: 10px 14px; border-radius: 4px; border-left: 4px solid var(--tape); font-size: 13.5px; color: var(--text-2); box-shadow: 0 2px 10px rgba(30,34,64,.12); }
.hero-photo figcaption b { display: block; color: var(--text); font: 700 17px var(--head); }
.about-photo figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; line-height: 1.45; }
.about-photo figcaption b { display: block; color: var(--text); font: 700 18px var(--head); }
.about-photo { float: right; width: min(260px, 40%); margin: 4px 0 20px 28px; }
.about-photo img { display: block; width: 100%; height: auto; }
.contact-person { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; margin: 8px 0 36px; }
.contact-person img { width: 140px; height: auto; }
.contact-person .contact-addr { margin: 4px 0 8px; color: #c9cce0; font-size: 15px; }
.credit { display: flex; align-items: center; gap: 16px; max-width: 820px; margin: 0 auto; padding: 22px clamp(16px, 6vw, 40px); }
.credit img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid var(--line); }
.credit p { margin: 0; font-size: 14px; color: var(--text-2); }
@media (max-width: 760px) {
  .hero-split { grid-template-columns: 1fr; }
  .hero-text { padding-bottom: 24px; }
  .hero-photo { max-width: 300px; margin: 0 auto; }
  .hero-photo img { max-height: 440px; }
  .about-photo { float: none; width: 100%; max-width: 280px; margin: 0 0 20px; }
}
.foot { border-top: 1px solid var(--line); padding: 22px clamp(16px, 6vw, 40px); font-size: 13.5px; color: var(--muted); text-align: center; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 4px; font-weight: 600; font-size: 14.5px; box-shadow: 0 6px 24px rgba(0,0,0,.4); z-index: 50; max-width: calc(100% - 32px); }
.toast.error { background: #5a1e1e; color: #fff; }

/* admin tabs + bot panel */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-2); margin-bottom: 22px; }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); font: 600 15px var(--body); padding: 10px 18px; cursor: pointer; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.upload-box { border: 1.5px dashed #cfc8ea; border-radius: 6px; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; background: #f6f4fc; }
.raw { white-space: pre-wrap; font: 12px/1.5 ui-monospace, Consolas, monospace; color: var(--text-2); background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 12px; max-height: 320px; overflow: auto; }
#rosterRaw { margin-bottom: 14px; }
.roster-toolbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 10px; }
.roster-toolbar .field-label { width: 170px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; max-height: 620px; overflow-y: auto; }
.roster-table { border-collapse: collapse; width: 100%; min-width: 1100px; font-size: 13.5px; }
.roster-table th { position: sticky; top: 0; background: var(--bg-3); color: var(--muted); font-weight: 600; text-align: left; padding: 8px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; z-index: 1; }
.roster-table td { padding: 3px; border-top: 1px solid var(--line); vertical-align: top; }
.roster-table td:first-child { color: var(--muted); padding: 10px 6px; width: 34px; text-align: right; }
.roster-table .input { padding: 7px 8px; font-size: 13.5px; border-color: transparent; background: transparent; }
.roster-table .input:hover { border-color: var(--line-2); }
.roster-table .input:focus { background: #fff; }
.roster-table textarea.input { resize: vertical; min-height: 34px; line-height: 1.35; }
.roster-table tr.vacant td { background: rgba(224, 82, 82, .07); }
.roster-table tr.vacant select { color: var(--danger); }
.roster-table tr.flag td:first-child { color: #8a5a00; }
.roster-table .w-desig { min-width: 260px; } .roster-table .w-short { width: 90px; } .roster-table .w-judge { min-width: 180px; }
.roster-table .w-room { width: 120px; } .roster-table .w-status { width: 100px; } .roster-table .w-date { width: 110px; } .roster-table .w-loc { width: 100px; }
.roster-table .del { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; padding: 6px 8px; }
.roster-table .del:hover { color: var(--danger); }
.roster-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.pill-ok { font-size: 11.5px; font-weight: 700; background: #e3f2e6; color: #1e6b33; border-radius: 10px; padding: 2px 8px; margin-left: 8px; }
.pill-old { font-size: 11.5px; color: var(--muted); margin-left: 8px; }
.link-form { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr auto; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.link-form .input, .link-edit .input { padding: 8px 10px; font-size: 14px; }
.link-edit { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr auto; gap: 8px; width: 100%; padding: 4px 0; }
@media (max-width: 700px) { .link-form, .link-edit { grid-template-columns: 1fr; } }
.mono { font: 13px/1.55 ui-monospace, Consolas, monospace; }
.admin .wrap { max-width: 1100px; }
.roster-table td:nth-child(5) { min-width: 140px; }
#leaveForm .grid-auto { align-items: end; }

/* bot sub-sections */
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 20px; }
.subtab { background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text-2); font: 600 13.5px var(--body); padding: 8px 14px; border-radius: 20px; cursor: pointer; }
.subtab:hover { color: var(--text); border-color: var(--muted); }
.subtab.active { background: var(--gold); border-color: var(--gold); color: var(--bg); }
.input-sm { padding: 7px 10px; font-size: 13.5px; width: auto; }
.switch-row { display: flex; align-items: center; gap: 10px; font-size: 14.5px; cursor: pointer; }
.switch-row input { width: 18px; height: 18px; accent-color: var(--gold); }
.copy-box { display: grid; gap: 10px; background: #fff; border: 1px dashed var(--line-2); border-radius: 4px; padding: 12px 14px; }
.copy-box > div { display: flex; flex-direction: column; gap: 3px; }
.copy-box code { font: 13px ui-monospace, Consolas, monospace; color: var(--gold); word-break: break-all; user-select: all; }
.copy-box .btn { align-self: flex-start; }
.badge { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 12px; }
.badge.on { background: #e3f2e6; color: #1e6b33; } .badge.off { background: #fbe7e6; color: #a12622; } .badge.half { background: #fbf0d9; color: #7a5200; }

/* WhatsApp-like preview */
.wa-preview { margin-top: 16px; background: #0b141a; border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.wa-meta { font-size: 12px; color: var(--muted); }
.wa-bubble { background: #202c33; color: #e9edef; border-radius: 8px; padding: 8px 10px; max-width: 520px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.wa-bubble.user { align-self: flex-end; background: #005c4b; }
.wa-bubble img { display: block; max-width: 100%; max-height: 360px; border-radius: 6px; margin-bottom: 4px; }
.wa-bubble .doc { display: flex; gap: 8px; align-items: center; }
.wa-bubble .cap { font-size: 13px; color: #aebac1; }

/* message log */
.msg { padding: 12px 4px; border-bottom: 1px solid var(--line); }
.msg:last-child { border-bottom: 0; }
.msg-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.msg-q { font-weight: 600; font-size: 15px; color: var(--text); }
.msg-r { font-size: 13px; color: var(--text-2); margin-top: 4px; white-space: pre-wrap; max-height: 4.5em; overflow: hidden; }
.via { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 8px; background: var(--bg-3); color: var(--muted); }
.via.notfound, .via.non-text, .via.err { background: #fbe7e6; color: #a12622; } .via.ai { background: #e3ecfa; color: #1d4e89; }
.via.code, .via.surname, .via.room, .via.taluka { background: #e3f2e6; color: #1e6b33; }

/* room maps */
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.map-card { border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; display: flex; flex-direction: column; }
.map-thumb { height: 130px; background: var(--bg-3); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.map-thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.map-body { padding: 10px 12px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.map-title { font-weight: 700; font-size: 14.5px; }
.map-courts { font-size: 12.5px; color: var(--muted); line-height: 1.4; flex: 1; }
.map-actions { display: flex; gap: 6px; margin-top: 6px; }
.answer-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.folder-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line-2); margin: 14px 0 18px; }
.folder-tab { background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); font: 600 14.5px var(--body); padding: 9px 14px; cursor: pointer; margin-bottom: -1px; }
.folder-tab:hover { color: var(--text); }
.folder-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.folder-tab span { font-size: 12px; color: var(--muted); font-weight: 500; }
.folder-path { margin-top: 14px; } .folder-path code { color: var(--gold); word-break: break-all; }
.dagadi-box { display: grid; grid-template-columns: minmax(220px, 360px) 1fr; gap: 18px; align-items: start; }
@media (max-width: 700px) { .dagadi-box { grid-template-columns: 1fr; } }
.map-thumb.big { height: 230px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.place { display: flex; gap: 10px; align-items: flex-start; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.place input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--gold); }
.place .sub { font-size: 12.5px; color: var(--muted); }
.sync-box { display: flex; justify-content: space-between; gap: 14px; align-items: center; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; margin-bottom: 16px; }
.src { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 8px; margin-left: 6px; text-transform: uppercase; letter-spacing: .03em; }
.src.court { background: #e3ecfa; color: #1d4e89; } .src.manual { background: var(--bg-3); color: var(--muted); }
.incharge-edit { display: flex; gap: 6px; margin-top: 6px; max-width: 420px; }
.incharge-edit .input { padding: 6px 9px; font-size: 13px; }
/* court finder */
[data-page="courts"] .wrap { max-width: 1000px; }
.finder-top { display: grid; grid-template-columns: 1fr 200px; gap: 32px; align-items: end; border-bottom: 1px solid var(--line); }
.finder-main { padding-bottom: 28px; }
.finder-photo { margin: 0; }
.finder-photo img { display: block; width: 100%; height: auto; max-height: 340px; object-fit: contain; object-position: bottom; }
@media (max-width: 760px) { .finder-top { grid-template-columns: 1fr; border-bottom: 0; } .finder-photo { display: none; } .finder-main { padding-bottom: 0; } }
.finder-form { display: flex; gap: 10px; align-items: stretch; }
.finder-form .input-lg { margin-bottom: 0; }
.finder-chip { cursor: pointer; padding-right: 14px; }
.finder-chip:hover { border-color: var(--gold); color: var(--text); }
.finder-results { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.finder-card { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 4px; padding: 16px 20px; white-space: pre-wrap; line-height: 1.6; font-size: 15.5px; }
.finder-card.minor { border-left-color: var(--line-2); font-size: 14px; color: var(--text-2); }
.finder-card hr { border: 0; border-top: 1px solid var(--line-2); margin: 4px 0; }
.finder-card b { color: var(--text); }
.finder-map { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 10px; }
.finder-map img { display: block; width: 100%; max-height: 520px; object-fit: contain; background: #fff; border-radius: 3px; }
.finder-map figcaption { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
@media (max-width: 600px) { .finder-form { flex-direction: column; } }

.consent{display:flex;gap:8px;align-items:flex-start;line-height:1.4}
.consent input{margin-top:3px}
#bridgeMailPanel h4{margin:18px 0 6px}

.plate-input{text-transform:uppercase;letter-spacing:.06em;font-weight:600}
.park-card{border:1px solid var(--line);border-left:4px solid var(--gold);background:#fff;border-radius:8px;padding:12px 14px;margin-top:12px}
.park-card .plate{font-size:1.15rem;font-weight:700;letter-spacing:.08em;background:#fff;color:#111;display:inline-block;padding:2px 10px;border-radius:4px;border:2px solid #111;margin-bottom:6px}
.park-card .actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.park-row{display:flex;gap:10px;align-items:center;justify-content:space-between;padding:8px 0;border-bottom:1px solid var(--line)}
.park-row .plate-sm{font-weight:700;letter-spacing:.05em;min-width:120px}

.park-register summary{cursor:pointer;list-style:revert}
.park-alert{margin-top:10px}

.pdf-import{margin-top:16px;border:1px solid var(--line);border-radius:6px;padding:12px 14px}
.pdf-import summary{cursor:pointer;list-style:revert}
.pbar{height:6px;background:var(--bg-3);border-radius:4px;margin-top:6px;overflow:hidden}
.pbar>div{height:100%;background:var(--gold);transition:width .3s}
.pdf-table-wrap{overflow:auto;max-height:560px;margin-top:10px}
.pdf-table{border-collapse:collapse;width:100%;font-size:13px}
.pdf-table th{position:sticky;top:0;background:var(--gold);color:#fff;text-align:left;padding:6px;white-space:nowrap}
.pdf-table td{border-bottom:1px solid var(--line);padding:3px;vertical-align:top}
.pdf-table td input{width:100%;min-width:110px;background:transparent;color:inherit;border:1px solid transparent;padding:4px;font:inherit}
.pdf-table td input:focus{border-color:var(--gold);outline:none}
.pdf-table tr.warn td{background:rgba(255,214,90,.14)}
.pdf-table td:nth-child(3) input,.pdf-table td:nth-child(4) input{min-width:120px}
.pdf-table td:nth-child(8) input,.pdf-table td:nth-child(9) input{min-width:260px}
.pdf-table td:nth-child(7) input{min-width:100px}
.res-add{color:#1e6b33}.res-update{color:#7a5200}.res-same{opacity:.7}.res-skip{color:#a12622}
.pdf-table td:nth-child(3) input{min-width:200px}
.pdf-table td:nth-child(10){min-width:180px}

/* vakil sahayak */
.sh-steps { margin: 0 0 12px; padding-left: 20px; line-height: 1.7; max-width: 760px; }
.row.wrap { flex-wrap: wrap; }
.chip.active { border-color: var(--gold); color: var(--gold); font-weight: 700; }
.sh-task { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 6px; padding: 16px 18px; margin-bottom: 14px; }
.sh-task p { margin: 8px 0; }
.sh-task-head { display: flex; justify-content: space-between; gap: 12px; }
.sh-fee { font-family: var(--head); font-size: 20px; font-weight: 700; white-space: nowrap; }
.sh-status { font-size: 11.5px; font-weight: 700; border-radius: 10px; padding: 2px 8px; margin-left: 6px; background: var(--bg-2); color: var(--text-2); }
.sh-open { background: #e6f4ea; color: #1e6b33; }
.sh-disputed { background: #fde8e8; color: var(--tape); }
.sh-private, .sh-contact, .sh-dispute { background: var(--bg-2); border-radius: 4px; padding: 10px 12px; margin: 8px 0; font-size: 14px; }
.sh-dispute { border-left: 3px solid var(--tape); }
.sh-mini { margin-top: 10px; max-width: 520px; }
.vac-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.vac-title { font-weight: 600; font-size: 16px; margin-bottom: 2px; }
.sh-checks > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; }
.adv-check { margin-top: 6px; font-size: 13.5px; background: #fdf1d8; border-left: 3px solid #b07a00; padding: 6px 10px; border-radius: 3px; }
.dup-group { border-bottom: 1px solid var(--line); padding: 12px 0; }
.dup-group label { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; font-size: 14px; }
.sh-avail { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; margin-bottom: 10px; }
.sh-urgent { display: inline-block; background: #fde8e8; color: var(--tape); font-weight: 700; font-size: 12.5px; border-radius: 10px; padding: 2px 10px; margin: 4px 0; }
.sh-stars { color: #8a5a00; font-weight: 600; font-size: 13px; }
.sh-reviews { background: var(--bg-2); border-radius: 4px; padding: 8px 12px; margin-top: 8px; display: grid; gap: 4px; }
.draft-search { margin: 0 0 8px; } .draft-search #draftQuery { flex: 1 1 320px; max-width: 520px; } .draft-search #draftCourtFilter { flex: 0 1 240px; }
#draftCount { margin-bottom: 14px; min-height: 1em; }
hr.soft { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* admin: collapsible sections */
details.admin-collapse { margin: 0 0 16px; }
details.admin-collapse > summary { cursor: pointer; padding: 12px 16px; border: 1px solid var(--line, #d9d4c7); border-radius: 10px; background: var(--card, #fff); list-style: revert; }
details.admin-collapse[open] > summary { margin-bottom: 14px; }

/* WhatsApp-style message log */
.wa-chat { display: flex; flex-direction: column; gap: 14px; padding: 12px; background: #0b141a; border-radius: 10px; }
.wa-row { display: flex; flex-direction: column; gap: 4px; }
.wa-row .wa-bubble { max-width: 78%; }
.wa-row .wa-bubble.in { align-self: flex-start; border-top-left-radius: 0; }
.wa-row .wa-bubble.user { border-top-right-radius: 0; }
.wa-meta-top { font-size: 12px; color: #8696a0; align-self: flex-start; }

/* ===== WhatsApp Web style message view (wa-web.js) ===== */
.wa-panel { padding: 0; overflow: hidden; }
.wa-panel > .list-head { padding: 14px 16px 0; }
#waWebMount { padding: 0 0 0; }
.wv { display: grid; grid-template-columns: 320px 1fr; height: 72vh; min-height: 460px; background: #111b21; color: #e9edef; font-size: 14px; border-radius: 0 0 12px 12px; overflow: hidden; }
.wv button { font: inherit; color: inherit; }
.wv-side { display: flex; flex-direction: column; background: #111b21; border-right: 1px solid #222d34; min-width: 0; }
.wv-side-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 6px; }
.wv-title { font-size: 19px; font-weight: 600; }
.wv-count { font-size: 12px; color: #8696a0; }
.wv-search { padding: 6px 12px 8px; }
.wv-search input { width: 100%; box-sizing: border-box; background: #202c33; border: 0; border-radius: 8px; color: #e9edef; padding: 8px 12px; font: inherit; }
.wv-search input::placeholder { color: #8696a0; }
.wv-chips { display: flex; gap: 6px; padding: 0 12px 8px; flex-wrap: wrap; }
.wv-chips button { background: #202c33; border: 0; border-radius: 16px; padding: 5px 11px; font-size: 12.5px; color: #aebac1; cursor: pointer; }
.wv-chips button.on { background: #005c4b; color: #e9edef; }
.wv-list { overflow-y: auto; flex: 1; }
.wv-chat { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 10px 14px; border: 0; background: transparent; cursor: pointer; border-bottom: 1px solid #1f2a30; }
.wv-chat:hover { background: #202c33; }
.wv-chat.on { background: #2a3942; }
.wv-av { flex: 0 0 42px; width: 42px; height: 42px; border-radius: 50%; background: #6a7175; color: #e9edef; display: grid; place-items: center; font-weight: 600; font-size: 15px; text-transform: uppercase; }
.wv-mid { flex: 1; min-width: 0; }
.wv-row1, .wv-row2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.wv-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #e9edef; }
.wv-time { font-size: 11.5px; color: #8696a0; flex: 0 0 auto; }
.wv-prev { font-size: 13px; color: #8696a0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wv-badge { background: #00a884; color: #111b21; border-radius: 10px; font-size: 11.5px; font-weight: 700; padding: 1px 7px; flex: 0 0 auto; }
.wv-main { display: flex; flex-direction: column; min-width: 0; background: #0b141a; }
.wv-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #202c33; }
.wv-head .wv-av { width: 40px; height: 40px; flex-basis: 40px; }
.wv-sub { font-size: 12.5px; color: #8696a0; }
.wv-pop { margin-left: auto; font-size: 12.5px; color: #8fd6c4; text-decoration: none; white-space: nowrap; }
.wv-thread { flex: 1; overflow-y: auto; padding: 14px 7%; display: flex; flex-direction: column; gap: 3px; background-color: #0b141a; background-image: radial-gradient(rgba(134,150,160,.05) 1px, transparent 1px); background-size: 18px 18px; }
.wv-day { align-self: center; background: #182229; color: #8696a0; font-size: 11.5px; padding: 5px 12px; border-radius: 8px; margin: 8px 0; box-shadow: 0 1px 1px rgba(0,0,0,.3); }
.wv-in, .wv-out { display: flex; }
.wv-in { justify-content: flex-start; }
.wv-out { justify-content: flex-end; }
.wv-b { position: relative; max-width: 65%; padding: 6px 9px 4px; border-radius: 8px; font-size: 14.2px; line-height: 1.4; word-break: break-word; box-shadow: 0 1px 1px rgba(0,0,0,.3); }
.wv-b-in { background: #202c33; border-top-left-radius: 0; }
.wv-b-out { background: #005c4b; border-top-right-radius: 0; }
.wv-t { float: right; margin: 6px 0 0 10px; font-size: 11px; color: #8696a0; white-space: nowrap; }
.wv-b-out .wv-t { color: #8fd6c4; }
.wv-via { font-size: 11px; color: #8fd6c4; opacity: .8; margin-top: 2px; }
.wv-err-line { align-self: flex-end; font-size: 12px; color: #f4b183; margin: 2px 0; }
.wv-more { text-align: center; margin: 4px 0 8px; }
.wv-more button { background: #202c33; border: 0; border-radius: 14px; padding: 6px 14px; color: #aebac1; cursor: pointer; font-size: 12.5px; }
.wv-empty { margin: auto; color: #8696a0; text-align: center; padding: 24px; }
.wv-err { color: #f4b183; }
.wv-foot { font-size: 12px; color: #8696a0; text-align: center; padding: 8px; background: #202c33; }
@media (max-width: 760px) {
  .wv { grid-template-columns: 1fr; height: auto; }
  .wv-side { max-height: 40vh; }
  .wv-main { height: 70vh; }
  .wv-b { max-width: 85%; }
  .wv-thread { padding: 12px 4%; }
}

/* scrolling fixes for the messenger view: grid/flex children must be allowed to shrink */
.wv-side, .wv-main, .wv-list, .wv-thread { min-height: 0; }
.wv-main { overflow: hidden; }
.wv-list, .wv-thread { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.wa-panel, #waWebMount { min-height: 0; }
