/* Where's Zack? - public page. Light and dark themes via custom properties. */
:root {
  --bg: #f6f5f1;
  --card: #ffffff;
  --text: #1f2328;
  --muted: #5f6670;
  --line: #e3e1da;
  --accent: #2f7d4a;
  --trail: #2f7d4a;
  --star: #c98a00;
  --no: #b23a3a;
  --notice-bg: #fff6dc;
  --notice-text: #6b4e00;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  --replay: #7828a0;
  --alert-bg: #fdecea;
  --alert-text: #8a1c14;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --card: #1f2226;
    --text: #e8e6e1;
    --muted: #a3a8ae;
    --line: #2e3237;
    --accent: #5cbf7d;
    --trail: #6fd08e;
    --star: #f0b72f;
    --no: #e07070;
    --notice-bg: #3a3018;
    --notice-text: #f3dc9a;
    --shadow: none;
    --replay: #c38ae0;
    --alert-bg: #3d1f1d;
    --alert-text: #f5b4ad;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-wrap: anywhere;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

h1, h2, h3 {
  line-height: 1.2;
}

.site-header {
  padding: 20px 0 12px;
}

.site-header h1 {
  margin: 0;
  font-size: 1.6rem;
}

.site-header .tagline {
  color: var(--accent);
}

.site-header .dash {
  color: var(--muted);
}

.where {
  margin: 4px 0 0;
  font-size: 1.05rem;
}

.where #currentLabel {
  font-weight: 600;
  margin-right: 8px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.88rem;
}

.notice {
  background: var(--notice-bg);
  color: var(--notice-text);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 4px 0 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.card h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 6px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.map-card {
  padding: 0;
  overflow: hidden;
}

#map {
  height: 520px;
  width: 100%;
}

.side,
.map-card,
.stay {
  min-width: 0;
}

.side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.weather .temp {
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1.1;
}

.weather .conditions {
  margin: 2px 0;
}

.next {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 600;
  line-height: 1.1;
}

.stat-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.states {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  font-size: 0.85rem;
}

.reviews {
  margin-top: 28px;
}

.reviews h2 {
  margin: 0;
  font-size: 1.3rem;
}

.reviews > p {
  margin: 2px 0 12px;
}

.stays {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.stay h3 {
  margin: 0;
  font-size: 1.1rem;
}

.stay .meta {
  margin: 2px 0 8px;
}

.verdict {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.stars {
  color: var(--star);
  font-size: 1.15rem;
  letter-spacing: 1px;
}

.pill {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 99px;
  border: 1px solid var(--line);
  font-size: 0.8rem;
}

.pill.yes {
  color: var(--accent);
  border-color: var(--accent);
}

.pill.no {
  color: var(--no);
  border-color: var(--no);
}

.ratings {
  margin-bottom: 6px;
}

.notes {
  white-space: pre-wrap;
  margin: 8px 0;
}

.links {
  margin-top: 8px;
}

a {
  color: var(--accent);
}

.footer {
  padding: 28px 16px 36px;
}

/* Map markers */
.here-icon,
.stay-icon {
  background: transparent;
  border: 0;
}

.here-dot {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 2px var(--accent), 0 1px 4px rgba(0, 0, 0, 0.35);
}

.stay-dot {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--star);
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.stay-dot.yes {
  background: var(--accent);
}

.stay-dot.no {
  background: var(--no);
}

.leaflet-popup-content {
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  .leaflet-popup-content-wrapper,
  .leaflet-popup-tip {
    background: var(--card);
    color: var(--text);
  }
}

@media (max-width: 800px) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #map {
    height: 360px;
  }

  .site-header h1 {
    font-size: 1.3rem;
  }

  .stays {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Header: owner links to the private planner */
.header-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px 24px;
}

.header-main {
  min-width: 0;
}

.status-line {
  margin: 2px 0 0;
  color: var(--muted);
}

.status-line .moving {
  color: var(--accent);
  font-weight: 600;
}

.owner-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.nav-button {
  display: inline-block;
  background: var(--accent);
  color: var(--card);
  border-radius: 8px;
  padding: 6px 14px;
  font-weight: 600;
  text-decoration: none;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 12px;
}

/* Trip replay */
.map-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.replay {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 14px;
}

.play-button {
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--replay);
  background: var(--replay);
  color: #ffffff;
  border-radius: 8px;
  padding: 4px 12px;
  cursor: pointer;
}

.play-button:disabled {
  opacity: 0.45;
  cursor: default;
}

#replaySlider {
  flex: 1 1 180px;
  min-width: 120px;
  accent-color: var(--replay);
}

.replay-label {
  min-width: 140px;
}

.range-pick select {
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 4px;
}

.replay-icon {
  background: transparent;
  border: 0;
}

.replay-dot {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--replay);
  border: 3px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Weather alerts */
.alerts {
  background: var(--alert-bg);
  border-color: transparent;
}

.alerts h2 {
  color: var(--alert-text);
}

.alerts-list {
  margin: 0;
  padding-left: 18px;
  color: var(--alert-text);
}

.alerts-list li + li {
  margin-top: 4px;
}

/* Drive days */
.drives {
  margin-top: 28px;
}

.drives h2 {
  margin: 0;
  font-size: 1.3rem;
}

.drives > p {
  margin: 2px 0 12px;
}

.drives-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.drive-day .drive-date {
  font-weight: 600;
}

.drive-day .drive-miles {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
}

@media (max-width: 800px) {
  .owner-nav {
    align-items: flex-start;
  }

  .nav-links {
    justify-content: flex-start;
  }
}

/* Review photos */
.photo-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 8px 0;
}

.photo-strip img {
  height: 96px;
  width: auto;
  border-radius: 8px;
  display: block;
}
