:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --ink: #1d2430;
  --muted: #5d6675;
  --line: #e3dfd6;
  --brand: #1f3a5f;
  --brand-ink: #ffffff;
  --accent: #b5652b;
  --chip: #eef2f7;
  --chip-ink: #1f3a5f;
  --te-bg: #fbf7ee;
  --warn-bg: #fff4e0;
  --warn-ink: #7a4b00;
  --ok-bg: #e7f5ec;
  --ok-ink: #1d6b3a;
  --hl: #fff1b8;
  --fs: 17px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161d; --card: #1b212b; --ink: #e8ecf2; --muted: #9aa5b5; --line: #2a3240;
    --brand: #8fb3e3; --brand-ink: #0f1620; --accent: #e3a06b; --chip: #243042; --chip-ink: #cfe0f7;
    --te-bg: #1f2530; --warn-bg: #3a2c12; --warn-ink: #f3cf8a; --ok-bg: #173323; --ok-ink: #9be0b4; --hl: #4a4115;
  }
}
:root[data-theme="dark"] {
  --bg: #12161d; --card: #1b212b; --ink: #e8ecf2; --muted: #9aa5b5; --line: #2a3240;
  --brand: #8fb3e3; --brand-ink: #0f1620; --accent: #e3a06b; --chip: #243042; --chip-ink: #cfe0f7;
  --te-bg: #1f2530; --warn-bg: #3a2c12; --warn-ink: #f3cf8a; --ok-bg: #173323; --ok-ink: #9be0b4; --hl: #4a4115;
}
* { box-sizing: border-box; }
html { font-size: var(--fs); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Inter", "Noto Sans Telugu", system-ui, -apple-system, sans-serif;
  line-height: 1.6; -webkit-text-size-adjust: 100%;
}
.te, [lang="te"] { font-family: "Noto Sans Telugu", "Inter", system-ui, sans-serif; line-height: 1.85; }
a { color: var(--brand); }
button { font: inherit; cursor: pointer; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; max-width: 760px; margin: 0 auto;
}
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--ink);
  font-family: "Noto Sans Telugu", sans-serif; font-weight: 700; font-size: 1.15rem; }
.logo { display: block; width: 40px; height: 40px; border-radius: 50%; }
.tools { display: flex; gap: 6px; }
.icon { border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 8px; padding: 4px 10px; font-size: .85rem; }

.searchwrap { position: sticky; top: 0; z-index: 5; background: var(--bg);
  padding: 6px 16px 10px; max-width: 760px; margin: 0 auto; }
#searchForm { display: flex; gap: 8px; }
#q { flex: 1; min-width: 0; font-size: 1.1rem; padding: 14px 16px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--card); color: var(--ink); outline: none;
  font-family: "Inter", "Noto Sans Telugu", sans-serif; }
#q:focus { border-color: var(--brand); }
.go { border: 0; border-radius: 14px; padding: 0 18px; background: var(--brand); color: var(--brand-ink);
  font-family: "Noto Sans Telugu", sans-serif; font-weight: 600; }
.hints { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hints:empty { display: none; }

.chip { display: inline-flex; align-items: center; gap: 4px; border: 0; border-radius: 999px;
  padding: 4px 12px; background: var(--chip); color: var(--chip-ink); font-size: .85rem;
  text-decoration: none; white-space: nowrap; }
.chip.old { background: var(--accent); color: #fff; font-weight: 600; }

main { max-width: 760px; margin: 0 auto; padding: 4px 16px 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 18px; margin: 12px 0; }
.card h3 { margin: 0 0 8px; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.sechead .act { color: var(--muted); font-size: .9rem; font-weight: 600; }
.sechead h1 { margin: 2px 0 2px; font-size: 1.45rem; line-height: 1.3; }
.sechead .tet { font-size: 1.1rem; color: var(--accent); font-weight: 600; }
.row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }

.bare p { margin: 0 0 10px; }
.bare p.hl { background: var(--hl); border-radius: 6px; padding: 2px 6px; margin-left: -6px; margin-right: -6px; }
.bare p.ind { padding-left: 1.2em; }
.bare .src { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); color: var(--muted); font-size: .78rem; }
.bare .notes p { font-size: .8rem; color: var(--muted); margin: 6px 0 0; }
mark { background: var(--hl); color: inherit; border-radius: 3px; padding: 0 2px; }
.tecard { background: var(--te-bg); }
.tecard p { margin: 0 0 10px; }
.badge { display: inline-block; font-size: .75rem; padding: 2px 10px; border-radius: 999px; margin-bottom: 8px; }
button.badge { border: 0; font: inherit; font-size: .75rem; cursor: pointer; }
.badge.draft { background: var(--warn-bg); color: var(--warn-ink); }
.badge.ok { background: var(--ok-bg); color: var(--ok-ink); }
.pending { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px;
  padding: 8px 14px; font-size: .9rem; }
.btn.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

.list { list-style: none; padding: 0; margin: 0; }
.list li a { display: flex; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--ink); align-items: baseline; }
.list li:last-child a { border-bottom: 0; }
.list .num { min-width: 64px; font-weight: 700; color: var(--brand); }
.list .sub { display: block; color: var(--muted); font-size: .85rem; }
.list .tag { margin-left: auto; font-size: .75rem; color: var(--accent); white-space: nowrap; }

.nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }
.empty { color: var(--muted); text-align: center; padding: 24px 8px; }
.hello h2 { font-size: 1.1rem; margin: 0 0 6px; }
.foot { max-width: 760px; margin: 0 auto; padding: 12px 16px 40px; color: var(--muted); font-size: .75rem; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink);
  color: var(--bg); padding: 8px 16px; border-radius: 10px; font-size: .9rem; opacity: 0; transition: opacity .2s; }
.toast.show { opacity: 1; }
.bare details.state { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 8px; }
.bare details.state summary { cursor: pointer; color: var(--accent); font-size: .85rem; font-weight: 600; }
.bare details.state p { font-size: .82rem; color: var(--muted); margin: 6px 0; }
.upd-card { display: block; text-decoration: none; color: inherit; border-left: 4px solid var(--accent); }
.badge.upd { background: var(--ok-bg); color: var(--ok-ink); text-decoration: none; margin-top: 6px; }
.diff summary { cursor: pointer; }
.diff .old p { background: #fbe4e4; color: #6b1d1d; border-radius: 6px; padding: 4px 8px; text-decoration: line-through; text-decoration-color: rgba(107,29,29,.35); }
.diff .new p { background: var(--ok-bg); color: var(--ok-ink); border-radius: 6px; padding: 4px 8px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .diff .old p { background: #3a1b1b; color: #f0b4b4; } }
:root[data-theme="dark"] .diff .old p { background: #3a1b1b; color: #f0b4b4; }
.diff del { background: #fbe4e4; color: #8a1f1f; text-decoration: line-through; border-radius: 3px; padding: 0 2px; }
.diff ins { background: #dcf3e3; color: #15603a; text-decoration: none; border-radius: 3px; padding: 0 2px; font-weight: 600; }
.diff p.wd { line-height: 1.8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .diff del { background: #4a1f1f; color: #f3b6b6; } :root:not([data-theme="light"]) .diff ins { background: #1b4029; color: #a6e8bd; } }
:root[data-theme="dark"] .diff del { background: #4a1f1f; color: #f3b6b6; }
:root[data-theme="dark"] .diff ins { background: #1b4029; color: #a6e8bd; }

/* advocate review */
.rvbar { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--line, #ccc); }
.rvbar .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rvbar textarea { width: 100%; box-sizing: border-box; margin-top: 8px; font: inherit; font-size: .9rem;
  padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line, #ccc); background: var(--bg, #fff); color: inherit; }
.rvbar .rvst { margin-top: 6px; font-size: .8rem; color: var(--muted); }
.card select { font: inherit; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line, #ccc); background: var(--bg, #fff); color: inherit; }
.card .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* report a mistake */
.rep label.rk { display: block; margin: 4px 0; font-size: .92rem; }
.rep textarea, .rep input#repName { width: 100%; box-sizing: border-box; margin-top: 8px; font: inherit; font-size: .9rem;
  padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: inherit; }
.replink { margin: 10px 0 0; font-size: .82rem; color: var(--muted); }
#rkIn { flex: 1; min-width: 0; font: inherit; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line, #ccc); background: var(--bg, #fff); color: inherit; }
.mic { border: 1px solid var(--line, #ccc); border-radius: 14px; padding: 0 12px; background: var(--card, transparent); color: inherit; font-size: 1.1rem; cursor: pointer; }
.mic.on { background: #A32D2D; color: #fff; border-color: #A32D2D; animation: micp 1s infinite; }
@keyframes micp { 50% { opacity: .6; } }
.btn.spk { font-size: .75rem; padding: 2px 10px; margin-left: 8px; vertical-align: middle; }
.btn.spk.on { background: var(--ok-bg); color: var(--ok-ink); }
button.term { all: unset; cursor: pointer; border-bottom: 1.5px dotted currentColor; text-decoration-color: var(--brand); color: inherit; font-weight: 600; }
button.term:hover, button.term:focus-visible { background: var(--warn-bg); border-radius: 3px; }
.gpop { position: fixed; left: 12px; right: 12px; bottom: 12px; max-width: 560px; margin: 0 auto; z-index: 50;
  background: var(--card, #fff); color: inherit; border: 1px solid var(--line, #ccc); border-radius: 16px; padding: 14px 16px; box-shadow: 0 8px 30px rgba(0,0,0,.35); }
.gpop .gh { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.gpop .gh span { color: var(--muted); font-size: .85rem; }
.gpop .gx { margin-left: auto; border: 0; background: none; color: inherit; font-size: 1.1rem; cursor: pointer; }
.gpop p { margin: 4px 0; line-height: 1.6; }
.gpop .gref { color: var(--muted); font-size: .8rem; }
.icon#acctBtn { text-decoration: none; display: inline-grid; place-items: center; }
.icon#acctBtn.on { background: var(--ok-bg); color: var(--ok-ink); }
.acct .row { gap: 8px; margin-top: 10px; }
.acct input { flex: 1; min-width: 0; font: inherit; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: inherit; }
.acct .sub { color: var(--muted); font-size: .85rem; }
[hidden] { display: none !important; }
.btn.spk.wait::after { content: " ⏳"; }

/* 📲 install button + help sheet */
#installBtn.ready { border-color: #d4a73a; box-shadow: 0 0 0 2px rgba(212,167,58,.35); }
.ih-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.55); display: grid; place-items: end center; padding: 16px; }
.ih-wrap[hidden] { display: none; }
.ih { width: 100%; max-width: 460px; margin: 0 auto 8px; padding: 16px 18px; border-radius: 14px; }
.ih h3 { margin: 0 0 8px; font-size: 1.05rem; text-transform: none; letter-spacing: 0; color: var(--ink); }
.ih ol { margin: 0 0 10px; padding-left: 1.3em; line-height: 1.7; }
.ih .go { width: 100%; padding: 10px; border-radius: 10px; border: 0; font: inherit; cursor: pointer; }
