/* Stamp book. A page of real-looking paper: fibre texture, faint ruling, ink that multiplies into
   the paper, each stamp tilted a few degrees (fixed when it was saved, so a page never reshuffles). */
.stamp-overlay {
  position: fixed; inset: 0; z-index: 70; background: var(--bg); overflow-y: auto;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(32px + env(safe-area-inset-bottom, 0px));
}
.stamp-overlay.top { z-index: 75; }
.stamp-overlay.over { z-index: 80; }
.stamp-overlay-inner { max-width: 520px; margin: 0 auto; }
.stamp-back { display: inline-flex; align-items: center; gap: 4px; width: auto; padding: 6px 0; }
.stamp-title { font-size: var(--text-xl, 26px); font-weight: 700; margin: 8px 0 12px; }
.stamp-sub { color: var(--text-dim); font-size: var(--text-sm); margin: 0 0 12px; line-height: 1.5; }

.stamp-paper {
  position: relative; color: var(--gm-stamp-text);
  background-color: var(--gm-stamp-paper);
  background-image:
    repeating-linear-gradient(0deg, transparent 0 31px, var(--gm-stamp-ruling) 31px 32px),
    radial-gradient(circle at 18% 22%, var(--gm-stamp-fibre) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 64%, var(--gm-stamp-fibre) 0 1px, transparent 2px),
    linear-gradient(135deg, var(--gm-stamp-paper), var(--gm-stamp-paper-edge));
  background-size: auto, 23px 29px, 31px 19px, auto;
  border-radius: 4px;
  box-shadow: 0 1px 0 var(--gm-stamp-paper-edge), 0 8px 22px var(--gm-stamp-shadow);
}
.stamp-paper::before {         /* the gutter, where pages are bound */
  content: ""; position: absolute; inset: 0 auto 0 0; width: 14px; border-radius: 4px 0 0 4px;
  background: linear-gradient(90deg, var(--gm-stamp-shadow), transparent);
  opacity: 0.45; pointer-events: none;
}

.stamp-pages {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 2px 14px; -webkit-overflow-scrolling: touch;
}
.stamp-page { flex: 0 0 100%; scroll-snap-align: center; padding: 26px 22px 18px 30px; min-height: 470px; box-sizing: border-box; }
.stamp-page-head {
  display: flex; justify-content: space-between; font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gm-stamp-text-faint); margin-bottom: 14px;
}
.stamp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.stamp-cell {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 4px; min-height: 128px; padding: 6px 4px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer;
}
.stamp-cell.empty { cursor: default; border: 1.5px dashed var(--gm-stamp-ruling); border-radius: 6px; opacity: 0.55; }
.stamp-ink {
  display: block; max-width: 100%; max-height: 96px; object-fit: contain;
  mix-blend-mode: multiply; opacity: 0.93; filter: url(#gm-ink-rough);
}
.stamp-cell .stamp-ink { transform: rotate(var(--rot, 0deg)); }
.stamp-caption { font-family: ui-serif, Georgia, "Times New Roman", serif; font-size: 12px; line-height: 1.25; text-align: center; }
.stamp-date { font-size: 10px; letter-spacing: 0.08em; color: var(--gm-stamp-text-faint); }
.stamp-dots { display: flex; justify-content: center; gap: 6px; margin-top: 2px; }
.stamp-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.stamp-dots i.on { background: var(--accent); }

.stamp-detail-paper { padding: 30px 26px 24px 34px; text-align: center; }
.stamp-detail-paper .stamp-ink { max-height: 260px; margin: 6px auto 14px; --rot: 0deg; }
.stamp-detail-paper .stamp-ink.thump { animation: stamp-thump 0.45s cubic-bezier(.2,.9,.3,1.2); }
.stamp-detail-name { font-family: ui-serif, Georgia, "Times New Roman", serif; font-size: 20px; font-weight: 700; }
.stamp-detail-meta { font-size: 12px; letter-spacing: 0.08em; color: var(--gm-stamp-text-faint); margin-top: 4px; }
.stamp-detail-note { font-family: ui-serif, Georgia, serif; font-style: italic; margin-top: 12px; font-size: 14px; }
@keyframes stamp-thump {
  0% { transform: scale(1.7) rotate(var(--rot, 0deg)); opacity: 0; filter: blur(3px); }
  55% { transform: scale(0.96) rotate(var(--rot, 0deg)); opacity: 1; filter: blur(0); }
  100% { transform: scale(1) rotate(var(--rot, 0deg)); opacity: 0.93; }
}
@media (prefers-reduced-motion: reduce) { .stamp-detail-paper .stamp-ink.thump { animation: none; } }

.stamp-map { height: 340px; border-radius: var(--radius-lg); overflow: hidden; margin-top: 12px; border: 1px solid var(--border); }
.stamp-map.small { height: 200px; }
.stamp-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.stamp-actions .btn { flex: 1 1 140px; }

/* Add flow */
.stamp-preview { padding: 18px; min-height: 190px; display: flex; align-items: center; justify-content: center; margin: 10px 0 14px; }
.stamp-preview .stamp-ink { max-height: 220px; }
.stamp-preview-busy { color: var(--gm-stamp-text-faint); font-size: 13px; }
.stamp-controls { display: grid; gap: 12px; margin-bottom: 14px; }
.stamp-control { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: var(--text-sm); }
.stamp-control input[type=range] { flex: 1; max-width: 55%; }
.stamp-inks { display: flex; gap: 10px; }
.stamp-inks button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; background: var(--ink); cursor: pointer; }
.stamp-inks button[aria-checked="true"] { border-color: var(--text); }
.stamp-field { display: block; margin-bottom: 12px; font-size: var(--text-sm); }
.stamp-field input[type=text], .stamp-field select { width: 100%; box-sizing: border-box; }
.stamp-who { display: grid; gap: 4px; margin-bottom: 14px; }
.stamp-who label { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: var(--text-sm); }
.stamp-loc { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: var(--text-sm); color: var(--text-dim); }

/* The old-style map: the same tiles, aged to sepia under a parchment wash, with a compass rose and
   seal-red pins and trail. Purely a skin: pins, tooltips and taps are the ordinary map's. */
.stamp-map.vintage { position: relative; border: 3px double var(--gm-stamp-text-faint); box-shadow: 0 6px 18px var(--gm-stamp-shadow); background: var(--gm-stamp-paper); }
.stamp-map.vintage .leaflet-tile-pane { filter: sepia(0.9) saturate(0.65) contrast(0.92) brightness(1.06); }
.stamp-map.vintage::after {
  content: ""; position: absolute; inset: 0; z-index: 450; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, var(--gm-stamp-shadow) 140%), var(--gm-stamp-map-tint);
  mix-blend-mode: multiply;
}
.stamp-map.vintage .gm-map-pin.gm-map-pin { --pin: var(--gm-stamp-seal); }
.stamp-map.vintage .leaflet-control-zoom a { background: var(--gm-stamp-paper); color: var(--gm-stamp-text); border-color: var(--gm-stamp-text-faint); }
.stamp-map.vintage .leaflet-control-attribution { background: var(--gm-stamp-paper); color: var(--gm-stamp-text-faint); }
.stamp-map .stamp-trail { stroke: var(--gm-stamp-seal); }
.stamp-compass { position: absolute; right: 10px; bottom: 26px; width: 58px; height: 58px; z-index: 500; color: var(--gm-stamp-text); pointer-events: none; opacity: 0.8; }
.stamp-who-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

/* Owner-only "Family stays" screen (family-stays.js). Reuses the admin overlay's chrome. */
.family-overlay { position: fixed; inset: 0; z-index: 70; background: var(--bg); overflow-y: auto; padding: 16px 20px calc(32px + env(safe-area-inset-bottom, 0px)); padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
.family-title { margin: 8px 0; }
.family-pair { display: grid; gap: 6px; margin: 14px 0; padding: 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface, transparent); }
.family-when { font-weight: 700; }
.family-who { display: inline-block; min-width: 3.2em; font-weight: 700; color: var(--gm-green-deep); }
.family-distance { font-size: 18px; }
.family-route { font-size: 15px; }
.family-rides { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; }
.family-actions { display: grid; gap: 8px; margin-top: 6px; }
.family-actions .btn { text-decoration: none; text-align: center; }

/* "What <person> is doing today" (day-share.js): the Home button and its day list. */
.dad-slot:empty { display: none; }
.dad-slot { margin: 10px 0; display: grid; gap: 8px; }
.dad-btn { width: 100%; justify-content: center; }
.dad-list { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 12px; }
.dad-item { display: grid; grid-template-columns: 74px 1fr; gap: 10px; align-items: start; }
.dad-when { font-weight: 700; color: var(--gm-green-deep); font-size: 14px; padding-top: 2px; }
.dad-maybe { font-size: 11px; }
