/* Swingabout — warm, friendly, big touch targets. */
:root {
  --green: #2f9e5b;
  --green-d: #23784a;
  --sun: #ffb703;
  --coral: #ef6f6c;
  --sky: #1c7ed6;
  --ink: #1f2a37;
  --muted: #6b7280;
  --bg: #fffaf0;
  --card: #ffffff;
  --line: #efe6d6;
  --r: 16px;
  --shadow: 0 2px 10px rgba(31, 42, 55, .08);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tab-h: 62px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); overscroll-behavior: none; }
body.playing { overflow: hidden; }
body.playing .toast { bottom: auto; top: calc(70px + var(--safe-t)); }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; color: inherit; }
h2 { margin: 0 0 .4em; font-size: 1.3rem; }
p { margin: .4em 0; line-height: 1.45; }
.muted { color: var(--muted); }
.tiny { font-size: .8rem; }
.center { text-align: center; }
[hidden] { display: none !important; }

#app {
  height: 100dvh; height: 100vh;
  display: flex;
  flex-direction: column;
}
#app > header, #app > .mode-banner, #app > nav { flex: none; }
@supports (height: 100dvh) { #app { height: 100dvh; } }

/* ── Top bar ── */
.topbar {
  display: flex; align-items: center; gap: 8px;
  padding: calc(8px + var(--safe-t)) 10px 8px;
  background: var(--green); color: #fff;
}
.brand { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 1.1rem; }
.brand img { border-radius: 8px; background: #fff; }
.brand span { display: none; }
@media (min-width: 520px) { .brand span { display: inline; } }
.search { flex: 1; display: flex; background: #fff; border-radius: 999px; overflow: hidden; min-width: 0; }
.search input { flex: 1; min-width: 0; border: 0; padding: 10px 14px; outline: none; background: transparent; font-size: 16px; }
.search input::-webkit-search-cancel-button { display: none; }
.search button { padding: 0 14px; font-size: 1.1rem; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.18); font-size: 1.15rem; flex: none; }
.icon-btn:active { background: rgba(255,255,255,.35); }
.mode-banner { background: #2b2d42; color: #fff; padding: 7px 12px; font-size: .85rem; text-align: center; }

main { position: relative; overflow: hidden; min-height: 0; flex: 1; }
.view { position: absolute; inset: 0; display: none; overflow: hidden; }
.view.active { display: flex; flex-direction: column; }
.page { padding: 16px; overflow-y: auto; height: 100%; max-width: 760px; margin: 0 auto; width: 100%; }

/* ── Filters ── */
.filters {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 10px 8px; flex: none;
  scrollbar-width: none; background: var(--bg); border-bottom: 1px solid var(--line);
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 13px; border-radius: 999px; background: #fff; border: 1.5px solid var(--line);
  font-size: .9rem; font-weight: 600; white-space: nowrap; box-shadow: var(--shadow);
}
.chip small { color: var(--muted); font-weight: 700; margin-left: 2px; }
.chip.on { background: var(--green); border-color: var(--green); color: #fff; }
.chip.on small { color: #d3f9d8; }

/* ── Explore layout ── */
.explore-body { flex: 1; display: grid; grid-template-rows: 44% 1fr; grid-template-columns: minmax(0, 1fr); min-height: 0; }
.map-wrap { position: relative; min-height: 0; min-width: 0; }
#map { position: absolute; inset: 0; background: #e9f1e4; }
.list-wrap { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); border-top: 1px solid var(--line); }
@media (min-width: 900px) {
  .explore-body { grid-template-rows: 1fr; grid-template-columns: minmax(0, 1fr) 400px; }
  .list-wrap { border-top: 0; border-left: 1px solid var(--line); }
}
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px 6px; }
.loc-label { font-weight: 800; }
.results { list-style: none; margin: 0; padding: 4px 10px calc(16px); overflow-y: auto; flex: 1; }

.floating {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 500;
}
.pill-btn {
  background: #fff; color: var(--ink); font-weight: 700; padding: 10px 16px; border-radius: 999px;
  box-shadow: 0 3px 14px rgba(0,0,0,.2);
}
.map-status {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 500;
  background: rgba(31,42,55,.88); color: #fff; padding: 9px 16px; border-radius: 999px; font-size: .9rem;
  white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis;
}

/* map pins */
.pin { background: none; border: 0; }
.pin-b {
  width: 36px; height: 36px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg);
  background: var(--c); border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35);
  display: grid; place-items: center;
}
.pin-b span { transform: rotate(45deg); font-size: 17px; line-height: 1; }
.pin-b.sm { width: 26px; height: 26px; }
.pin-lock.ok { color: #2f9e44; font-weight: 900; font-size: 12px; }
.pin-lock { position: absolute; top: -8px; right: -10px; font-style: normal; font-size: 13px; background: #fff; border-radius: 50%; width: 20px; height: 20px; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.pin-b.sm span { font-size: 12px; }

/* ── Cards ── */
.card {
  display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: var(--r);
  padding: 11px 12px; margin: 8px 0; box-shadow: var(--shadow); cursor: pointer; border: 1.5px solid transparent;
}
.card:active, .card:focus-visible { border-color: var(--green); outline: none; }
.card-icon {
  width: 44px; height: 44px; border-radius: 14px; flex: none; display: grid; place-items: center; font-size: 22px;
  background: color-mix(in srgb, var(--c) 18%, white);
}
.card-icon.thumb { width: 56px; height: 56px; position: relative; overflow: hidden; background: #c9d8c5; border: 3px solid var(--c); }
.card-icon.thumb img { position: absolute; width: 128px; height: 128px; max-width: none; pointer-events: none; }
.thumb-emoji { position: absolute; right: 1px; bottom: 1px; font-size: 14px; background: #fff; border-radius: 8px; padding: 1px 2px; line-height: 1; }
.card.access-restricted { background: #f1f3f5; }
.card.access-restricted .card-icon.thumb img { filter: grayscale(.7); }
.access-tag { display: inline-block; margin-top: 4px; font-size: .72rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.access-tag.restricted { background: #dee2e6; color: #343a40; }
.access-tag.maybe { background: #ece9fb; color: #4c3f99; }
.access-note { border-radius: 12px; padding: 10px 12px; margin: 8px 0; font-size: .9rem; line-height: 1.4; }
.access-note.restricted { background: #f1f3f5; border-left: 4px solid #6c757d; }
.access-note.maybe { background: #f3f0ff; border-left: 4px solid #9a92c4; }
.access-tag.public { background: #d3f9d8; color: #1b5e34; }
.access-tag.unknown { background: #f1f3f5; color: #495057; }
.access-tag.business { background: #dee2e6; color: #343a40; }
.access-note.public { background: #ebfbee; border-left: 4px solid #2f9e44; }
.access-note.unknown { background: #f8f9fa; border-left: 4px solid #adb5bd; }
.access-note.business { background: #f1f3f5; border-left: 4px solid #6c757d; }
.card.access-business { background: #f1f3f5; }
.card.access-business .card-icon.thumb img { filter: grayscale(.7); }
.chip.pub.on { background: #2f9e44; border-color: #2f9e44; }
.access-tag.school, .access-tag.sometimes { background: #e5ebff; color: #2b44b8; }
.access-note.school, .access-note.sometimes { background: #edf2ff; border-left: 4px solid #4263eb; }
.access-note .times { margin-top: 6px; }
.access-note .tiny { margin-top: 6px; color: var(--muted); }
.card.access-school, .card.access-sometimes { background: #f8f9ff; }
.open-q { background: #f8f9fa; border-radius: 14px; padding: 10px 12px; margin: 10px 0; }
.open-q > span { font-weight: 800; font-size: .9rem; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0 4px; }
.seg button { background: #fff; border: 1.5px solid #dee2e6; border-radius: 10px; padding: 8px 4px; font-weight: 700; font-size: .85rem; }
.seg button.on { background: var(--green); border-color: var(--green); color: #fff; }
.mini-wrap { position: relative; margin: 0 -6px 12px; }
.mini-map { height: 170px; border-radius: 16px; overflow: hidden; background: #c9d8c5; }
.mini-toggle { position: absolute; top: 8px; left: 8px; z-index: 500; background: #fff; border-radius: 999px; padding: 6px 10px; font-weight: 700; font-size: .8rem; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.card-icon.big { width: 56px; height: 56px; font-size: 28px; border-radius: 18px; }
.card-main { flex: 1; min-width: 0; }
.card-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { color: var(--muted); font-size: .85rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.heart { font-size: 1.2rem; padding: 2px 4px; }
.badge { font-size: .72rem; font-weight: 800; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.badge.free, .badge.likely { background: #d3f9d8; color: #1b5e34; }
.badge.donation { background: #e7f5ff; color: #1864ab; }
.badge.check { background: #fff3bf; color: #8a5a00; }
.badge.fee { background: #ffe3e3; color: #a51111; }
.made-by { list-style: none; text-align: center; font-size: .88rem; color: var(--muted); margin: 6px 0 14px; font-weight: 600; }
.made-by a { color: #c2410c; font-weight: 800; text-decoration: none; }
.missing { list-style: none; margin: 14px 4px 6px; padding: 12px; border: 1.5px dashed #ced4da; border-radius: 14px; font-size: .88rem; color: var(--muted); line-height: 1.45; }
.missing a { color: var(--sky); font-weight: 700; text-decoration: none; }
.empty { text-align: center; padding: 28px 16px; }
.empty-emoji { font-size: 44px; }

/* toggle switch */
.switch { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; cursor: pointer; }
.switch input { display: none; }
.slider { width: 42px; height: 24px; background: #ced4da; border-radius: 999px; position: relative; transition: .2s; }
.slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::after { left: 21px; }

/* ── Tab bar ── */
.tabbar {
  display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b); z-index: 600;
}
.tabbar button { height: var(--tab-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .75rem; font-weight: 700; color: var(--muted); position: relative; }
.tabbar button span { font-size: 1.35rem; filter: grayscale(.6); }
.tabbar button.active { color: var(--green-d); }
.tabbar button.active span { filter: none; transform: scale(1.1); }
.plus-tag { position: absolute; top: 6px; right: calc(50% - 32px); font-size: .55rem; background: var(--sun); color: #5c3c00; padding: 1px 4px; border-radius: 6px; font-weight: 900; }
body.is-plus .plus-tag { display: none; }

/* ── Bottom sheet ── */
.sheet { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0); transition: background .2s; display: flex; align-items: flex-end; justify-content: center; }
.sheet.open { background: rgba(0,0,0,.3); }
.sheet-card {
  background: #fff; width: 100%; max-width: 560px; max-height: 82vh; overflow-y: auto;
  border-radius: 22px 22px 0 0; padding: 10px 18px calc(18px + var(--safe-b)); position: relative;
  transform: translateY(100%); transition: transform .22s ease-out;
}
.sheet.open .sheet-card { transform: none; }
.sheet-grip { width: 40px; height: 5px; background: #dee2e6; border-radius: 9px; margin: 0 auto 12px; }
.sheet-close { position: absolute; top: 10px; right: 12px; z-index: 600; width: 34px; height: 34px; border-radius: 50%; background: #f1f3f5; font-size: 1rem; }
.sheet-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; padding-right: 36px; }
.sheet-head h2 { margin: 0; font-size: 1.2rem; }
.sheet-badges { display: flex; gap: 8px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.feats { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.feats li { background: #f8f9fa; border-radius: 10px; padding: 6px 10px; font-size: .88rem; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 10px; }
.sheet-links { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; font-size: .9rem; }
.sheet-links a { color: var(--sky); text-decoration: none; font-weight: 600; }

.btn {
  background: var(--green); color: #fff; font-weight: 800; padding: 12px 16px; border-radius: 14px;
  box-shadow: 0 2px 0 var(--green-d); min-height: 46px;
}
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn.ghost { background: #f1f3f5; color: var(--ink); box-shadow: none; }
.btn.big { width: 100%; padding: 15px; font-size: 1.05rem; }
.link { color: var(--sky); font-weight: 700; padding: 6px 0; }
.link.danger { color: #c92a2a; }

/* ── Modal ── */
.modal { position: fixed; inset: 0; z-index: 1100; background: rgba(0,0,0,0); display: grid; place-items: center; padding: 16px; transition: background .2s; }
.modal.open { background: rgba(0,0,0,.4); }
.modal-card {
  background: #fff; border-radius: 22px; width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto;
  padding: 20px; transform: scale(.94); opacity: 0; transition: .2s;
}
.modal.open .modal-card { transform: none; opacity: 1; }
.modal-card fieldset { border: 0; padding: 0; margin: 0 0 12px; }
.modal-card legend { font-weight: 800; margin-bottom: 6px; }
.opt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; border-radius: 12px; background: #f8f9fa; margin: 6px 0; font-weight: 600; }
.opt small { flex-basis: 100%; font-weight: 400; padding-left: 26px; }
.opt input[type=radio] { width: 18px; height: 18px; accent-color: var(--green); }
.zip-in { width: 90px; padding: 6px 8px; border: 1.5px solid #dee2e6; border-radius: 8px; }
.row-label { display: flex; justify-content: space-between; align-items: center; padding: 10px 2px; font-weight: 600; border-bottom: 1px solid #f1f3f5; }
.row-label select { padding: 6px; border-radius: 8px; border: 1.5px solid #dee2e6; }
.row-label input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--green); }
.plus-row { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin: 12px 0; font-weight: 600; }
details { margin: 10px 0; } summary { font-weight: 700; cursor: pointer; padding: 6px 0; }
.row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.row .btn { flex: 1; }
.gate { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.gate input { font-size: 1.4rem; padding: 10px; border-radius: 12px; border: 2px solid #dee2e6; text-align: center; }
.gate-err { color: #c92a2a; margin: 0; }

.onboard { text-align: center; display: flex; flex-direction: column; gap: 10px; }
.onboard-emoji { font-size: 40px; letter-spacing: 4px; }
.zip-form { display: flex; gap: 8px; }
.zip-form input { flex: 1; min-width: 0; padding: 12px; border-radius: 14px; border: 2px solid #dee2e6; font-size: 16px; text-align: center; }

/* ── Paywall ── */
.paywall { text-align: center; max-width: 420px; margin: 10px auto; background: #fff; border-radius: 24px; padding: 24px 20px; box-shadow: var(--shadow); }
.paywall-emoji { font-size: 52px; }
.perks { text-align: left; list-style: none; padding: 0; margin: 16px 0; display: flex; flex-direction: column; gap: 10px; }
.perks li { background: #fff9db; padding: 10px 12px; border-radius: 12px; font-size: .93rem; }

/* ── Games hub ── */
.games-intro { margin-bottom: 12px; }
.game-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.game-card {
  border-radius: 22px; padding: 18px 12px; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-height: 150px; justify-content: center; box-shadow: 0 4px 0 rgba(0,0,0,.15); text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.game-card:active { transform: scale(.97); }
.game-emoji { font-size: 48px; }
.game-name { font-weight: 900; font-size: 1.1rem; }
.game-desc { font-size: .8rem; opacity: .95; text-align: center; }

/* ── Game stage ── */
.game-stage { position: fixed; inset: 0; z-index: 2000; background: #fff; touch-action: none; user-select: none; -webkit-user-select: none; }
.game-inner { position: absolute; inset: 0; padding-top: var(--safe-t); padding-bottom: var(--safe-b); }
.hold-exit {
  position: absolute; top: calc(10px + var(--safe-t)); right: 10px; z-index: 5; width: 52px; height: 52px; border-radius: 50%;
  background: rgba(0,0,0,.45); color: #fff; display: grid; place-items: center;
}
.hold-exit .x { font-size: 20px; font-weight: 900; grid-area: 1/1; }
.hold-exit .hold-label { position: absolute; bottom: -16px; font-size: 10px; font-weight: 800; color: #999; letter-spacing: .5px; }
.hold-exit .ring {
  --p: 0; grid-area: 1/1; width: 52px; height: 52px; border-radius: 50%;
  background: conic-gradient(var(--sun) calc(var(--p) * 360deg), transparent 0);
  -webkit-mask: radial-gradient(circle, transparent 20px, #000 21px); mask: radial-gradient(circle, transparent 20px, #000 21px);
}

/* Draw */
.draw-game { position: absolute; inset: 0; display: flex; flex-direction: column; background: #f1f3f5; }
.draw-canvas { flex: 1; width: 100%; min-height: 0; background: #fff; touch-action: none; display: block; }
.draw-tools { background: #fff; border-top: 2px solid #e9ecef; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.swatches, .tool-row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.sw { width: 38px; height: 38px; border-radius: 50%; border: 3px solid #e9ecef; }
.sw.rainbow { background: conic-gradient(red, orange, yellow, lime, cyan, blue, magenta, red) !important; font-size: 0; }
.sw.on { border-color: #212529; transform: scale(1.15); }
.size, .tool { width: 46px; height: 46px; border-radius: 12px; background: #f1f3f5; display: grid; place-items: center; font-size: 1.3rem; }
.size i { background: #212529; border-radius: 50%; display: block; }
.size.on, .tool.on { background: #ffe066; }

/* Tic-tac-toe */
.ttt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 70px 16px 20px; background: linear-gradient(#fff9db, #ffe8cc); }
.ttt-top { display: flex; gap: 8px; }
.pill { background: #fff; padding: 10px 14px; border-radius: 999px; font-weight: 800; box-shadow: var(--shadow); font-size: 1rem; }
.ttt-score { display: flex; gap: 18px; font-weight: 900; font-size: 1.2rem; }
.ttt-msg { font-size: 1.35rem; font-weight: 900; min-height: 1.6em; text-align: center; }
.ttt-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(88vw, 52vh, 420px); aspect-ratio: 1; }
.cell { background: #fff; border-radius: 20px; font-size: clamp(36px, 12vw, 74px); box-shadow: 0 4px 0 #f0c68c; line-height: 1; }
.cell.pop { animation: pop .25s ease-out; }
.cell.win { background: #b2f2bb; box-shadow: 0 4px 0 #69db7c; }
.ttt-again { max-width: 300px; }
@keyframes pop { from { transform: scale(.6); } to { transform: scale(1); } }

/* Snake */
.snake { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 70px 12px 16px; background: #2b8a3e; color: #fff; }
.snake-bar { display: flex; gap: 24px; font-size: 1.3rem; font-weight: 900; }
.snake-box { position: relative; width: min(92vw, 56vh, 520px); aspect-ratio: 1; border-radius: 16px; overflow: hidden; box-shadow: 0 6px 0 #1e6b2e; touch-action: none; }
.snake-box canvas { width: 100%; height: 100%; display: block; }
.snake-over { position: absolute; inset: 0; background: rgba(0,0,0,.45); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 20px; font-size: 1.2rem; font-weight: 700; }
.snake-over .btn { max-width: 240px; }
.big-emoji { font-size: 60px; }
.dpad { display: grid; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(2, 56px); gap: 6px; }
.dpad button { background: rgba(255,255,255,.2); border-radius: 14px; font-size: 1.6rem; }
.dpad button:active { background: rgba(255,255,255,.4); }
.dpad [data-d=up] { grid-column: 2; grid-row: 1; }
.dpad [data-d=left] { grid-column: 1; grid-row: 2; }
.dpad [data-d=down] { grid-column: 2; grid-row: 2; }
.dpad [data-d=right] { grid-column: 3; grid-row: 2; }

/* Trails */
.trails { position: absolute; inset: 0; background: rgb(12,10,34); }
.trails canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
.trails-hint { position: absolute; top: 45%; left: 0; right: 0; text-align: center; color: #fff; font-size: 1.6rem; font-weight: 900; opacity: 0; transition: opacity .6s; pointer-events: none; }
.trails-hint.show { opacity: .85; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-10px); } }
.trails-modes { position: absolute; left: 0; right: 0; bottom: calc(10px + var(--safe-b)); display: flex; gap: 5px; justify-content: center; padding: 0 6px; }
.trails-modes button { flex: 1; max-width: 72px; min-width: 0; background: rgba(255,255,255,.12); color: #fff; border-radius: 14px; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; font-size: .66rem; font-weight: 800; }
.trails-modes button span { font-size: 1.5rem; }
.trails-modes button.on { background: rgba(255,255,255,.32); outline: 2px solid #fff; }

/* ── Chat ── */
.ask-page { display: flex; flex-direction: column; }
.ask-head { display: flex; justify-content: space-between; align-items: center; }
.ask-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; gap: 8px; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 0; min-height: 200px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 18px; line-height: 1.45; }
.msg p { margin: .25em 0; } .msg ul { margin: .3em 0; padding-left: 1.2em; }
.msg.bot { background: #fff; box-shadow: var(--shadow); border-bottom-left-radius: 6px; align-self: flex-start; }
.msg.me { background: var(--green); color: #fff; border-bottom-right-radius: 6px; align-self: flex-end; }
.msg.typing { display: flex; gap: 5px; padding: 14px 16px; }
.msg.typing span { width: 8px; height: 8px; border-radius: 50%; background: #adb5bd; animation: blink 1s infinite; }
.msg.typing span:nth-child(2) { animation-delay: .15s; } .msg.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .25; } }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; }
.suggest .chip { white-space: normal; text-align: left; }
.chat-input { display: flex; gap: 8px; align-items: flex-end; }
.chat-input textarea { flex: 1; resize: none; border: 2px solid #dee2e6; border-radius: 16px; padding: 11px 14px; font-size: 16px; background: #fff; max-height: 120px; }
.chat-input .btn { width: 50px; padding: 0; height: 46px; }

/* ── Toast ── */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 16px + var(--safe-b)); transform: translate(-50%, 20px); opacity: 0;
  background: #212529; color: #fff; padding: 11px 18px; border-radius: 14px; z-index: 3000; transition: .25s; max-width: 90vw; text-align: center; font-weight: 600;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.leaflet-control-attribution { font-size: 10px; }
