/* AMS — DS palette, light ground for daylight phone use. */
:root {
  --paper: #F7F6F8;
  --paper-2: #EDEBF0;
  --card: #FFFFFF;
  --ink: #2C2433;
  --ink-2: #4A4152;
  --slate: #6B6475;
  --line: #E2DFE6;
  --bone: #EDEDED;
  --rose: #CB4A68;
  --rose-bg: #FBEEF1;
  --paid: #2F7A5B;
  --paid-bg: #E6F2EC;
  --wait: #9A6512;
  --wait-bg: #FBF1DE;
  --part: #4E5FA8;
  --part-bg: #E9ECF8;
  --radius: 14px;
  --body: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Bricolage Grotesque', var(--body);
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --nav-h: 64px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.45 var(--body); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; font-weight: 750; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 700; font-family: var(--body); }
.mono, .amt { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.amt { font-weight: 600; white-space: nowrap; }
.muted { color: var(--slate); }
.small { font-size: .86rem; }
.boot { padding: 40vh 0; text-align: center; color: var(--slate); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- shell ---------- */
.shell { min-height: 100vh; padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
.top { position: sticky; top: 0; z-index: 20; background: var(--ink); color: var(--bone); padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.top .bname { font-family: var(--display); font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .who { font-size: .8rem; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .grow { flex: 1; min-width: 0; }
.role-switch { display: flex; gap: 4px; background: rgba(237,237,237,.1); border-radius: 999px; padding: 3px; }
.role-switch button { border: 0; background: none; color: var(--bone); padding: 5px 10px; border-radius: 999px; font-size: .8rem; cursor: pointer; opacity: .75; }
.role-switch button[aria-pressed="true"] { background: var(--bone); color: var(--ink); opacity: 1; font-weight: 700; }
.main { max-width: 1080px; margin: 0 auto; padding: 18px 16px; }
.nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--card); border-top: 1px solid var(--line); display: flex; }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--slate); font-size: .74rem; position: relative; }
.nav a svg { width: 24px; height: 24px; }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.nav a[aria-current="page"]::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; background: var(--ink); border-radius: 0 0 3px 3px; }
.nav .dot { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--rose); color: #fff; font-size: .7rem; line-height: 18px; text-align: center; font-weight: 700; }
@media (min-width: 900px) {
  .shell { padding-bottom: 24px; padding-left: 220px; }
  .nav { top: 0; right: auto; width: 220px; height: auto; flex-direction: column; justify-content: flex-start; padding: 76px 10px 10px; border-top: 0; border-right: 1px solid var(--line); }
  .nav a { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 14px; border-radius: 10px; font-size: .95rem; }
  .nav a[aria-current="page"] { background: var(--paper-2); }
  .nav a[aria-current="page"]::before { display: none; }
  .nav .dot { position: static; margin-left: auto; }
  .top { position: fixed; left: 0; right: 0; padding-left: 236px; min-height: 60px; }
  .main { padding-top: 84px; }
}

/* ---------- page parts ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.page-head p { margin: 4px 0 0; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 16px; padding: 0 16px 2px; scrollbar-width: none; }
.tabs a { flex: 0 0 auto; text-decoration: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: .92rem; color: var(--ink-2); }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--bone); border-color: var(--ink); font-weight: 700; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card, .stack > * + * { margin-top: 12px; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat .k { font-size: .82rem; color: var(--slate); }
.stat .v { font-family: var(--mono); font-weight: 600; font-size: clamp(1.02rem, 4.4vw, 1.35rem); white-space: nowrap; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: .82rem; color: var(--slate); margin-top: 2px; }
.stat.ink { background: var(--ink); color: var(--bone); border-color: var(--ink); }
.stat.ink .k, .stat.ink .s { color: #B9B2C2; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 10px; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); text-decoration: none; }
.li:first-child { border-top: 0; }
.li .grow { flex: 1; min-width: 0; }
.li .t { font-weight: 700; }
.li .d { font-size: .86rem; color: var(--slate); overflow: hidden; text-overflow: ellipsis; }
a.li:hover, button.li:hover { background: var(--paper); }
button.li { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; }
.empty { text-align: center; padding: 28px 16px; color: var(--slate); }
.empty b { display: block; color: var(--ink); margin-bottom: 4px; }
.code { font-family: var(--mono); font-weight: 600; background: var(--paper-2); border-radius: 6px; padding: 1px 7px; font-size: .92em; }

/* status badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.b-paid { background: var(--paid-bg); color: var(--paid); }
.b-pending { background: var(--wait-bg); color: var(--wait); }
.b-part { background: var(--part-bg); color: var(--part); }
.b-unpaid { background: var(--paper-2); color: var(--ink-2); }
.b-overdue { background: var(--rose-bg); color: #A3324F; }
.b-ink { background: var(--ink); color: var(--bone); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--bone); font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { background: #3A3043; }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: .9rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.wa { background: #1F7A52; border-color: #1F7A52; color: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.link { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; cursor: pointer; font-weight: 700; }

/* forms: rose = errors only */
.form { display: grid; gap: 14px; }
.field label, .field .lab { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 6px; }
.field .hint { font-size: .82rem; color: var(--slate); margin-top: 4px; }
.input, select.input, textarea.input { width: 100%; min-height: 48px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); }
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.input.err { border-color: var(--rose); }
.err-msg { color: #A3324F; font-size: .86rem; margin-top: 6px; display: flex; gap: 6px; align-items: flex-start; }
.err-msg::before { content: '!'; flex: 0 0 18px; height: 18px; border-radius: 50%; background: var(--rose); color: #fff; font-weight: 700; font-size: .75rem; text-align: center; line-height: 18px; }
.form-error { background: var(--rose-bg); border: 1px solid #EBC3CD; color: #7F2740; border-radius: 12px; padding: 10px 12px; font-size: .92rem; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: inline-block; padding: 9px 14px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--card); }
.seg input:checked + span { background: var(--ink); color: var(--bone); border-color: var(--ink); font-weight: 700; }
.seg input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--ink); }

/* ---------- the building view (signature) ---------- */
.building { --cols: 5; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 12px 0; overflow: hidden; }
.bv-roof { height: 10px; margin: 0 6px 8px 38px; border-radius: 6px 6px 0 0; background: repeating-linear-gradient(90deg, var(--ink) 0 14px, var(--ink-2) 14px 16px); opacity: .9; }
.bv-floor { display: grid; grid-template-columns: 30px repeat(var(--cols), minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; align-items: stretch; }
.bv-fl { font-family: var(--mono); font-size: .74rem; color: var(--slate); display: flex; align-items: center; justify-content: flex-end; padding-right: 4px; }
.flat { position: relative; border: 0; border-radius: 9px; padding: 7px 4px 6px; min-height: 52px; cursor: pointer; text-align: center; background: var(--paper-2); color: var(--ink);
  display: flex; flex-direction: column; justify-content: center; gap: 1px; transition: transform .12s; }
.flat:hover { transform: translateY(-1px); }
.flat .fc { font-family: var(--mono); font-weight: 600; font-size: .88rem; }
.flat .fa { font-family: var(--mono); font-size: .68rem; opacity: .85; white-space: nowrap; overflow: hidden; }
.flat.paid { background: var(--paid); color: #fff; }
.flat.pending { background: var(--wait-bg); color: var(--wait); box-shadow: inset 0 0 0 1.5px var(--wait); }
.flat.part { background: var(--part-bg); color: var(--part); box-shadow: inset 0 0 0 1.5px var(--part); }
.flat.unpaid { background: var(--paper-2); color: var(--ink); }
.flat.overdue { background: var(--card); color: #A3324F; box-shadow: inset 0 0 0 2px var(--rose); }
.flat.none { background: transparent; color: var(--slate); box-shadow: inset 0 0 0 1px var(--line); cursor: default; }
.flat.filled { background: var(--ink); color: var(--bone); }
.flat.sel { outline: 3px solid var(--ink); outline-offset: 2px; }
.bv-ground { margin: 2px -12px 0; padding: 8px 12px 10px 50px; background: var(--paper-2); font-size: .76rem; color: var(--slate); display: flex; gap: 14px; flex-wrap: wrap; border-top: 3px solid var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 10px 14px; font-size: .8rem; color: var(--slate); margin: 10px 0 0; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 5px; vertical-align: -1px; }
@media (max-width: 380px) { .flat .fa { display: none; } .flat { min-height: 40px; } }

/* progress meter */
.meter { height: 10px; background: var(--paper-2); border-radius: 6px; overflow: hidden; display: flex; }
.meter i { display: block; height: 100%; }

/* tables (desktop-friendly lists) */
.table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--slate); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table td.r, .table th.r { text-align: right; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }

/* gas entry rows */
.gas-row { display: grid; grid-template-columns: 54px 1fr 1fr 64px; gap: 8px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); }
.gas-row:first-child { border-top: 0; }
.gas-row .input { min-height: 44px; padding: 8px 10px; font-family: var(--mono); }
.gas-row .u { font-family: var(--mono); text-align: right; font-weight: 600; }
.gas-head { font-size: .76rem; color: var(--slate); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(20,16,24,.48); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.modal { background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); animation: up .2s ease-out; }
.modal .mh { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.modal .x { border: 0; background: var(--paper-2); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1.2rem; flex: 0 0 auto; }
@media (min-width: 640px) { .modal-back { align-items: center; } .modal { border-radius: 20px; } }
@keyframes up { from { transform: translateY(30px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }

#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bone);
  padding: 12px 18px; border-radius: 12px; font-weight: 700; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; max-width: calc(100% - 32px); }
#toast.on { opacity: 1; transform: translateX(-50%); }
#toast.bad { background: #7F2740; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--ink); }
.login .box { width: 100%; max-width: 420px; }
.login .brand { color: var(--bone); margin-bottom: 22px; }
.login .brand h1 { font-size: 2.2rem; }
.login .brand p { color: #B9B2C2; margin: 8px 0 0; }
.login .card { padding: 22px; }
.demo { margin-top: 16px; color: #B9B2C2; font-size: .88rem; }
.demo .grid { margin-top: 8px; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo button { background: rgba(237,237,237,.08); border: 1px solid rgba(237,237,237,.2); color: var(--bone); border-radius: 10px; padding: 9px; cursor: pointer; text-align: left; font-size: .85rem; }
.demo button b { display: block; }

/* vote */
.opt { display: block; width: 100%; text-align: left; border: 1.5px solid var(--line); background: var(--card); border-radius: 12px; padding: 12px 14px; cursor: pointer; margin-top: 8px; position: relative; overflow: hidden; }
.opt .bar { position: absolute; inset: 0 auto 0 0; background: var(--paper-2); z-index: 0; }
.opt > span { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 10px; }
.opt.mine { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

/* statement / print */
.stmt h2 { margin-bottom: 4px; }
.stmt .line { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.stmt .line.total { border-bottom: 2px solid var(--ink); font-weight: 700; }
@media print {
  .top, .nav, .no-print, #toast { display: none !important; }
  .shell { padding: 0 !important; }
  .main { padding: 0 !important; max-width: none; }
  body { background: #fff; font-size: 12pt; }
  .card { border: 0; padding: 0; }
}
.notice-k { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--slate); }
.pill-date { font-family: var(--mono); font-size: .8rem; background: var(--paper-2); padding: 2px 8px; border-radius: 6px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.stat .k svg, .li svg:not(.nav svg) { width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; }
.lang-btn { border: 1px solid rgba(237,237,237,.35); background: none; color: var(--bone); border-radius: 999px; padding: 5px 12px; font-size: .82rem; cursor: pointer; white-space: nowrap; }
:root:lang(bn) { --body: 'Atkinson Hyperlegible', 'Hind Siliguri', system-ui, sans-serif; --display: 'Hind Siliguri', 'Bricolage Grotesque', sans-serif; }
:lang(bn) body { line-height: 1.55; }
:lang(bn) h1, :lang(bn) h2 { font-weight: 700; letter-spacing: 0; }
.stat .v.vt { white-space: normal; font-family: var(--body); font-weight: 700; line-height: 1.25; }

/* gas bill slips: 4 per A4 page */
.gslips { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.gslip { border: 1.5px dashed var(--line); border-radius: 10px; padding: 14px 16px; background: var(--card); break-inside: avoid; }
.gslip-m { font-family: var(--display); font-size: 1.15rem; font-weight: 700; margin: 2px 0 8px; }
.gslip-code { font-family: var(--mono); font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.gslip-l { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dotted var(--line); font-variant-numeric: tabular-nums; }
.gslip-t { border-bottom: 2px solid var(--ink); font-weight: 700; font-size: 1.1rem; }
@media print {
  @page { size: A4; margin: 8mm; }
  .gslips { grid-template-columns: 1fr 1fr; gap: 0; }
  .gslip { height: 138mm; border-radius: 0; border: 1px dashed #888; padding: 10mm; font-size: 12pt; color: #000; background: #fff; }
  .gslip:nth-child(4n) { break-after: page; }
}
.card h2 svg, .page-head h1 svg { width: 22px; height: 22px; vertical-align: -4px; margin-right: 4px; }
.flat.gaslate { background: #C62828; color: #fff; box-shadow: none; }
.flat.handed { background: #2B5BA8; color: #fff; box-shadow: none; }
.flat.handed .fa::before { content: '✉ '; }
.flat.titas { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--paper-2) 6px 8px); color: var(--slate); box-shadow: inset 0 0 0 1px var(--line); cursor: default; }

/* All tab: left half = gas, right half = service charge */
.flat.split { --g: #8A8F98; --s: #8A8F98; background: linear-gradient(90deg, var(--g) 0 50%, var(--s) 50% 100%); color: #fff; box-shadow: none; text-shadow: 0 1px 2px rgba(0,0,0,.55); }
.flat.g-paid { --g: #2E7D5B; } .flat.s-paid { --s: #2E7D5B; }
.flat.g-late { --g: #C62828; } .flat.s-late { --s: #C62828; }
.flat.g-pending { --g: #D99A00; } .flat.s-pending { --s: #D99A00; }
.flat.g-unpaid { --g: #8A8F98; } .flat.s-unpaid { --s: #8A8F98; }
.flat.g-none { --g: #A3A7AF; }
.split-key { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; color: var(--slate); }
/* no gas bill: one colour (service charge) with a dashed white frame */
.flat.split.nogas { background: var(--s); box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 4px var(--s); outline: 2px dashed rgba(0,0,0,.35); outline-offset: -6px; }
/* donut charts (All tab) */
.dn-body { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.dn-big { font: 700 12px var(--mono); fill: var(--ink); }
.dn-small { font: 11px var(--body); fill: var(--slate); }
.dn-seg { transition: stroke-width .15s; cursor: default; }
.dn-seg:hover { stroke-width: 20; }
.dn-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 180px; font-size: .86rem; }
.dn-legend li { display: grid; grid-template-columns: 12px 1fr auto 38px; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px dotted var(--line); }
.dn-legend i { width: 12px; height: 12px; border-radius: 3px; display: block; }
.dn-legend b { font-family: var(--mono); font-weight: 600; color: var(--ink); }
.dn-legend em { font-style: normal; color: var(--slate); text-align: right; }
.flat.xtra { position: relative; }
.flat.xtra::after { content: ''; position: absolute; top: 5px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: #FFD54F; box-shadow: 0 0 0 2px rgba(0,0,0,.45); }
/* Floor / Flat / Bill pickers: big enough to hit the right choice with a thumb */
.big-select { min-height: 52px; font-size: 1.05rem; font-weight: 600; padding: 10px 40px 10px 14px; border-width: 2px; cursor: pointer; }
.big-select option { font-size: 1.1rem; padding: 10px; }
@media (max-width: 640px) {
  .big-select { min-height: 60px; font-size: 1.2rem; }
  .field .lab { font-size: .95rem; }
}
/* full-screen chooser for Floor / Flat / Bill */
.pick-btn { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; background: var(--card); color: var(--ink); }
.fpick { position: fixed; inset: 0; z-index: 1000; background: var(--paper, #f6f5f2); display: flex; flex-direction: column; padding: 16px; padding-top: max(16px, env(safe-area-inset-top)); overflow: auto; }
.fpick-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.fpick-head h2 { margin: 0; font-size: 1.5rem; }
.fpick-x { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--ink); }
.fpick-grid { display: grid; grid-template-columns: repeat(var(--cols), 1fr); grid-auto-rows: minmax(72px, 1fr); gap: 10px; flex: 1; align-content: stretch; }
.fpick-opt { min-height: 72px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); color: var(--ink); font-size: 1.35rem; font-weight: 700; cursor: pointer; padding: 10px; }
.fpick-opt.on { background: var(--ink); color: var(--bone, #EDEDED); border-color: var(--ink); }
.fpick-opt:active { transform: scale(.97); }
/* voice typing */
.voice-wrap { position: relative; }
.voice-wrap > .input { padding-right: 58px; }
.voice-btn { position: absolute; right: 6px; top: 6px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--paper-2); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.voice-btn.on { background: #C62828; color: #fff; animation: vpulse 1.1s ease-in-out infinite; }
@keyframes vpulse { 50% { box-shadow: 0 0 0 8px rgba(198,40,40,.18); } }
@media (prefers-reduced-motion: reduce) { .voice-btn.on { animation: none; } }
/* generator tab */
.gen-alert { display: block; background: #C62828; color: #fff; font-weight: 700; padding: 14px 16px; border-radius: 12px; margin-bottom: 14px; text-decoration: none; font-size: 1.05rem; }
.gen-big { font-family: var(--display); font-size: 2rem; font-weight: 800; line-height: 1.1; margin: 4px 0; }
.gen-state.on { border-color: #2E7D5B; box-shadow: inset 0 0 0 2px #2E7D5B; }
.gen-state.on .gen-big { color: #2E7D5B; }
.fuel-bar { position: relative; height: 14px; border-radius: 99px; background: var(--paper-2); overflow: hidden; margin-top: 6px; }
.fuel-bar i { display: block; height: 100%; border-radius: 99px; }
.fuel-bar i.paid { background: #2E7D5B; } .fuel-bar i.pending { background: #D99A00; } .fuel-bar i.gaslate { background: #C62828; }
.fuel-bar b { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); opacity: .6; }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #2E7D5B; box-shadow: 0 0 0 3px rgba(46,125,91,.2); vertical-align: 1px; }
/* Home > Apartment bills */
.apt-bill { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 12px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; font-size: 1.1rem; min-height: 130px; justify-content: center; }
.apt-bill:active { transform: scale(.98); }
.apt-ic { font-size: 2.2rem; line-height: 1; }
/* Dashboard: charts only */
.dash { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; align-items: stretch; }
.dash-1 { grid-template-columns: 1fr; }
.dash-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 720px) { .dash-2 { grid-template-columns: 1fr; } }
.dash-sec { margin-bottom: 22px; }
.dash-sec > h2 { font-size: 1.15rem; margin: 0 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
@media (max-width: 380px) { .dash { grid-template-columns: 1fr; } }
.dash-link { display: block; text-decoration: none; color: inherit; }
.dash-link > .card { height: 100%; transition: border-color .15s, box-shadow .15s; }
.dash-link:hover > .card, .dash-link:focus-visible > .card { border-color: var(--ink); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.hbars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: .86rem; }
.hbar-l { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-t { height: 12px; background: var(--paper-2); border-radius: 99px; overflow: hidden; }
.hbar-t i { display: block; height: 100%; background: var(--ink); border-radius: 0 4px 4px 0; }
.hbar b { font-family: var(--mono); font-weight: 600; }
/* Gas reading tab: fixed last month, − / + for this month */
.gas-step .gas-row { grid-template-columns: 48px minmax(64px, .8fr) minmax(150px, 1.7fr) 52px; }
.gas-row .input.fixed { background: var(--paper-2); border-color: transparent; color: var(--ink-2); pointer-events: none; }
.stepper { display: grid; grid-template-columns: 44px 1fr 44px; gap: 4px; align-items: center; }
.stepper .input { text-align: center; padding: 8px 4px; }
.st-btn { height: 44px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); font-size: 1.4rem; font-weight: 700; color: var(--ink); cursor: pointer; }
.st-btn.plus { background: var(--ink); color: var(--bone, #EDEDED); border-color: var(--ink); }
.st-btn:disabled { opacity: .4; cursor: default; }
/* Phones: tabs wrap into two rows so every tab is visible (no hidden sideways scroll) */
@media (max-width: 640px) {
  .tabs { flex-wrap: wrap; overflow: visible; margin: 0 0 14px; padding: 0; gap: 8px; }
  .tabs a { flex: 1 1 calc(50% - 8px); text-align: center; padding: 11px 8px; font-size: .95rem; }
}
.demo button .mono { display: block; margin-top: 3px; font-family: var(--mono); font-size: .8rem; opacity: .85; letter-spacing: .02em; }
