/* BizBot: one stylesheet, mobile first. */
:root {
  --bg: #f6f7f5; --card: #fff; --ink: #1d2320; --muted: #5d6762; --line: #e3e7e4;
  --brand: #17795a; --brand-ink: #fff; --brand-soft: #e5f3ed;
  --warn: #a35c00; --warn-soft: #fff3df; --bad: #b3261e; --bad-soft: #fdecea; --good: #17795a;
  --star: #e8a400; --radius: 12px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 1px 8px rgba(0,0,0,.04);
  --font: system-ui, -apple-system, "Segoe UI", "Nirmala UI", "Noto Sans Tamil", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); }
a { color: var(--brand); }
h1 { font-size: 1.35rem; margin: 0 0 .75rem; line-height: 1.25; }
h2 { font-size: 1.1rem; margin: 0 0 .6rem; }
h3 { font-size: 1rem; margin: 0 0 .4rem; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
.small { font-size: .875rem; }
img { max-width: 100%; height: auto; }

/* Top bar */
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top .in { max-width: 1240px; margin: 0 auto; padding: .55rem 16px; display: flex; align-items: center; gap: .75rem; }
.logo { font-weight: 800; color: var(--brand); text-decoration: none; font-size: 1.15rem; letter-spacing: -.01em; white-space: nowrap; }
.logo span { color: var(--ink); }
.top select { max-width: 46vw; font-size: .9rem; padding: .3rem .4rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.top .grow { flex: 1; }
.top nav.desk { display: none; gap: .25rem; }
.top nav.desk a { text-decoration: none; color: var(--muted); padding: .4rem .5rem; border-radius: 8px; font-size: .9rem; white-space: nowrap; }
.top nav.desk a.on, .top nav.desk a:hover { background: var(--brand-soft); color: var(--brand); }
.langs a { font-size: .85rem; text-decoration: none; color: var(--muted); padding: .2rem .35rem; }
.langs a.on { color: var(--ink); font-weight: 700; }

/* Bottom tabs on phones */
.tabs { position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); border-top: 1px solid var(--line); display: flex; z-index: 10; padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; text-align: center; text-decoration: none; color: var(--muted); font-size: .72rem; padding: .45rem 0 .5rem; line-height: 1.2; }
.tabs a b { display: block; font-size: 1.25rem; font-weight: 400; line-height: 1.2; }
.tabs a.on { color: var(--brand); font-weight: 600; }
main { max-width: 1080px; margin: 0 auto; padding: 16px 16px 90px; }

@media (min-width: 1180px) {  /* Tamil labels need the room; narrower screens use the bottom tabs */
  .top nav.desk { display: flex; }
  .tabs { display: none; }
  main { padding-bottom: 40px; }
}

/* Cards and grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; overflow-x: auto; }
.card.tight { padding: 12px 14px; }
.grid { display: grid; gap: 14px; }
@media (min-width: 700px) { .g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .n { font-size: 1.6rem; font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: .85rem; }
.up { color: var(--good); font-size: .8rem; } .down { color: var(--bad); font-size: .8rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: .6rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

/* Buttons and forms */
.btn, button { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 44px; padding: .55rem 1rem; border-radius: 10px; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); font: 600 .95rem var(--font); text-decoration: none; cursor: pointer; }
.btn.alt, button.alt { background: var(--card); color: var(--brand); }
.btn.quiet, button.quiet { background: transparent; color: var(--muted); border-color: var(--line); }
.btn.danger, button.danger { background: var(--card); color: var(--bad); border-color: #e5b3ae; }
.btn.sm, button.sm { min-height: 36px; padding: .35rem .7rem; font-size: .875rem; }
.btn.block, button.block { width: 100%; }
form.inline { display: inline; }
label { display: block; font-weight: 600; font-size: .92rem; margin: .7rem 0 .25rem; }
label.check { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; }
label.check input { margin-top: .3rem; width: 18px; height: 18px; }
input:not([type]), input[type=text], input[type=search], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=number], input[type=date], input[type=time], input[type=datetime-local], select, textarea {
  width: 100%; font: 16px var(--font); padding: .6rem .7rem; border: 1px solid #c9d0cc; border-radius: 10px; background: #fff; color: var(--ink); min-height: 44px; }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.hint { color: var(--muted); font-size: .85rem; margin-top: .25rem; }
.err { color: var(--bad); font-size: .875rem; margin-top: .25rem; }
.choice { display: grid; gap: 8px; }
.choice label { margin: 0; font-weight: 400; border: 1px solid var(--line); border-radius: 10px; padding: .65rem .75rem; display: flex; gap: .6rem; align-items: flex-start; cursor: pointer; background: #fff; }
.choice label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice input { margin-top: .25rem; }
.choice b { display: block; }

/* Messages */
.flash { border-radius: 10px; padding: .7rem .9rem; margin-bottom: 14px; border: 1px solid; }
.flash.ok { background: var(--brand-soft); border-color: #b8dccb; }
.flash.bad { background: var(--bad-soft); border-color: #f2c4bf; }
.flash.warn { background: var(--warn-soft); border-color: #f0d3a6; }

/* Pills and lists */
.pill { display: inline-block; font-size: .75rem; padding: .1rem .5rem; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--brand-soft); color: var(--brand); border-color: #b8dccb; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: #f0d3a6; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: #f2c4bf; }
.stars { color: var(--star); letter-spacing: 1px; white-space: nowrap; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: .75rem 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; padding-top: 0; }
.todo li { display: flex; gap: .6rem; align-items: flex-start; }
.todo .num { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: .85rem; }
.quote { background: var(--bg); border-radius: 10px; padding: .6rem .75rem; margin: .4rem 0; white-space: pre-line; }
.reply { border-left: 3px solid var(--brand); padding: .2rem 0 .2rem .7rem; margin: .5rem 0; white-space: pre-line; }
.filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.filters a { white-space: nowrap; text-decoration: none; border: 1px solid var(--line); background: var(--card); color: var(--muted); padding: .35rem .75rem; border-radius: 999px; font-size: .875rem; }
.filters a.on { background: var(--brand); color: #fff; border-color: var(--brand); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .5rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
@media (min-width: 700px) { .photos { grid-template-columns: repeat(6, 1fr); } }
.photos figure { margin: 0; position: relative; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; background: var(--line); }
.photos figcaption { position: absolute; left: 4px; bottom: 4px; }
.pick-photo { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pick-photo label { margin: 0; position: relative; }
.pick-photo input { position: absolute; opacity: 0; }
.pick-photo img { aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 3px solid transparent; width: 100%; }
.pick-photo input:checked + img { border-color: var(--brand); }

/* Charts (inline SVG) */
.chart { width: 100%; height: 120px; display: block; }
.chart .bar { fill: var(--brand); opacity: .85; }
.chart .bar2 { fill: #e8a400; }
.legend { display: flex; gap: 1rem; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.gridmap { display: grid; gap: 3px; max-width: 260px; }
.gridmap div { aspect-ratio: 1; border-radius: 6px; display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff; }
.r1 { background: #17795a; } .r2 { background: #4f9e3c; } .r3 { background: #a3a32a; } .r4 { background: #d08a1e; } .r5 { background: #c6532b; } .rn { background: #b9bfbb; }

/* Open pages */
.hero { text-align: center; padding: 28px 0 10px; }
.hero h1 { font-size: 1.7rem; }
.score { font-size: 3rem; font-weight: 800; line-height: 1; }
.ticks li { display: flex; gap: .5rem; padding: .35rem 0; }
.ticks .y { color: var(--good); font-weight: 700; } .ticks .n { color: var(--bad); font-weight: 700; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 24px 16px 40px; }
.foot a { color: var(--muted); }
.center { text-align: center; }
.narrow { max-width: 460px; margin: 0 auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
