/* দেশি মিটার — styles
   Same look as ভ্রমণ খাতা: a ledger page. The tick-list on the left, the share card pinned on the right; one column on phones. */
:root {
  --bg: #FBF6F7;
  --surface: #FFFFFF;
  --ink: #26121A;
  --muted: #7C626B;
  --line: #EBDCE0;
  --accent: #C2183F;
  --accent-ink: #FFFFFF;
  --accent-soft: #FBE7EC;
  --track: #ECD9DE;
  --me: #C2183F;
  --friend: #1F6FC4;
  --ok: #1D7A4F;

  --f-display: "Anek Bangla", "Hind Siliguri", "Noto Sans Bengali", system-ui, sans-serif;
  --f-body: "VK Digits", "Hind Siliguri", "Noto Sans Bengali", system-ui, sans-serif;
  --r: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #160A0E; --surface: #211118; --ink: #F7EAEE; --muted: #B799A3; --line: #3A222B;
    --accent: #FF577F; --accent-ink: #1B070D; --accent-soft: #3A1622;
    --track: #38212A;
    --me: #FF577F; --friend: #5AA9F2; --ok: #5FD39E;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #160A0E; --surface: #211118; --ink: #F7EAEE; --muted: #B799A3; --line: #3A222B;
  --accent: #FF577F; --accent-ink: #1B070D; --accent-soft: #3A1622;
  --track: #38212A;
  --me: #FF577F; --friend: #5AA9F2; --ok: #5FD39E;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.6 var(--f-body);
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 16px; padding-block: 0 96px; }

/* top bar */
.top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-block: 18px 6px; }
.brand { font: 800 26px/1 var(--f-display); color: var(--accent); text-decoration: none; }
.by { font-size: 14px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.by b { color: var(--ink); font-weight: 600; }

/* inside Facebook / Messenger: say up front that saving needs the real browser. Stays in view while the page scrolls. */
.stick { position: sticky; top: 0; z-index: 6; background: var(--bg); margin-inline: -16px; padding: 6px 16px; border-bottom: 1px solid var(--line); }
.iab { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 6px 6px 12px; border-radius: 12px; background: var(--accent-soft); font-size: 13px; line-height: 1.35; }
.iab .btn { flex: none; padding: 5px 12px; font-size: 13px; white-space: nowrap; }

/* intro */
.intro h1 { font: 800 clamp(30px, 6.2vw, 50px)/1.15 var(--f-display); margin: 18px 0 8px; text-wrap: balance; }
.intro p { margin: 0; color: var(--muted); max-width: 48ch; }

.challenge {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding: 12px 14px; margin-top: 18px; border-radius: var(--r);
  background: var(--accent-soft); border: 1px solid var(--line);
}
.challenge p { margin: 0; flex: 1 1 220px; min-width: 0; font: 700 18px/1.4 var(--f-display); }

/* the live meter */
.meter {
  margin-block: 20px 24px; padding: 16px 18px 14px; background: var(--surface);
  border: 1px solid var(--line); border-left: 3px double var(--accent); border-radius: var(--r);
}
.m-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.m-score { font: 800 clamp(52px, 15vw, 76px)/0.95 var(--f-display); color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.m-score small { font: 700 0.36em/1 var(--f-display); color: var(--muted); margin-left: 2px; }
.m-level { text-align: right; min-width: 0; flex: 1 1 150px; }
.m-level span { display: block; font-size: 13px; color: var(--muted); }
.m-level strong {
  display: inline-block; margin-top: 2px; padding: 4px 14px 3px; border-radius: 999px; text-align: center;
  background: var(--accent); color: var(--accent-ink); font: 800 clamp(18px, 5.2vw, 24px)/1.3 var(--f-display);
}
.m-bar { position: relative; height: 14px; margin-top: 14px; border-radius: 999px; background: var(--track); overflow: hidden; }
.m-bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px; background: var(--accent); transition: width .25s ease-out; }
/* notches where one level ends and the next begins */
.m-bar::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent calc(20% - 1px), var(--surface) calc(20% - 1px), var(--surface) calc(20% + 1px), transparent calc(20% + 1px),
    transparent calc(40% - 1px), var(--surface) calc(40% - 1px), var(--surface) calc(40% + 1px), transparent calc(40% + 1px),
    transparent calc(60% - 1px), var(--surface) calc(60% - 1px), var(--surface) calc(60% + 1px), transparent calc(60% + 1px),
    transparent calc(80% - 1px), var(--surface) calc(80% - 1px), var(--surface) calc(80% + 1px), transparent calc(80% + 1px));
}
.m-blurb { margin: 10px 0 0; font-weight: 600; }
.m-next { margin: 2px 0 0; font-size: 14px; color: var(--muted); }

.cols { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) {
  .cols { grid-template-columns: minmax(0, 1fr) 372px; gap: 32px; }
  .card-pane { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 2px 4px 2px 2px; scrollbar-width: thin; }
}
h2 { font: 700 22px/1.25 var(--f-display); margin: 0 0 10px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 12px; }

/* segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--track); border-radius: 999px; }
.seg button { border: 0; background: transparent; padding: 6px 16px; border-radius: 999px; font-weight: 600; font-size: 15px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .12); }

/* category panels + tick rows */
.cats { display: grid; gap: 14px; }
.panel { padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); scroll-margin-top: 60px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.row h3 { font: 700 19px/1.3 var(--f-display); margin: 0; }
.row h3 span { font: 600 14px var(--f-body); color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 4px; white-space: nowrap; }
.panel.full .row h3 span { color: var(--ok); }
.mini { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 5px 14px; font-size: 13px; font-weight: 600; color: var(--muted); }
.items { display: grid; gap: 6px; margin-top: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 620px) { .items { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) and (max-width: 1040px) { .items { grid-template-columns: minmax(0, 1fr); } }
.item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; text-align: start;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  font-size: 16px; line-height: 1.4; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.item .box {
  flex: none; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--muted); background: var(--surface);
  display: grid; place-items: center; color: transparent;
}
.item .box svg { width: 15px; height: 15px; display: block; }
.item[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
.item[aria-pressed="true"] .box { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
@media (hover: hover) { .item:hover { border-color: var(--accent); } }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 18px; }
.confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 14px; border: 1px solid var(--accent); border-radius: var(--r); background: var(--accent-soft); width: 100%; }
.confirm p { margin: 0; flex: 1 1 200px; min-width: 0; font-size: 15px; }
.confirm div { display: flex; gap: 8px; flex-wrap: wrap; }

/* card pane */
.preview { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.preview.story { max-width: 260px; margin-inline: auto; }
.field { display: grid; gap: 4px; margin-top: 14px; }
.field > span, .field > label { font-size: 13px; color: var(--muted); }
.field input[type="text"] { padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); width: 100%; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#themes { display: grid; grid-template-columns: repeat(5, 40px); gap: 10px 12px; }
.sw { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); padding: 0; position: relative; overflow: hidden; }
.sw::after { content: ""; position: absolute; inset: 0 0 0 50%; background: var(--b); }
.sw[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  border-radius: 999px; padding: 10px 20px; font-weight: 700; text-decoration: none; text-align: center;
}
.btn.ghost { background: transparent; color: var(--accent); }
.btn.sm { padding: 6px 14px; font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.actions .btn { flex: 1 1 140px; }
.note { font-size: 13px; color: var(--muted); margin: 8px 0 0; }

/* compare */
.block { margin-top: 44px; scroll-margin-top: 60px; }
.card-pane { scroll-margin-top: 60px; }
.cmp { max-width: 640px; }
.cmp-in { display: flex; gap: 8px; flex-wrap: wrap; }
.cmp-in input { flex: 1 1 220px; min-width: 0; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.wait { margin: 16px 0 0; padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--r); color: var(--muted); }
.duel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.duel div { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.duel span { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duel b { display: block; font: 800 34px/1.15 var(--f-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.duel b small { font: 600 15px var(--f-body); color: var(--muted); }
.duel em { display: block; font-style: normal; font-size: 14px; color: var(--muted); }
.duel .me { border-top: 4px solid var(--me); } .duel .me span { color: var(--me); }
.duel .fr { border-top: 4px solid var(--friend); } .duel .fr span { color: var(--friend); }
.verdict { font: 700 20px/1.35 var(--f-display); margin: 16px 0 4px; }
.next { color: var(--muted); font-size: 15px; margin: 6px 0 0; }
.crows { display: grid; gap: 10px; margin-top: 14px; }
.crow b { display: block; font: 700 15px/1.3 var(--f-display); margin-bottom: 3px; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cb { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cb i { flex: 1 1 auto; min-width: 0; height: 12px; border-radius: 999px; background: var(--track); position: relative; overflow: hidden; }
.cb i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); border-radius: 999px; background: var(--me); }
.cb.fr i::after { background: var(--friend); }
.cb span { flex: none; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 3.4em; text-align: right; }

/* promo, sister sites, footer */
.promo {
  margin-top: 48px; padding: 22px; border-radius: var(--r);
  background: var(--accent); color: var(--accent-ink);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
}
.promo h2 { margin: 0 0 2px; font-size: 24px; }
.promo p { margin: 0; opacity: .92; max-width: 44ch; }
.promo .btn { background: var(--accent-ink); color: var(--accent); border-color: var(--accent-ink); }
.sis { display: grid; gap: 10px; margin-top: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 620px) { .sis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sis a {
  display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  color: var(--ink); text-decoration: none; line-height: 1.45;
}
.sis a b { display: block; font: 700 18px/1.3 var(--f-display); color: var(--accent); }
.foot { margin-top: 28px; font-size: 13px; color: var(--muted); max-width: 70ch; }

/* phone bottom bar */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-top: 1px solid var(--line);
}
.bar > div { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar b { font: 700 18px var(--f-display); font-variant-numeric: tabular-nums; }
.bar span { font-size: 13px; color: var(--muted); margin-left: 6px; }
.bar .btn { flex: none; }
@media (min-width: 900px) { .bar { display: none; } .wrap { padding-block-end: 56px; } }

.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 9;
  width: max-content; max-width: min(340px, calc(100% - 32px));
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 16px;
  font-size: 14px; font-weight: 600; line-height: 1.45; text-align: center;
  box-shadow: 0 10px 28px rgb(0 0 0 / .28); animation: toast-in .22s ease-out;
}
.toast.top { top: 66px; bottom: auto; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } html { scroll-behavior: auto; } }

/* "save your card" sheet, shown where a normal download cannot work (Facebook / Messenger in-app browser) */
.sheet {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center;
  background: rgb(20 6 10 / .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: sheet-fade .2s ease-out;
}
.sheet-box {
  position: relative; width: 100%; max-width: 440px; max-height: 96vh; overflow-y: auto;
  background: var(--surface); color: var(--ink);
  border-radius: 28px 28px 0 0; padding: 10px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  display: grid; gap: 10px; justify-items: stretch; text-align: center;
  box-shadow: 0 -12px 40px rgb(0 0 0 / .28);
  animation: sheet-up .28s cubic-bezier(.2, .9, .3, 1);
}
.sheet-box .grab { justify-self: center; width: 44px; height: 5px; border-radius: 99px; background: var(--line); }
.sheet-box .x {
  position: absolute; top: 14px; right: 14px; z-index: 1; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface); color: var(--ink); box-shadow: 0 2px 8px rgb(0 0 0 / .18);
}
.sheet-box .shot {
  margin-top: 2px; padding: 16px; border-radius: 20px;
  background: radial-gradient(120% 90% at 50% 0%, var(--accent-soft), transparent 70%), var(--bg);
}
.sheet-box img {
  display: block; width: auto; max-width: 100%; max-height: 36vh; margin-inline: auto; border-radius: 10px;
  box-shadow: 0 10px 26px rgb(0 0 0 / .22), 0 0 0 1px rgb(0 0 0 / .06);
  -webkit-touch-callout: default; user-select: auto; -webkit-user-select: auto;
}
.sheet-box h2 { margin: 6px 0 0; font: 800 23px/1.25 var(--f-display); }
.sheet-box .sub { margin: 0 auto 4px; max-width: 34ch; font-size: 14px; line-height: 1.5; }
.btn.big { padding: 14px 20px; font-size: 17px; gap: 10px; border-width: 2px; }
@media (max-width: 360px) { .btn.big { padding: 12px 14px; font-size: 15px; } }
.sheet-box .btn.big:not(.ghost) { box-shadow: 0 8px 20px -6px var(--accent); }
.sheet-box .btn svg { flex: none; }
.sheet-box .tips {
  margin: 4px 0 0; padding: 12px 14px 12px 30px; border-radius: 14px; background: var(--bg);
  text-align: start; font-size: 12.5px; line-height: 1.5; color: var(--muted); display: grid; gap: 4px;
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
@keyframes sheet-fade { from { opacity: 0; } }
@media (min-width: 600px) { .sheet { align-items: center; } .sheet-box { border-radius: 28px; } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-box, .toast { animation: none; } }
.ver { opacity: .55; font-size: 11px; white-space: nowrap; }
