/* Theme tokens: tweak these to restyle the whole app. */
:root {
  --bg: #f6f4ee; --surface: #fff; --text: #1d2a22; --muted: #6b7a70;
  --accent: #0a7d4b; --accent-ink: #fff; --accent-soft: #dff1e7;
  --warn: #c0392b; --border: #e2ded2; --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121a15; --surface: #1b261f; --text: #e8efe9; --muted: #92a398;
          --accent: #3ecf8e; --accent-ink: #06130c; --accent-soft: #1f3a2c; --border: #2a3a30; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); }
main { max-width: 760px; margin: 0 auto; padding: 1rem; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 1rem 0 .25rem; } h2 { font-size: 1.1rem; margin: 0; }
.muted { color: var(--muted); font-size: .9rem; margin: .25rem 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1rem;
          background: var(--accent); }
.topbar .brand { color: var(--accent-ink); font-weight: 700; text-decoration: none; }
.topbar .muted, .topbar .link { color: var(--accent-ink); }
.topbar-left { display: flex; align-items: center; gap: 1rem; }
.topbar-nav { text-decoration: none; font-size: .9rem; font-weight: 600; }
.card { display: block; background: var(--surface); border: 1px solid var(--border);
        border-radius: var(--radius); padding: 1rem; margin: .75rem 0; color: inherit; text-decoration: none; }
.narrow { max-width: 380px; margin: 2rem auto; }
label { display: block; font-size: .85rem; color: var(--muted); margin: .5rem 0; flex: 1; }
input, select, textarea { width: 100%; padding: .5rem .6rem; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; }
button { padding: .5rem .9rem; border: 0; border-radius: 8px; background: var(--accent);
  color: var(--accent-ink); font: inherit; font-weight: 600; cursor: pointer; }
button.link { background: none; color: var(--accent); padding: 0 .25rem; font-weight: 400; }
.row { display: flex; gap: .75rem; } .inline { display: inline; }
.flash { padding: .6rem .9rem; border-radius: 8px; margin: .5rem 0; background: var(--accent-soft); }
.flash.error { background: #fbe3e0; color: var(--warn); }
summary { cursor: pointer; font-weight: 600; }
.tabs, .filters { display: flex; gap: .5rem; flex-wrap: wrap; margin: .75rem 0; }
.tabs a, .filters a { padding: .3rem .8rem; border-radius: 999px; text-decoration: none;
  border: 1px solid var(--border); color: var(--text); text-transform: capitalize; }
.tabs a.active, .filters a.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.proposal header { display: flex; gap: .6rem; align-items: center; }
.proposal header h2 { flex: 1; } .proposal header select { width: auto; }
.tag { background: var(--accent-soft); border-radius: 999px; padding: .1rem .6rem; font-size: .75rem; }
.status-decided { border-left: 4px solid var(--accent); } .status-rejected { opacity: .55; }
.stances { display: flex; gap: .5rem; margin: .5rem 0; }
.stance { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.stance.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.opinions { list-style: none; padding: 0; margin: .5rem 0 0; font-size: .9rem; }
.entries { list-style: none; padding: 0; margin: .5rem 0 0; }
.entries li { display: flex; gap: .75rem; padding: .35rem 0; border-top: 1px solid var(--border); }
.entries .time { width: 3.5rem; color: var(--muted); } .entries li div { flex: 1; }
.hero { margin: 1.25rem 0 .5rem; }
.hero h1 { font-size: 2.2rem; margin: 0; }
.hero .dates { font-size: 1.15rem; margin: .25rem 0 0; }
h3.section { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 1.75rem 0 .25rem; }
.flights .leg { display: flex; gap: 1rem; align-items: center; padding: .6rem 0; border-top: 1px solid var(--border); }
.flights .leg-flight { width: 4.5rem; font-weight: 600; color: var(--muted); }
.flights .leg-route { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.flights .arrow { color: var(--muted); }
.flights .layover { margin: 0; padding: .35rem 0 .35rem 5.5rem; font-size: .85rem; color: var(--muted); border-top: 1px dashed var(--border); }
.stops { list-style: none; padding: 0; margin: .5rem 0 0 .6rem; border-left: 3px solid var(--accent); }
.stop { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
        padding: .8rem 1rem; margin: 0 0 .75rem 1rem; }
.stop::before { content: ""; position: absolute; left: -1.65rem; top: 1.1rem; width: .8rem; height: .8rem;
                border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.stop.optional { border-style: dashed; background: transparent; }
.stop.optional::before { background: var(--bg); border-color: var(--accent); }
.stop-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.todo { margin: .5rem 0 2rem; padding-left: 1.2rem; }
/* Board: composer, filters, post cards */
.board { margin-bottom: 3rem; }
.composer { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
            padding: .75rem; margin: .75rem 0; }
.composer:focus-within { border-color: var(--accent); }
.composer textarea { border: 0; background: transparent; padding: .25rem; resize: vertical; min-height: 4.5rem; outline: none; }
.composer-foot { display: flex; justify-content: space-between; align-items: center; gap: .75rem;
                 padding-top: .5rem; border-top: 1px solid var(--border); }
.hint { font-size: .8rem; color: var(--muted); }
.hint code, .hint kbd { font: .75rem ui-monospace, monospace; background: var(--bg); border: 1px solid var(--border);
                        border-radius: 4px; padding: 0 .3rem; }
.replying-to { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .85rem;
               background: var(--accent-soft); border-radius: 8px; padding: .35rem .6rem; margin-bottom: .4rem; }
.board-filters { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; margin: 1rem 0 .5rem; }
.board-filters label { margin: 0; font-size: .75rem; flex: 1 1 8rem; display: flex; flex-direction: column; gap: .2rem; }
.board-filters select, .board-filters input { height: 2.2rem; padding: 0 .5rem; font-size: .9rem; background: var(--surface); }
.board-filters .link { padding-bottom: .45rem; font-size: .9rem; }
.feed { display: flex; flex-direction: column; gap: .6rem; }
.feed .empty { color: var(--muted); text-align: center; padding: 1.5rem; border: 1px dashed var(--border);
               border-radius: var(--radius); margin: 0; }
.post { position: relative; background: var(--surface); border: 1px solid var(--border);
        border-radius: var(--radius); padding: .75rem 1rem; transition: border-color .15s; }
.post:has(> .post-open:hover) { border-color: var(--accent); }
.post.fresh { animation: fresh 2s ease-out; }
@keyframes fresh { from { background: var(--accent-soft); } }
.post-open { position: absolute; inset: 0; border-radius: inherit; }
.post a:not(.post-open), .post button, .post form { position: relative; z-index: 1; }
.post-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.post-meta { font-size: .8rem; color: var(--muted); }
.pid { font: .8em ui-monospace, monospace; color: var(--muted); }
.avatar { width: 1.75rem; height: 1.75rem; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
          font-size: .8rem; font-weight: 700; color: #fff; background: hsl(var(--hue) 45% 42%); }
.post-parent { display: block; font-size: .8rem; color: var(--muted); text-decoration: none; margin: .4rem 0 0 2.25rem;
               padding-left: .5rem; border-left: 2px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-parent:hover { color: var(--text); border-left-color: var(--accent); }
.post-body { margin: .35rem 0 0 2.25rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-foot { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin: .4rem 0 0 2.25rem; font-size: .8rem; }
.post-foot a, .post-foot .link { color: var(--muted); font-size: .8rem; padding: 0; text-decoration: none; }
.post-foot a:hover, .post-foot .link:hover { color: var(--accent); }
.post-foot .cited { color: var(--muted); }
a.ref { font: .9em ui-monospace, monospace; background: var(--accent-soft); color: var(--accent);
        border-radius: 4px; padding: 0 .25rem; text-decoration: none; }
.post-foot a.ref { color: var(--accent); font-size: .75rem; }
a.ref:hover { background: var(--accent); color: var(--accent-ink) !important; }
.back { margin: .5rem 0 0; font-size: .9rem; }
.back a { text-decoration: none; }
.post-detail { margin: .75rem 0; padding: 1rem 1.25rem; border-color: var(--accent); }
.post-detail .post-body { font-size: 1.1rem; }
.post-delete { position: absolute; top: .75rem; right: 1rem; }
.link.danger { color: var(--warn); font-size: .8rem; }
.thread-parent .post { opacity: .85; }
.thread-replies { border-left: 2px solid var(--border); padding-left: .75rem; margin-left: .85rem; }
.thread-replies:empty { display: none; }
.thread-replies .post-parent { display: none; }  /* redundant inside the parent's own thread */
.composer-foot button { margin-left: auto; }
@media (max-width: 480px) {
  .hint { display: none; } .post-body, .post-foot, .post-parent { margin-left: 0; }
  .board-filters label:first-child { flex-basis: 100%; } .board-filters label { flex-basis: 35%; }
}
@media (max-width: 480px) { .flights .leg { flex-direction: column; align-items: stretch; gap: .25rem; } .flights .layover { padding-left: 0; } }
/* Phone UI (≤640px): sticky bar, bottom tab bar, thumb-sized targets. Desktop is unchanged. */
.tabbar { display: none; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
/* Recon page */
.recon-jump { margin: .75rem 0 1.25rem; }
.recon-city { padding: 1.25rem; margin-bottom: 1.5rem; }
.recon-city h2 { font-size: 1.5rem; margin-bottom: .5rem; }
.recon-neighborhoods { padding-left: 1.1rem; margin: .5rem 0 0; }
.recon-neighborhoods li { margin-bottom: .4rem; }
.recon-legend { display: flex; flex-wrap: wrap; gap: .5rem .9rem; margin: .5rem 0 .6rem; }
.legend-chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; color: var(--text);
               margin: 0; cursor: pointer; }
.legend-chip input { width: auto; min-height: 0; }
.legend-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; flex: none; }
.recon-map { height: 320px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
             margin-bottom: 1rem; }
.recon-pin span { display: block; width: 14px; height: 14px; border-radius: 50%;
                   border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.recon-toolbar { display: flex; gap: .75rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
.recon-control { display: flex; flex-direction: column; gap: .2rem; font-size: .75rem; flex: 1 1 8rem; margin: 0; }
.recon-control select { height: 2.2rem; padding: 0 .5rem; font-size: .9rem; background: var(--surface); }
.recon-spots { display: flex; flex-direction: column; gap: .6rem; }
.recon-spot { padding: .6rem 0; border-top: 1px solid var(--border); }
.recon-spot:first-of-type { border-top: 0; }
.recon-spot p { margin: .15rem 0 0; }
.recon-spot-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.recon-cat-tag { font-weight: 600; }
.gmaps-link { text-decoration: none; font-size: .9rem; line-height: 1; }
.gmaps-link:hover { opacity: .7; }
.rating-form { margin: .5rem 0 0; }
.rating-scale { display: flex; gap: .4rem; }
.rating-btn { background: var(--bg); color: var(--text); border: 1px solid var(--border);
              padding: .25rem .5rem; font-size: 1rem; line-height: 1; }
.rating-btn.on { background: var(--accent); border-color: var(--accent); }
.recon-comment { margin: .4rem 0 0; font-size: .85rem; }
.recon-comment summary { font-weight: 400; color: var(--accent); cursor: pointer; }
.recon-comment form { display: flex; gap: .5rem; margin-top: .4rem; }
.recon-comment textarea { flex: 1; }
.recon-comment-hint { font-size: .8rem; margin: .4rem 0 0; }
.recon-dayplan { padding-left: 1.2rem; margin: .5rem 0; }
.recon-dayplan li { margin-bottom: .4rem; }
.recon-rec { background: var(--accent-soft); border-radius: var(--radius); padding: .8rem 1rem; margin: 1rem 0; }
.recon-sources { font-size: .8rem; margin-top: 1rem; }
@media (max-width: 640px) {
  .recon-map { height: 260px; }
}
@media (max-width: 640px) {
  html { scroll-padding-top: 4rem; }
  body { padding-bottom: calc(4.25rem + env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; }
  main { padding: .75rem max(1rem, env(safe-area-inset-left)) 1rem max(1rem, env(safe-area-inset-right)); }
  .topbar { position: sticky; top: 0; z-index: 20; padding: .6rem 1rem; padding-top: calc(.6rem + env(safe-area-inset-top)); }
  .topbar button.link { min-height: 2.25rem; padding: 0 .5rem; }
  /* 16px inputs stop iOS Safari zooming the page on focus; 44px-ish targets. */
  input, select, textarea { font-size: 16px; min-height: 2.75rem; }
  button { min-height: 2.75rem; padding: .5rem 1.1rem; }
  .hero h1 { font-size: 1.9rem; }
  .card { padding: .9rem; }
  h3.section { margin-top: 1.5rem; }
  .stop { margin-left: .9rem; }
  .composer { padding: .6rem; }
  .composer textarea { min-height: 5.5rem; resize: none; }
  .board-filters select, .board-filters input { height: 2.75rem; font-size: 16px; }
  .board-filters label:first-child { flex-basis: 100%; }
  .board-filters label { flex: 1 1 40%; }
  .recon-control select { height: 2.75rem; font-size: 16px; }
  .recon-control { flex: 1 1 40%; }
  .recon-comment form { flex-direction: column; }
  .board-filters .link { min-height: 2rem; padding: 0 .25rem; margin: -.25rem 0 0 auto; }
  .post { padding: .75rem .85rem; }
  .post-foot { gap: .25rem 1.25rem; }
  .post-foot a, .post-foot .link { min-height: 2rem; display: inline-flex; align-items: center; font-size: .85rem; }
  .post-foot a.ref { min-height: 0; }
  .post-delete { top: .5rem; right: .75rem; }
  .thread-replies { padding-left: .5rem; margin-left: .5rem; }
  .tabs a, .filters a { padding: .5rem .9rem; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
            background: var(--surface); border-top: 1px solid var(--border);
            padding: .25rem .5rem calc(.25rem + env(safe-area-inset-bottom)); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .35rem 0;
              border-radius: 10px; color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600; }
  .tabbar a span { font-size: 1.25rem; line-height: 1.2; filter: grayscale(1); opacity: .75; }
  .tabbar a[aria-current] { color: var(--accent); background: var(--accent-soft); }
  .tabbar a[aria-current] span { filter: none; opacity: 1; }
  .tabbar .tab-post { color: var(--accent-ink); background: var(--accent); margin: 0 .25rem; }
  .tabbar .tab-post span { filter: none; opacity: 1; }
}
