:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --ink: #1f2328;
  --ink-2: #4b5260;
  --muted: #6b7280;
  --line: #e3e6ea;
  --search: #d3e3fd;
  --search-ink: #0b2a5b;
  --accent: #1a5fd0;
  --accent-ink: #ffffff;
  --danger: #b42318;
  --ok: #157347;
  --hover: #eef3fd;
  --open: #e6eefc;
  --bar: #2a78d6;
  --h0: #fff1a8; --h1: #cdf3c9; --h2: #d3e4ff; --h3: #ffd6e6; --h4: #ffe2bd;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121416; --surface: #1b1e22; --ink: #e8eaed; --ink-2: #c4c8cf; --muted: #9aa0a8;
    --line: #2c3036; --search: #1f3b63; --search-ink: #e3ecfb; --accent: #6ea2f5; --accent-ink: #0b1220;
    --danger: #f08a80; --ok: #6ccf98; --hover: #1d2737; --open: #1a2638; --bar: #3987e5; --h0: #6b5a12; --h1: #24562c; --h2: #24477a; --h3: #6c2a47; --h4: #6e4718;
    --shadow: 0 1px 3px rgba(0,0,0,.4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121416; --surface: #1b1e22; --ink: #e8eaed; --ink-2: #c4c8cf; --muted: #9aa0a8;
  --line: #2c3036; --search: #1f3b63; --search-ink: #e3ecfb; --accent: #6ea2f5; --accent-ink: #0b1220;
  --danger: #f08a80; --ok: #6ccf98; --hover: #1d2737; --open: #1a2638; --bar: #3987e5; --h0: #6b5a12; --h1: #24562c; --h2: #24477a; --h3: #6c2a47; --h4: #6e4718;
  --shadow: 0 1px 3px rgba(0,0,0,.4); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }

header.top {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5;
}
header.top .brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
header.top .brand small { font-weight: 400; color: var(--muted); font-size: 13px; }
/* logo: full banner on wide screens, badge + name on phones; white backing keeps it clear in dark mode */
header.top .brand img { display: block; background: #fff; border-radius: 6px; }
header.top .brand img.logo-full { height: 56px; width: auto; }
header.top .brand img.logo-compact { height: 36px; width: auto; display: none; }
header.top .spacer { flex: 1; }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 6px 4px; }

main { max-width: 980px; margin: 0 auto; padding: 16px; }

/* auth cards */
.card {
  max-width: 420px; margin: 32px auto; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 22px; box-shadow: var(--shadow);
}
.card h1 { font-size: 20px; margin: 0 0 4px; }
.card p.sub { margin: 0 0 16px; color: var(--muted); }
label { display: block; font-size: 13px; color: var(--ink-2); margin: 12px 0 4px; }
input[type=search], input[type=email], input[type=text], input[type=tel], input[type=password], input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
}
textarea { min-height: 220px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.phone-row { display: flex; gap: 8px; }
.phone-row .cc { flex: 0 0 auto; width: 120px; padding: 10px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--muted); }
.btn { text-decoration: none;
  display: inline-block; border: 0; border-radius: 8px; padding: 10px 16px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
}
.btn.block { width: 100%; margin-top: 16px; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { padding: 6px 10px; font-size: 13px; font-weight: 500; }
.btn:disabled { opacity: .55; cursor: default; }
.links { display: flex; justify-content: space-between; margin-top: 14px; font-size: 14px; }
.msg { margin-top: 12px; font-size: 14px; padding: 8px 10px; border-radius: 8px; }
.msg.err { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.msg.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.msg.info { background: var(--hover); color: var(--ink-2); }
.notice { font-size: 13px; color: var(--ink-2); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-top: 12px; }
.steps { margin: 6px 0 4px 18px; padding: 0; color: var(--ink-2); font-size: 14px; }
.steps li { margin: 4px 0; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin-top: 10px; color: var(--ink); }
.check input { margin-top: 3px; }

/* search */
.searchbar {
  display: flex; gap: 8px; align-items: center; background: var(--search); color: var(--search-ink);
  border-radius: 24px; padding: 4px 6px 4px 14px; position: sticky; top: 78px; z-index: 4;
}
.searchbar svg { flex: 0 0 auto; opacity: .7; }
.searchbar input {
  flex: 1; border: 0; background: transparent; padding: 8px 4px; color: var(--search-ink); outline: none; min-width: 0;
}
.searchbar select {
  width: auto; max-width: 42%; border: 0; border-radius: 18px; padding: 6px 10px; background: var(--bg); font-size: 14px;
}
.status { color: var(--muted); font-size: 13px; margin: 10px 4px; min-height: 18px; }
ul.results { list-style: none; margin: 0; padding: 0; }
ul.results li.row {
  font-size: 15px; padding: 8px 10px; border-bottom: 1px solid var(--line); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
ul.results li.row:hover { background: var(--hover); }
ul.results li.row.open { background: var(--open); white-space: normal; }
ul.results li.row .bk { font-weight: 600; }
ul.results li.row .pg { color: var(--ink-2); }
mark { color: inherit; border-radius: 3px; padding: 0 1px; background: var(--h0); }
mark.h0 { background: var(--h0); } mark.h1 { background: var(--h1); } mark.h2 { background: var(--h2); }
mark.h3 { background: var(--h3); } mark.h4 { background: var(--h4); }
.status mark { padding: 0 5px; }
/* boxes over words on the page image (the page itself is always light paper) */
.pagebox { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
.pagebox img { display: block; }
.hlbox { position: absolute; border-radius: 3px; mix-blend-mode: multiply; pointer-events: none; }
.hlbox.h0 { background: rgba(255, 214, 0, .45); }
.hlbox.h1 { background: rgba(60, 200, 80, .38); }
.hlbox.h2 { background: rgba(60, 140, 255, .35); }
.hlbox.h3 { background: rgba(255, 80, 150, .35); }
.hlbox.h4 { background: rgba(255, 140, 0, .40); }
ul.results .kwm { color: var(--muted); font-size: 13px; }
/* fixed-height layout: results scroll in their own box, the page opens in the panel below */
#vApp:not(.hidden) { display: flex; flex-direction: column; height: calc(100dvh - 78px - 32px); min-height: 460px; }
#vApp .tabs, #vApp .findtitle { flex: 0 0 auto; }
#vApp .searchbar { position: static; flex: 0 0 auto; }
#vApp .status { flex: 0 0 auto; }
.resultsbox { flex: 0 0 auto; max-height: 32%; min-height: 64px; overflow-y: auto; border: 1px solid var(--line);
  border-radius: 10px; background: var(--bg); }
.resultsbox:has(ul:empty) { display: none; }
.viewer { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; margin-top: 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.viewer .vhint { margin: auto; color: var(--muted); font-size: 14px; padding: 20px; text-align: center; }
.viewer .vhead { flex: 0 0 auto; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--bg); }
.viewer .vtitle { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px; }
.viewer .vtitle .bk { font-weight: 600; }
.viewer .imgwrap { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 10px; text-align: center; }
.viewer img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.viewer .nav { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
.viewer .nav .where { color: var(--muted); font-size: 13px; min-width: 110px; text-align: center; }
.more { text-align: center; margin: 8px 0; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.disclaimer { color: var(--muted); font-size: 12px; text-align: center; margin: 8px 0 0; flex: 0 0 auto; }

/* menu */
.menu { position: relative; }
.menu .panel {
  position: absolute; right: 0; top: 36px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); min-width: 220px; padding: 6px; z-index: 10;
}
.menu .panel button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 6px; cursor: pointer; }
.menu .panel button:hover { background: var(--hover); }
.menu .panel .who { padding: 8px 10px; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }

.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  header.top .brand small { display: none; }
  main { padding: 12px; }
  .card { margin: 16px auto; padding: 18px; }
  .searchbar { top: 58px; }
  #vApp:not(.hidden) { height: calc(100dvh - 58px - 24px); }
  .resultsbox { max-height: 30%; }
  .viewer .nav { gap: 6px; flex-wrap: nowrap; }
  .viewer .nav .where { min-width: 0; }
  .viewer .nav .long { display: none; }
  .viewer .vtitle { margin-bottom: 4px; }
  header.top .brand img.logo-full { display: none; }
  header.top .brand img.logo-compact { display: block; }
  ul.results li.row { font-size: 15px; padding: 9px 6px; }
}

/* =====================================================================
   ISHAN AcuGyan look (matches the earlier app): light grey login card,
   Roboto headings, Bootstrap-style tabs, plain white search box,
   Verdana result lines with a grey "selected" pill.
   ===================================================================== */
:root {
  --bg: #ffffff; --surface: #f2f2f2; --ink: #333333; --ink-2: #555555; --muted: #777777; --line: #dddddd;
  --accent: #2366d1; --accent-ink: #ffffff; --link: #337ab7; --hover: #f5f8fc; --open: #e9e9e9;
}
body { font-family: Roboto, "Helvetica Neue", Arial, "Noto Sans Devanagari", sans-serif; }
a, .linkbtn { color: var(--link); }

/* top bar */
header.top { border-bottom: 1px solid #e5e5e5; background: #fafafa; }
.userbtn { background: none; border: 0; color: #6f9fd8; font: 600 14px Verdana, Tahoma, sans-serif; cursor: pointer; padding: 6px 4px; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iconbtn { background: none; border: 0; color: #6f9fd8; cursor: pointer; padding: 6px; display: inline-flex; }
.iconbtn:hover, .userbtn:hover { color: var(--link); }
.menu { display: flex; align-items: center; gap: 2px; }
.menu.hidden { display: none; }
.menu .panel { top: 40px; }

/* login screens: no top bar, logo inside the card */
body.auth header.top { display: none; }
body.auth main { padding-top: 24px; }
.card { background: #f2f2f2; border: 0; border-radius: 14px; box-shadow: none; max-width: 380px; padding: 22px 30px 18px; }
.card .cardlogo { display: block; width: 280px; max-width: 100%; height: auto; margin: 0 auto 22px; }
.card h1 { text-align: center; font-size: 19px; font-weight: 700; color: #333; margin: 0 0 18px; }
.card p.sub { text-align: center; font-size: 14px; }
.field { position: relative; margin: 12px 0; }
.field input { padding: 9px 38px 9px 12px; border: 1px solid #c8c8c8; border-radius: 5px; background: #fff; font-size: 15px; }
.field input:focus { outline: none; border-color: #66afe9; box-shadow: 0 0 0 3px rgba(102,175,233,.25); }
.field .fico { position: absolute; right: 11px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: #777; pointer-events: none; }
.btn { border-radius: 5px; font-weight: 500; }
.btn.block { background: var(--accent); border: 1px solid #1a3f7a; font-size: 15px; padding: 10px; }
.card .right { text-align: right; margin-top: 12px; }
.card .right .linkbtn, .loginlinks .linkbtn, .loginlinks a { color: #333; font-size: 14px; text-decoration: none; padding: 2px 0; }
.card .right .linkbtn:hover, .loginlinks .linkbtn:hover, .loginlinks a:hover { text-decoration: underline; }
.loginlinks { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 18px; }
.card .links { justify-content: center; }

/* tabs and title */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid #ddd; margin: 4px 0 18px; flex-wrap: wrap; }
.tabs .tab { padding: 10px 18px; color: var(--link); text-decoration: none; border: 1px solid transparent; border-radius: 6px 6px 0 0; margin-bottom: -1px; font-size: 16px; }
.tabs .tab:hover { background: #f3f3f3; }
.tabs .tab.on { color: #555; background: #fff; border-color: #ddd #ddd #fff; }
.findtitle { font-size: 28px; font-weight: 700; color: #333; margin: 4px 0 12px; }

/* search box */
.searchbar { background: #fff; color: #333; border: 1px solid #cfcfcf; border-radius: 5px; padding: 3px 6px 3px 14px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.searchbar:focus-within { border-color: #66afe9; box-shadow: 0 0 0 3px rgba(102,175,233,.2); }
.searchbar .sico { opacity: 1; color: #222; }
.searchbar input { color: #333; font-size: 16px; padding: 10px 6px; }
.searchbar input::placeholder { color: #888; }
.searchbar select { background: #f5f5f5; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; padding: 5px 6px; color: #444; }
.clearbtn { background: none; border: 0; font-size: 20px; line-height: 1; color: #222; cursor: pointer; padding: 4px 8px; }

/* results list */
.resultsbox { border-color: #d6d6d6; border-radius: 4px; }
ul.results li.row { font: 13px/1.5 Verdana, Tahoma, Geneva, sans-serif; color: #333; padding: 7px 10px; border-bottom: 1px solid #e6e6e6; }
ul.results li.row:hover { background: #f7f7f7; }
ul.results li.row.active, ul.results li.row.open {
  background: linear-gradient(#f4f4f4, #dcdcdc); border: 1px solid #a9a9a9; border-radius: 4px; margin: 2px 4px; }
ul.results li.row .bk { color: #333; }
ul.results li.row .pg { color: #666; }
ul.results mark { font-weight: 700; color: #0b3c6e; }
.viewer { background: #fafafa; border-color: #d6d6d6; border-radius: 4px; }
.viewer .vtitle { font: 13px Verdana, Tahoma, sans-serif; }
.status { font-size: 13px; color: #777; }

/* the earlier app was light only; keep it light so colours match */
:root { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="dark"]) {
    --bg: #ffffff; --surface: #f2f2f2; --ink: #333333; --ink-2: #555555; --muted: #777777; --line: #dddddd;
    --accent: #2366d1; --accent-ink: #ffffff; --hover: #f5f8fc; --open: #e9e9e9;
    --h0: #fff1a8; --h1: #cdf3c9; --h2: #d3e4ff; --h3: #ffd6e6; --h4: #ffe2bd; color-scheme: light;
  }
}
@media (max-width: 600px) {
  .card { padding: 18px 18px 14px; }
  .findtitle { font-size: 22px; margin-bottom: 8px; }
  .tabs .tab { padding: 8px 12px; font-size: 15px; }
  .tabs { margin-bottom: 10px; }
}

/* rows wrap to full text, like the old app */
ul.results li.row { white-space: normal; overflow: visible; }

/* burger menu (replaces the tabs) */
.username { color: #6f9fd8; font: 600 14px Verdana, Tahoma, sans-serif; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 4px; }
.iconbtn.burger { color: #555; padding: 6px; border-radius: 6px; }
.iconbtn.burger:hover { background: #ececec; color: #222; }
.menu .panel { top: 44px; min-width: 250px; background: #fff; }
.menu .panel a { display: block; padding: 9px 10px; border-radius: 6px; color: inherit; text-decoration: none; }
.menu .panel a:hover { background: var(--hover); }
.menu .panel .sect { padding: 8px 10px 2px; font-size: 12px; font-weight: 700; color: #888; text-transform: uppercase; letter-spacing: .04em; }
.menu .panel .adminitems a { padding-left: 18px; }
.menu .panel hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.menu .panel button.on { font-weight: 700; color: var(--accent); }
#vApp .findtitle { margin-top: 14px; }

/* feedback */
.stars { display: inline-flex; gap: 2px; }
.stars button { background: none; border: 0; font-size: 30px; line-height: 1; color: #c9c9c9; cursor: pointer; padding: 0 2px; }
.stars button.on { color: #f5a623; }
.stars:hover button { color: #f5a623; }
.stars button:hover ~ button { color: #c9c9c9; }
.ratingrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0 6px; color: #555; }
textarea.fbtext { width: 100%; min-height: 150px; resize: vertical; padding: 10px 12px; border: 1px solid #cfcfcf; border-radius: 5px; font: inherit; font-size: 15px; background: #fff; color: #333; box-sizing: border-box; margin-bottom: 12px; }
textarea.fbtext:focus { outline: none; border-color: #66afe9; box-shadow: 0 0 0 3px rgba(102,175,233,.25); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.fbwall { max-width: 380px; margin: 26px auto 30px; }
.fbwall.empty-wall { display: none; }
.fbwall h2 { font-size: 18px; font-weight: 700; color: #333; margin: 0 0 10px; text-align: center; }
.fbwall .fb { padding: 4px 2px; }
.fbwall .fbhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.fbwall .fbhead b { color: #333; }
.fbwall .fbdate { color: #888; font-size: 13px; white-space: nowrap; }
.fbwall .fbstars { color: #f5a623; font-size: 18px; letter-spacing: 1px; margin: 2px 0; }
.fbwall .fbcomment { margin: 4px 0 6px; color: #444; white-space: pre-line; line-height: 1.5; }
.fbwall hr.fbsep { border: 0; border-top: 1px solid #ddd; margin: 12px 0; }
#vAppFeedback { margin-top: 16px; }

/* mobile hint, topic select */
.fhint { font-size: 12.5px; color: #777; margin: -6px 2px 10px; }
select.fsel { width: 100%; padding: 10px 12px; border: 1px solid #cfcfcf; border-radius: 5px; background: #fff; color: #333; font: inherit; font-size: 15px; margin-bottom: 12px; }
.card label.check a, .notice a, .sub a { color: var(--link); }
