/* ========================================================================== *
 * DeshBook PWA — LIGHT high-luminance theme for sunlight readability on a
 * cheap LCD phone. Bangla-first, low-literacy: big type, big tap targets,
 * concrete colour, generous line-height for conjunct legibility.
 *
 * The dark feed theme (DESIGN.md) is the consumer shell; THIS M1 villager view
 * is deliberately LIGHT — the dark-vs-sunlight tension flagged in the design
 * review is resolved here toward sunlight for the rural base.
 * ========================================================================== */

:root {
  /* High-luminance paper surface — readable in direct sun on a cheap LCD. */
  --bg:          #FBF9F4;   /* warm paper */
  --surface:     #FFFFFF;
  --surface-2:   #F2EFE7;
  --ink:         #16130D;   /* near-black ink, high contrast */
  --ink-2:       #4A463C;
  --ink-3:       #6E6A5E;
  --line:        #E2DCCD;

  /* Truth language carried from the brand. */
  --verified:    #0F6E56;   /* deepened green for contrast on white */
  --verified-bg: #E4F2EC;
  --absence:     #9A6B00;   /* amber, darkened for white-bg contrast */
  --absence-bg:  #FBF0D6;
  --district:    #2C4A7A;   /* the "your district" blue */
  --district-bg: #E6ECF6;

  --tap:  64px;             /* primary tap target */
  --tap-sm: 48px;
  --radius: 18px;
  --shadow: 0 2px 0 rgba(0,0,0,.04), 0 8px 24px rgba(20,16,8,.06);

  font-size: 18px;          /* Bangla body baseline — never below 18px */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans Bengali", system-ui, sans-serif;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: contain;
}

body { padding-bottom: calc(var(--tap) + 28px); }   /* room for bottom nav */

button { font-family: inherit; cursor: pointer; }

/* --- offline / freshness banner ----------------------------------------- */
#offlineBar {
  position: sticky; top: 0; z-index: 40;
  display: none;
  background: var(--absence-bg);
  color: var(--absence);
  font-weight: 600;
  text-align: center;
  padding: 8px 14px;
  font-size: .92rem;
  border-bottom: 2px solid #E9C97A;
}
#offlineBar.show { display: block; }

/* --- generic screen scaffolding ----------------------------------------- */
.screen { display: none; padding: 14px 16px 8px; max-width: 560px; margin: 0 auto; }
.screen.active { display: block; }

.appbar {
  max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px 4px;
}
.appbar .brand { font-size: 1.15rem; font-weight: 700; color: var(--verified); }
.appbar .stamp { margin-left: auto; font-size: .8rem; color: var(--ink-3); text-align: right; }

/* --- cards -------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin: 0 0 16px;
}
.card.hero { border: 2px solid var(--verified); background: var(--verified-bg); }
.card.district { border-left: 8px solid var(--district); }

.eyebrow {
  display: flex; align-items: center; gap: 8px;
  font-size: 1rem; font-weight: 700; color: var(--ink-2);
  margin-bottom: 6px;
}
.eyebrow .ico { font-size: 1.5rem; line-height: 1; }

.bignum {
  font-size: clamp(2rem, 9vw, 3rem);   /* 32–48px primary number */
  font-weight: 700; line-height: 1.2;
  color: var(--ink);
  letter-spacing: .5px;
  margin: 4px 0 2px;
  word-break: keep-all;
}
.hero .bignum { color: var(--verified); }
.subline { font-size: 1.05rem; color: var(--ink-2); margin: 2px 0 8px; }

/* --- chips (THE TWO HONESTY CHIPS) -------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 2px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .82rem; font-weight: 700;
  padding: 6px 12px; border-radius: 999px;
  border: 1.5px solid transparent;
  white-space: nowrap;
}
.chip.basis   { background: var(--surface-2); color: var(--ink-2); border-color: var(--line); }
.chip.tier    { background: var(--district-bg); color: var(--district); border-color: #C5D3EC; }
.chip.declared{ background: var(--verified-bg); color: var(--verified); border-color: #BBE0CF; }

/* --- tap-to-hear voice button ------------------------------------------ */
.voice {
  min-width: var(--tap-sm); min-height: var(--tap-sm);
  border-radius: 999px; border: 2px solid var(--verified);
  background: var(--surface); color: var(--verified);
  font-size: 1.4rem; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 14px; gap: 8px; font-weight: 700;
}
.voice .lbl { font-size: .9rem; }
.voice:active { background: var(--verified-bg); }
.voice.speaking { background: var(--verified); color: #fff; }

.numrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* --- the bite -> snack -> meal disclosure ------------------------------- */
details.factcard { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
details.factcard > summary {
  list-style: none; cursor: pointer;
  min-height: var(--tap-sm); display: flex; align-items: center; gap: 8px;
  font-weight: 700; color: var(--district); font-size: 1rem;
}
details.factcard > summary::-webkit-details-marker { display: none; }
details.factcard > summary::after { content: "⌄"; margin-left: auto; font-size: 1.4rem; }
details.factcard[open] > summary::after { content: "⌃"; }
.explainer { font-size: 1rem; color: var(--ink-2); margin: 10px 0; line-height: 1.6; }

.sourcebtn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: var(--tap-sm); padding: 10px 16px;
  border-radius: 14px; border: 2px solid var(--district);
  background: var(--district-bg); color: var(--district);
  font-weight: 700; text-decoration: none; font-size: 1rem;
}
.authority { font-size: .85rem; color: var(--ink-3); margin-top: 8px; }

/* --- record list -------------------------------------------------------- */
.rec {
  display: block; padding: 12px 0; border-top: 1px solid var(--line);
}
.rec .rtitle { font-size: 1rem; color: var(--ink); line-height: 1.5; }
.rec .rmeta  { font-size: .85rem; color: var(--ink-3); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }
.rec .ramount { font-size: 1.15rem; font-weight: 700; color: var(--ink); margin-top: 4px; }

/* --- programme grid (people tab) ---------------------------------------- */
.prog {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.prog .pico { font-size: 1.8rem; width: 40px; text-align: center; }
.prog .pname { font-weight: 700; font-size: 1.05rem; }
.prog .pcount { font-size: 1.3rem; font-weight: 700; color: var(--verified); }
.prog .pmoney { font-size: .95rem; color: var(--ink-2); }
.prog .pright { margin-left: auto; text-align: right; }

/* --- bottom nav: exactly four tabs -------------------------------------- */
nav#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 18px rgba(20,16,8,.07);
}
nav#tabs button {
  border: none; background: none; color: var(--ink-3);
  min-height: var(--tap); padding: 6px 2px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-weight: 700;
}
nav#tabs button .tico { font-size: 1.55rem; line-height: 1; }
nav#tabs button .tlbl { font-size: .8rem; }
nav#tabs button.active { color: var(--verified); }
nav#tabs button.active .tico { transform: translateY(-1px); }

/* --- onboarding / picker ------------------------------------------------ */
.center { text-align: center; }
.bigbtn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: var(--tap);
  border-radius: var(--radius); border: none;
  background: var(--verified); color: #fff;
  font-size: 1.2rem; font-weight: 700; margin: 12px 0;
  box-shadow: var(--shadow);
}
.bigbtn.secondary { background: var(--surface); color: var(--district); border: 2px solid var(--district); }
.bigbtn.ghost { background: var(--surface-2); color: var(--ink-2); box-shadow: none; }

.search {
  width: 100%; min-height: var(--tap); font-size: 1.2rem;
  padding: 0 18px; border-radius: var(--radius);
  border: 2px solid var(--line); background: var(--surface); color: var(--ink);
  font-family: inherit;
}
.results { margin-top: 10px; }
.result {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: var(--tap); text-align: left;
  padding: 10px 16px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 14px; margin-bottom: 10px; font-size: 1.1rem; color: var(--ink);
}
.result .rtier { font-size: .8rem; color: var(--ink-3); margin-left: auto; }
.result .ren { font-size: .85rem; color: var(--ink-3); }

/* --- six-option picker / tiered navigator ------------------------------- */
#searchResults { display: none; }
#searchResults.show { display: block; }
#navWrap.hidden { display: none !important; }

/* breadcrumb trail */
.crumbs { display: none; flex-wrap: wrap; align-items: center; gap: 4px; margin: 6px 0 10px; }
.crumbs.show { display: flex; }
.crumb {
  border: 1px solid var(--line); background: var(--surface); color: var(--district);
  font-weight: 700; font-size: .9rem; padding: 6px 12px; border-radius: 999px;
  min-height: var(--tap-sm);
}
.crumb.current { background: var(--district-bg); border-color: #C5D3EC; }
.crumb[onclick], .crumb:not(.current) { cursor: pointer; }
.crumbsep { color: var(--ink-3); font-size: 1rem; }

/* the six big option rows */
.result.navopt { gap: 14px; }
.navico { font-size: 1.7rem; width: 40px; text-align: center; flex: 0 0 auto; }
.result .ren { overflow: hidden; text-overflow: ellipsis; }

/* "এই বিভাগ/জেলা/উপজেলা দেখুন" — pick the level you're standing on */
.bigbtn.seethis { margin: 4px 0 14px; font-size: 1.05rem; min-height: var(--tap-sm); }

.greeting { font-size: 1.4rem; font-weight: 700; margin: 6px 0 2px; }
.sub { color: var(--ink-3); font-size: 1rem; }
.confirm-area { font-size: 1.7rem; font-weight: 700; color: var(--verified); margin: 16px 0; }

.note {
  background: var(--surface-2); border-radius: 14px; padding: 12px 14px;
  font-size: .92rem; color: var(--ink-2); margin: 12px 0;
}
.sectionhead { font-size: 1.15rem; font-weight: 700; margin: 18px 2px 8px; }
.muted { color: var(--ink-3); }
.hidden { display: none !important; }

.spinner { text-align:center; padding: 40px; color: var(--ink-3); }
