/* ভ্রমণ খাতা — styles
   Layout: a ledger page. Map and 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;
  --map-empty: #ECD9DE;
  --map-mid: #E9A3B4;
  --map-stroke: #FFFFFF;
  --me: #C2183F;
  --friend: #1F6FC4;
  --both: #5A2A82;
  --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;
    --map-empty: #38212A; --map-mid: #8A3550; --map-stroke: #160A0E;
    --me: #FF577F; --friend: #5AA9F2; --both: #B88BE8; --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;
  --map-empty: #38212A; --map-mid: #8A3550; --map-stroke: #160A0E;
  --me: #FF577F; --friend: #5AA9F2; --both: #B88BE8; --ok: #5FD39E;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
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; }

/* intro + ledger strip */
.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: 46ch; }
.ledger {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-block: 22px 20px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
}
.ledger div { padding: 12px 14px; border-left: 1px solid var(--line); min-width: 0; }
.ledger div:first-child { border-left: 3px double var(--accent); }
.ledger dt { font-size: 13px; color: var(--muted); }
.ledger dd { margin: 0; font: 700 24px/1.25 var(--f-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger dd small { font: 500 14px var(--f-body); color: var(--muted); }
.ledger .lvl dd { font-size: 19px; color: var(--accent); white-space: normal; }

.challenge {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding: 12px 14px; margin-bottom: 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; }

.cols { display: grid; gap: 24px; 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; }
}
h2 { font: 700 22px/1.25 var(--f-display); margin: 0 0 10px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 12px; }

/* tabs */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--map-empty); 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); }
.map-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }

/* map */
.map-box { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 8px; }
#map { display: block; width: 100%; height: auto; max-height: 78vh; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
#map path { vector-effect: non-scaling-stroke; }
#map .d { fill: var(--map-empty); stroke: var(--map-stroke); stroke-width: 1; cursor: pointer; transition: fill .15s; }
#map .d.on { fill: var(--accent); }
#map.um .d.on { fill: var(--map-mid); }
#map.foc .d:not(.cur) { opacity: .45; }
#map .u { fill: transparent; stroke: none; pointer-events: none; }
#map .u.on { fill: var(--accent); }
#map .u.cur { pointer-events: auto; cursor: pointer; stroke: var(--map-stroke); stroke-width: 1; fill: var(--map-empty); }
#map .u.cur.on { fill: var(--accent); }
#map text {
  font-family: var(--f-body); font-weight: 600; fill: var(--ink); text-anchor: middle; dominant-baseline: middle;
  pointer-events: none; paint-order: stroke; stroke: var(--surface); stroke-linejoin: round;
}
@media (hover: hover) { #map .d:hover, #map .u.cur:hover { filter: brightness(.93); } }
.back {
  position: absolute; top: 12px; left: 12px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 5px 14px; font-weight: 600; font-size: 14px;
}
.hint { font-size: 14px; color: var(--muted); margin: 8px 2px 0; }

/* upazila panel + lists */
.panel { margin-top: 14px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.row h3 { font: 700 17px/1.3 var(--f-display); margin: 0; }
.row h3 span { font: 500 14px var(--f-body); color: var(--muted); font-variant-numeric: tabular-nums; }
.mini { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 3px 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 5px 12px; font-size: 15px; line-height: 1.35;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chip.part { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.chip small { font-size: 12px; opacity: .8; margin-left: 4px; font-variant-numeric: tabular-nums; }
.search { width: 100%; margin-top: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.divs { display: grid; gap: 16px; margin-top: 16px; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

/* 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; }
.sw { width: 34px; height: 34px; 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;
}
.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; }

/* badges */
.block { margin-top: 44px; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge { padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--r); color: var(--muted); min-width: 0; }
.badge b { display: block; font: 700 16px/1.3 var(--f-display); }
.badge span { font-size: 13px; line-height: 1.4; display: block; margin-top: 2px; }
.badge.got { border: 1px solid var(--accent); background: var(--accent-soft); color: var(--ink); }
.badge.got b { color: var(--accent); }

/* compare */
.cmp { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 720px) { .cmp { grid-template-columns: minmax(0, 1fr) 300px; } }
.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); }
#cmpMap { width: 100%; height: auto; display: block; }
#cmpMap path { stroke: var(--bg); stroke-width: 1; vector-effect: non-scaling-stroke; fill: var(--map-empty); }
#cmpMap .me { fill: var(--me); } #cmpMap .fr { fill: var(--friend); } #cmpMap .bo { fill: var(--both); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 15px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.verdict { font: 700 20px/1.35 var(--f-display); margin: 16px 0 4px; }
.next { color: var(--muted); font-size: 15px; margin: 6px 0 0; }

/* promo + 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); }
.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 b { font: 700 18px var(--f-display); font-variant-numeric: tabular-nums; }
.bar span { font-size: 13px; color: var(--muted); margin-left: 6px; }
@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;
  background: var(--ink); color: var(--bg); padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  max-width: calc(100% - 32px); text-align: center;
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* collapsible district list */
.list { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 0 14px; }
.list summary { cursor: pointer; padding: 12px 0; font: 700 17px/1.3 var(--f-display); list-style-position: inside; }
.list[open] { padding-bottom: 16px; }
.list .chip { background: var(--bg); }
.list .chip.on { background: var(--accent); }

@media (max-width: 560px) {
  .ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger div:nth-child(3) { border-left: 3px double var(--accent); }
  .ledger div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
