:root {
  --green: #1E6B45; --green-d: #14502F; --ink: #16231B; --muted: #5B6660; --line: #E6E6DF; --line2: #DCDDD6;
  --bg: #FBFAF6; --card: #FFFFFF; --sand: #F3EBD3; --sand-ink: #6B4E00; --blue-bg: #E8F0FA; --blue: #1F4E8C;
  --orange: #D98E04; --veg: #1E7A3C; --non: #A23B2A; --you: #1F6FD1;
  --tabs: 64px; --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: Inter, 'Noto Sans Malayalam', system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
#app { position: fixed; inset: 0; overflow: hidden; }
#map { position: absolute; inset: 0; bottom: calc(var(--tabs) + var(--safe-b)); background: #EEEDE6; }
.leaflet-container { font-family: inherit; }

/* top */
.top { position: absolute; left: 0; right: 0; top: 0; padding: 12px 12px 0; padding-top: max(12px, env(safe-area-inset-top)); z-index: 500; pointer-events: none; }
.top > * { pointer-events: auto; }
.search { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 8px 0 14px; background: var(--card); border-radius: 14px; box-shadow: 0 2px 8px rgba(22,35,27,.14); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; }
.search input::-webkit-search-cancel-button { display: none; }
.search.big { box-shadow: none; border: 1px solid var(--line2); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; height: 36px; padding: 0 14px; border-radius: 18px; border: 0; background: var(--card); font-size: 13px; font-weight: 500; box-shadow: 0 1px 4px rgba(22,35,27,.14); white-space: nowrap; }
.chip.on { background: var(--green); color: #fff; font-weight: 600; }
.chip.road:not(.on) { background: #FFF4D6; color: var(--sand-ink); font-weight: 600; }
.chip.icon { width: 46px; padding: 0; display: flex; align-items: center; justify-content: center; position: relative; }
.chip .count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--green); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.icon-btn { width: 44px; height: 44px; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; border-radius: 22px; color: var(--ink); }
.icon-btn.small { width: 36px; height: 36px; }
.icon-btn[aria-pressed="true"] { color: var(--green); background: #E4EDE6; }
.fab { position: absolute; right: 14px; width: 48px; height: 48px; border-radius: 24px; border: 0; background: var(--card); color: var(--you); box-shadow: 0 2px 8px rgba(22,35,27,.18); display: flex; align-items: center; justify-content: center; z-index: 450; transition: bottom .25s; }

/* sheet */
.sheet { position: absolute; left: 0; right: 0; bottom: calc(var(--tabs) + var(--safe-b)); background: var(--bg); border-radius: 22px 22px 0 0; box-shadow: 0 -4px 16px rgba(22,35,27,.14); z-index: 460; display: flex; flex-direction: column; transition: height .25s ease; touch-action: none; }
.sheet[data-state="peek"] { height: 132px; }
.sheet[data-state="half"] { height: 44%; }
.sheet[data-state="full"] { height: calc(100% - var(--tabs) - 132px); }
.sheet.dragging { transition: none; }
.sheet-grab { display: flex; justify-content: center; padding: 10px 0 6px; cursor: grab; }
.sheet-grab span { width: 40px; height: 5px; border-radius: 3px; background: #CFD2CA; }
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 0 18px 8px; }
.sheet-head h2 { margin: 0; font: 700 17px 'Space Grotesk', Inter, sans-serif; }
.sheet-head span { font-size: 12px; color: var(--muted); text-align: right; }
.list { list-style: none; margin: 0; padding: 0 14px 16px; overflow-y: auto; flex: 1; touch-action: pan-y; display: flex; flex-direction: column; gap: 10px; }
.empty { padding: 14px 6px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.empty button { margin-top: 10px; }
.card { display: flex; gap: 12px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.card .thumb { flex: 0 0 64px; height: 64px; border-radius: 12px; background: #E4EDE6; display: flex; align-items: center; justify-content: center; color: var(--green); }
.card .thumb.road { background: #FFF4D6; color: var(--orange); }
.card .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.card .name { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; }
.card .name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.card .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.card .meta .open { color: var(--green); font-weight: 600; }
.card .meta .closed { color: var(--non); font-weight: 600; }
.card .ahead { font-size: 13px; font-weight: 700; color: var(--ink); }
.diet { flex: 0 0 auto; width: 12px; height: 12px; border: 1.5px solid; border-radius: 2px; display: inline-flex; align-items: center; justify-content: center; }
.diet::after { content: ''; width: 6px; height: 6px; border-radius: 3px; background: currentColor; }
.diet.veg { color: var(--veg); } .diet.non { color: var(--non); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--sand); color: var(--sand-ink); }
.tag.blue { background: var(--blue-bg); color: var(--blue); }
.tag.green { background: #E4EDE6; color: var(--green); }
.tag.grey { background: #EEEEE8; color: var(--muted); }

/* route bar */
.route-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 0 14px 10px; padding: 8px 10px; border-radius: 12px; background: #16231B; color: #fff; font-size: 13px; }
.route-bar #route-text { flex: 1 1 100%; font-weight: 600; }
.route-bar .icon-btn { color: #fff; }
.route-bar .icon-btn[aria-pressed="true"] { background: #2C4A38; color: #FFD27A; }
.route-bar .link-btn { color: #FFD27A; margin-left: auto; }
.switch { display: flex; align-items: center; gap: 6px; min-height: 36px; }
.switch input { width: 18px; height: 18px; accent-color: #FFD27A; }
#app.big-text .card .name { font-size: 19px; } #app.big-text .card .ahead { font-size: 17px; }

/* tabs */
.tabs { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--tabs) + var(--safe-b)); padding-bottom: var(--safe-b); background: var(--card); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); z-index: 600; }
.tabs button { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 500; color: var(--muted); }
.tabs button.on { color: var(--green); font-weight: 700; }

/* full screens */
.screen { position: absolute; inset: 0; background: var(--bg); z-index: 1200; display: flex; flex-direction: column; }
.bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top)); border-bottom: 1px solid var(--line); min-height: 56px; }
.bar h2 { margin: 0; font: 700 17px 'Space Grotesk', Inter, sans-serif; }
.bar-gap { width: 56px; }
.link-btn { border: 0; background: transparent; font-weight: 600; font-size: 15px; color: var(--green); min-height: 44px; padding: 0 4px; }
.link-btn.grey { color: var(--muted); }
.scroll { flex: 1; overflow-y: auto; padding: 4px 18px 24px; }
.scroll h3 { font-size: 14px; margin: 18px 0 10px; }
.opt { font-weight: 400; color: var(--muted); }
.foot { padding: 12px 18px; padding-bottom: max(14px, var(--safe-b)); border-top: 1px solid var(--line); background: var(--bg); }
.primary { width: 100%; height: 52px; border: 0; border-radius: 14px; background: var(--green); color: #fff; font-weight: 700; font-size: 16px; }
.primary:disabled { opacity: .5; }
.secondary { height: 46px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card); font-weight: 600; font-size: 14px; padding: 0 14px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-btn { height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line2); background: var(--card); font-size: 13px; font-weight: 500; }
.opt-btn[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.field { width: 100%; height: 46px; border: 1px solid var(--line2); border-radius: 12px; padding: 0 12px; background: var(--card); font-size: 15px; margin-top: 2px; }
textarea.field { height: 90px; padding: 10px 12px; resize: vertical; }
.warn { font-size: 12px; color: var(--muted); text-align: center; margin: 16px 0 0; }
.f-group h3 { margin-top: 20px; }

/* spotted */
.spot-map-wrap { position: relative; height: 170px; border-radius: 16px; overflow: hidden; margin-top: 10px; background: #E8EDE6; }
#spot-map { position: absolute; inset: 0; }
.spot-pin { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 11px; background: var(--orange); border: 4px solid #fff; box-shadow: 0 0 0 10px rgba(217,142,4,.22); z-index: 500; pointer-events: none; }
.spot-note { position: absolute; left: 10px; bottom: 10px; background: #fff; border-radius: 8px; padding: 4px 8px; font-size: 12px; font-weight: 600; z-index: 500; }
.cat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cat { height: 76px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: 600 14px 'Noto Sans Malayalam', Inter, sans-serif; padding: 4px; }
.cat small { font: 500 11px Inter, sans-serif; color: var(--muted); }
.cat[aria-pressed="true"] { border-color: var(--orange); background: #FFF4D6; }

/* place page */
.hero { height: 150px; position: relative; display: flex; align-items: center; justify-content: center; background: #E4EDE6; color: var(--green); flex: 0 0 auto; }
.hero.road { background: #FFF4D6; color: var(--orange); }
.hero .icon-btn { position: absolute; top: max(14px, env(safe-area-inset-top)); background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.hero .back { left: 14px; } .hero .save { right: 14px; }
.hero .save[aria-pressed="true"] { color: var(--green); }
.p-body { flex: 1; overflow-y: auto; padding: 16px 18px 28px; display: flex; flex-direction: column; gap: 16px; }
.p-title h1 { margin: 6px 0 2px; font: 700 24px 'Space Grotesk', 'Noto Sans Malayalam', sans-serif; }
.p-title .ml { font: 600 16px 'Noto Sans Malayalam', sans-serif; color: var(--muted); }
.p-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.kind-label { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .5px; padding: 3px 8px; border-radius: 6px; background: #E4EDE6; color: var(--green); }
.kind-label.road { background: #FFF4D6; color: var(--sand-ink); }
.actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.actions a, .actions button { height: 62px; border-radius: 14px; border: 1px solid var(--line2); background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; }
.actions .go { background: var(--green); border-color: var(--green); color: #fff; }
.actions [aria-disabled="true"] { opacity: .4; pointer-events: none; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.box h2 { margin: 0; font-size: 15px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.box h2 small { font-weight: 400; font-size: 12px; color: var(--muted); }
.special { background: var(--sand); border-radius: 14px; padding: 12px 14px; }
.special small { display: block; font-size: 11px; font-weight: 700; color: var(--sand-ink); letter-spacing: .4px; }
.special b { font-size: 15px; }
.bar-row { display: flex; flex-direction: column; gap: 4px; }
.bar-row div:first-child { display: flex; justify-content: space-between; font-size: 13px; }
.meter { height: 8px; border-radius: 4px; background: #ECEDE7; overflow: hidden; }
.meter i { display: block; height: 8px; border-radius: 4px; background: var(--green); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.two button { height: 46px; border-radius: 12px; font-weight: 600; font-size: 14px; border: 1px solid var(--line2); background: var(--card); }
.two button.yes { background: var(--green); border-color: var(--green); color: #fff; }
.q-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
.q-row .opts { flex: 0 0 auto; }
.seen-dot { width: 10px; height: 10px; border-radius: 5px; background: var(--veg); display: inline-block; margin-right: 6px; }
.seen-dot.old { background: var(--orange); }
.facts { display: flex; flex-wrap: wrap; gap: 8px; }
.fact { height: 32px; padding: 0 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line2); font-size: 13px; display: flex; align-items: center; }
.dashed { border: 1px dashed #B9BCB2; border-radius: 14px; padding: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; }
.dashed b { display: block; font-size: 14px; }
.small-btn { height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--green); background: #fff; color: var(--green); font-weight: 600; font-size: 13px; flex: 0 0 auto; }

/* route */
.from { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: 14px 0 10px; }
.dot-you { width: 14px; height: 14px; border-radius: 7px; background: var(--you); border: 3px solid #fff; box-shadow: 0 0 0 4px rgba(31,111,209,.2); }
.dest-list { list-style: none; margin: 6px 0 0; padding: 0; }
.dest-list button { width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 12px 4px; display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.dest-list small { color: var(--muted); font-size: 12px; }

/* map pins */
.pin { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.pin i { width: 20px; height: 20px; border-radius: 10px; border: 3px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); background: var(--green); flex: 0 0 auto; }
.pin.road i { background: var(--orange); }
.pin.sel i { width: 26px; height: 26px; border-radius: 13px; background: var(--ink); }
.pin span { font-size: 11px; font-weight: 700; background: rgba(255,255,255,.88); padding: 1px 4px; border-radius: 4px; color: var(--ink); }
.far .pin span { display: none; }
.you-dot { width: 20px; height: 20px; border-radius: 10px; background: var(--you); border: 4px solid #fff; box-shadow: 0 0 0 8px rgba(31,111,209,.2); }

.toast { z-index: 1300 !important; position: absolute; left: 16px; right: 16px; top: max(70px, calc(env(safe-area-inset-top) + 64px)); background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 14px; font-size: 14px; z-index: 900; text-align: center; }
.demo-flag { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabs) + 6px); z-index: 455; font-size: 10px; background: #FFF4D6; color: var(--sand-ink); padding: 2px 8px; border-radius: 6px; font-weight: 700; pointer-events: none; }

.leaflet-top.leaflet-right { top: 112px; }
.leaflet-control-attribution { font-size: 10px; background: rgba(255,255,255,.7) !important; }
