/* Dovelog app styles, on top of Pico 2 (vendored). No inline styles anywhere: the CSP is
   default-src 'self', so every style lives in this file. */

:root {
  --dove-red: #c62828;
  --dove-amber: #a35f00;
  --tabs-h: 3.5rem;
}
@media (prefers-color-scheme: dark) {
  :root { --dove-red: #ef6b6b; --dove-amber: #f0a640; }
}

[hidden] { display: none !important; }

body {
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 1rem);
}

/* ------------------------------------------------------------ chrome */
.topbar {
  position: sticky; top: 0; z-index: 1100;
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  padding: calc(env(safe-area-inset-top) + .45rem) 1rem .45rem;
  background: var(--pico-background-color);
  border-bottom: 1px solid var(--pico-muted-border-color);
}
.brand { font-weight: 700; text-decoration: none; }
.topright { display: flex; align-items: center; gap: .6rem; }
.acct { font-size: .85rem; text-decoration: none; }
.acct[aria-current="page"] { font-weight: 700; }
main.container { padding-top: 1rem; }

.pill {
  display: inline-block; font-size: .8rem; line-height: 1.4; padding: .1rem .6rem;
  border-radius: 999px; border: 1px solid var(--pico-muted-border-color);
  color: var(--pico-muted-color); text-decoration: none; white-space: nowrap;
}
.pill.pending { color: var(--dove-amber); border-color: currentColor; }
.pill.problem { color: var(--dove-red); border-color: currentColor; font-weight: 600; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--pico-background-color);
  border-top: 1px solid var(--pico-muted-border-color);
}
.tabs a {
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; font-weight: 600; font-size: .95rem; color: var(--pico-muted-color);
}
.tabs a[aria-current="page"] { color: var(--pico-primary); }

.toast {
  position: fixed; left: 1rem; right: 1rem; z-index: 2000;
  bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + .75rem);
  padding: .75rem 1rem; border-radius: var(--pico-border-radius);
  background: #1f2933; color: #fff; text-align: center;
}
.toast.error { background: var(--dove-red); }

/* ------------------------------------------------------------ general */
.muted { color: var(--pico-muted-color); font-size: .875rem; }
.warn { color: var(--dove-amber); }
.error { color: var(--dove-red); }
.notice { padding: .6rem .8rem; border-left: 4px solid var(--dove-amber); }
.legal { margin-top: 1.5rem; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
a.plain { display: block; text-decoration: none; color: inherit; }
.bigbtn { display: block; width: 100%; font-size: 1.2rem; padding: 1rem; margin-bottom: 1rem; text-align: center; }
.badge {
  display: inline-block; font-size: .72rem; line-height: 1.4; padding: 0 .45rem;
  border-radius: .3rem; border: 1px solid var(--pico-muted-border-color);
  color: var(--pico-muted-color); white-space: nowrap;
}
.badge.warn { color: var(--dove-amber); border-color: currentColor; }
.stuck { border-left: 4px solid var(--dove-red); }

.hunt-list, .field-list { padding: 0; margin: 0 0 1rem; }
.hunt-list li, .field-list li { list-style: none; padding: .6rem 0; border-bottom: 1px solid var(--pico-muted-border-color); }

/* ------------------------------------------------------------ daily bag line */
.bagline { margin: .25rem 0 .75rem; }
.bag-count { font-size: 1.6rem; }
.bagline progress { margin: .25rem 0; }
.bagline.at, .bagline.over { --pico-progress-color: var(--dove-red); }
.bagline.at .bag-count, .bagline.over .bag-count, .bag-flag { color: var(--dove-red); }
.bag-wt.at, .bag-wt.over { color: var(--dove-red); font-weight: 600; }

/* ------------------------------------------------------------ tally */
.tally { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: .75rem 0; }
.tally button {
  margin: 0; min-height: 7.5rem; padding: .5rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 1.1rem; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.tally button .n { font-size: 2.4rem; font-weight: 700; line-height: 1.1; }
.tally button .sub { font-size: .75rem; opacity: .85; }
.tally button.minor { min-height: 5.5rem; }
.tally button.flash { filter: brightness(1.35); }
.tally-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.tally-actions button, .tally-actions a { margin: 0; }

/* ------------------------------------------------------------ maps */
.map-full {
  height: calc(100dvh - 9rem - var(--tabs-h) - env(safe-area-inset-bottom) - env(safe-area-inset-top));
  min-height: 18rem; border-radius: var(--pico-border-radius);
}
.map-pick { height: 18rem; border-radius: var(--pico-border-radius); margin-bottom: .75rem; }
.leaflet-container { font: inherit; font-size: .85rem; }
.leaflet-popup-content { margin: .6rem .8rem; }
.leaflet-popup-content p { margin: .15rem 0; }
/* Pico styles [role=button] like a button; give Leaflet's own controls their look back */
.leaflet-bar a[role="button"], .leaflet-control-layers-toggle[role="button"] {
  padding: 0; margin: 0; border-radius: 0; box-shadow: none; font-size: 1.2rem; font-weight: 700;
  background-color: #fff; color: #222; border-color: #ccc; transition: none;
}
.leaflet-control-layers-toggle[role="button"] { border: 0; border-radius: 5px; }
.leaflet-bar a[role="button"]:first-child { border-radius: 4px 4px 0 0; }
.leaflet-bar a[role="button"]:last-child { border-radius: 0 0 4px 4px; }
.leaflet-control-layers label { margin: .2rem 0; font-size: .9rem; }
.leaflet-control-layers input { margin: 0 .35rem 0 0; }
.map-legend { display: flex; flex-wrap: wrap; gap: .25rem .9rem; font-size: .8rem; margin: .4rem 0; }
.dot { display: inline-block; width: .75rem; height: .75rem; border-radius: 50%; margin-right: .3rem; vertical-align: -.05rem; border: 2px solid #fff; }
.dot.me { background: #1e88e5; }
.dot.friend { background: #fb8c00; }
.dot.field { background: #43a047; border-radius: 2px; }
.dot.ffield { background: #8e24aa; border-radius: 2px; }

/* ------------------------------------------------------------ forms */
.loc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .5rem; }
.loc-actions > * { margin: 0; }
.file-btn { position: relative; margin: 0; }
.visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important;
  margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; border: 0 !important;
}
/* map markers (Leaflet divIcons; Leaflet sizes them through the CSSOM, which the CSP allows) */
.mk { border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); }
.mk-me { background: #1e88e5; }
.mk-friend { background: #fb8c00; }
.mk-field { background: #43a047; border-radius: 3px; }
.mk-ffield { background: #8e24aa; border-radius: 3px; }

/* ------------------------------------------------------------ photos */
.photos { margin: .25rem 0 1rem; }
.photos h3 { margin-bottom: .5rem; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: .5rem; }
.photo-grid:empty { display: none; }
.photo-grid figure { margin: 0; display: flex; flex-direction: column; gap: .25rem; }
.photo-grid figcaption { text-align: center; }
.thumb {
  display: block; width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: var(--pico-border-radius); background: var(--pico-muted-border-color);
}
button.thumb-btn {
  display: block; width: 100%; padding: 0; margin: 0; border: 0; background: none; box-shadow: none;
}
button.small { padding: .2rem .4rem; font-size: .8rem; margin: 0; }
.geotag-offer:empty { display: none; }
.geotag-offer { margin: .5rem 0 1rem; }
dialog.lightbox article { width: 100%; max-width: 100%; padding: .5rem; margin: 0; }
dialog.lightbox img.full {
  display: block; max-width: 100%; max-height: 75dvh; margin: 0 auto .5rem; object-fit: contain;
}

/* ------------------------------------------------------------ feed and a hunt's page */
.feed .card { margin: 0 0 1rem; padding: .8rem 1rem; }
.feed .card p { margin: .2rem 0; }
.feed .card .who { text-decoration: none; }
.notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.thumb-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin: .5rem 0; }
.thumb-more {
  display: flex; align-items: center; justify-content: center; aspect-ratio: 1;
  border-radius: var(--pico-border-radius); border: 1px solid var(--pico-muted-border-color);
  text-decoration: none; font-weight: 700;
}
table.counts { width: auto; margin: .25rem 0 .75rem; }
table.counts td { padding: .2rem .8rem .2rem 0; }
td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ------------------------------------------------------------ stats */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem 1rem; margin: .5rem 0 1rem; }
.tiles .tile { margin: 0; }
.tiles dt { font-size: .8rem; color: var(--pico-muted-color); font-weight: 400; margin: 0; }
.tiles dd { margin: 0; font-size: 1.15rem; }
.tiles dd .muted { font-size: .75rem; }
table.counts tr.total td { font-weight: 700; border-top: 1px solid var(--pico-muted-border-color); }
ol.board { padding-left: 0; margin: .5rem 0; }
ol.board li { list-style: none; display: grid; grid-template-columns: 2.2rem 1fr auto; align-items: baseline; gap: .5rem; padding: .35rem 0; border-bottom: 1px solid var(--pico-muted-border-color); }
ol.board li.me { font-weight: 700; }
ol.board .rank { color: var(--pico-muted-color); }
button.linkish {
  padding: 0; margin: 0; border: 0; background: none; box-shadow: none; width: auto;
  color: var(--pico-primary); text-align: left; font: inherit; text-decoration: underline;
}
ul.bars { padding: 0; margin: .25rem 0 .5rem; }
ul.bars li { list-style: none; display: grid; grid-template-columns: 3.4rem 1fr 2rem; align-items: center; gap: .5rem; margin: 0; }
ul.bars progress { margin: 0; }
ul.field-stats { padding: 0; }
ul.field-stats li { list-style: none; padding: .2rem 0; }

/* ------------------------------------------------------------ log a past hunt */
.backfill-link { margin: -.5rem 0 1rem; text-align: center; }
label.check { display: flex; gap: .5rem; align-items: center; margin: .25rem 0 .75rem; }
label.check input { margin: 0; }
.grid.when, .grid.birds { grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: 0 .75rem; }

/* ------------------------------------------------------------ passkeys (A4) */
.pwlink { font-size: .95rem; }
.passkey-list { padding: 0; margin: 0 0 1rem; }
.passkey-list li { list-style: none; padding: .5rem 0; border-bottom: 1px solid var(--pico-muted-border-color); }
.passkey-list li .row button { margin: 0; padding: .3rem .7rem; font-size: .85rem; width: auto; }
