@import url('https://fonts.googleapis.com/css2?family=Young+Serif&family=Newsreader:ital,opsz,wght@0,6..72,300..800;1,6..72,300..800&family=IBM+Plex+Mono:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');

/* ═════════════════════════════════════════════════════════════════════
   FIELD STATION · EVENTS BOARD
   Creek stewardship aesthetic — paper, ink, creek-teal, moss, rust.
═════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --paper:       #efe7cf;
  --paper-deep:  #e5dcbf;
  --paper-edge:  #d6cca5;

  --ink:         #1a1f14;
  --ink-soft:    #52573e;
  --ink-faint:   #878265;

  --creek:       #295a57;
  --creek-deep:  #163634;
  --moss:        #6c7a37;
  --rust:        #9e431b;
  --stone:       #867c5a;

  --rule:        #b6a984;
  --rule-soft:   #d3c8a4;

  --serif:       'Newsreader', 'Iowan Old Style', 'Hoefler Text', Georgia, serif;
  --display:     'Young Serif', 'Iowan Old Style', Georgia, serif;
  --mono:        'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --max:         920px;
  --max-stack:   1320px;
  --chrome-h:    38px;
}

body.dark {
  --paper:       #13171c;
  --paper-deep:  #0b0e12;
  --paper-edge:  #1d222a;

  --ink:         #e2d9bd;
  --ink-soft:    #8f8a75;
  --ink-faint:   #5e5a48;

  --creek:       #72b4ab;
  --creek-deep:  #0e2423;
  --moss:        #adbb68;
  --rust:        #e08856;
  --stone:       #7b7258;

  --rule:        #2a2e36;
  --rule-soft:   #1d2129;
}

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.003em;
}

body {
  min-height: 100vh;
  padding-bottom: 140px;
  position: relative;
  -webkit-font-smoothing: antialiased;
  counter-reset: section;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(26,31,20,.045) 0.7px, transparent 0.8px);
  background-size: 5px 5px;
}
body.dark {
  background-image:
    radial-gradient(circle at 1px 1px, rgba(226,217,189,.03) 0.7px, transparent 0.8px);
}

a { color: var(--creek); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--creek) 40%, transparent); transition: color .15s, border-color .15s; }
a:hover { color: var(--rust); border-bottom-color: var(--rust); }

::selection { background: var(--creek); color: var(--paper); }

/* ─── CHROME BAR (top of every page) ────────────────────────────────── */

.chrome {
  background: var(--creek-deep);
  color: #d9e6e4;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding: 10px 24px;
  min-height: var(--chrome-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
body.dark .chrome { background: #091513; color: #7fa39e; }

.chrome-left, .chrome-mid, .chrome-right {
  display: flex; align-items: center; gap: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chrome-mid { opacity: .55; flex: 1; justify-content: center; min-width: 0; }
.chrome-right { justify-content: flex-end; }

.chrome-btn {
  background: none;
  color: inherit;
  border: 1px solid rgba(255,255,255,.14);
  padding: 5px 11px;
  font: inherit;
  font-size: 10px;
  letter-spacing: .18em;
  cursor: pointer;
  border-radius: 0;
  transition: background .15s, color .15s, border-color .15s;
  text-decoration: none;
  text-transform: uppercase;
}
.chrome-btn:hover { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.3); }
.chrome-btn.dark-toggle::before { content: '◐ '; opacity: .6; }

/* Legacy compatibility (still used by some contexts) */
.board-header { display: none; }
.back-btn { color: inherit; }

/* ─── MASTHEAD (event board page) ───────────────────────────────────── */

.masthead {
  max-width: var(--max);
  margin: 0 auto;
  padding: 64px 28px 44px;
  position: relative;
}

.masthead-meta-top {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 28px;
}
.masthead-meta-top .cycle { color: var(--rust); }
.masthead-meta-top .cycle::before { content: '★ '; }

.masthead-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(42px, 8.4vw, 96px);
  line-height: 0.94;
  letter-spacing: -0.022em;
  color: var(--ink);
  margin-bottom: 20px;
  text-wrap: balance;
}

.masthead-coords {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0;
}
.masthead-coords .sep {
  color: var(--rule);
  margin: 0 12px;
}

.masthead-rule {
  border: none;
  height: 0;
  border-top: 1px solid var(--rule);
  margin: 0 0 24px;
  position: relative;
}
.masthead-rule::before {
  content: '';
  position: absolute;
  left: 0; top: -4px;
  width: 7px; height: 7px;
  background: var(--creek);
  border-radius: 50%;
}
.masthead-rule::after {
  content: '';
  position: absolute;
  right: 0; top: -4px;
  width: 7px; height: 7px;
  background: var(--rust);
  border-radius: 50%;
}

.masthead-description {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(17px, 2.1vw, 20px);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 62ch;
  margin-bottom: 36px;
  font-variation-settings: "opsz" 14;
  padding-left: 18px;
  border-left: 2px solid var(--moss);
}

.masthead-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--rule-soft);
}

.countdown {
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.countdown-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.countdown-value {
  font-family: var(--display);
  font-size: 52px;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.025em;
}
.countdown-value.past { color: var(--rust); }
.countdown-unit {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .24em;
  margin-left: 10px;
  color: var(--ink-faint);
  text-transform: uppercase;
  vertical-align: 14px;
}

.datestamp {
  text-align: right;
  font-family: var(--mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  font-size: 10.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.datestamp-big {
  display: inline-block;
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-transform: none;
  margin: 0 2px;
  line-height: 1;
}
.datestamp-mo {
  color: var(--rust);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  margin-right: 6px;
  letter-spacing: .2em;
}

/* ─── BOARD STACK (sections wrapper) ───────────────────────────────── */

.board-stack {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
}

/* ─── SECTIONS ──────────────────────────────────────────────────────── */

.board-section {
  counter-increment: section;
  position: relative;
}

.section-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 16px;
  cursor: pointer;
  user-select: none;
  padding: 28px 0 12px;
  border-top: 1px solid var(--rule);
  transition: color .15s;
}
.section-header:hover { color: var(--creek); }

.section-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.012em;
  color: inherit;
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.section-title::before {
  content: "§ " counter(section, upper-roman);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--creek);
  font-weight: 500;
  flex-shrink: 0;
}

.section-marker,
.chevron {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 18px;
  color: var(--ink-faint);
  width: 20px;
  text-align: center;
  transition: color .2s, transform .2s;
}
.section-header:hover .section-marker,
.section-header:hover .chevron { color: var(--creek); }

.section-body {
  padding: 10px 0 36px 28px;
  border-left: 1px solid var(--rule-soft);
  margin-left: 2px;
  font-size: 15.5px;
}

.board-section.collapsed .section-body { display: none; }
.board-section.collapsed .section-header { padding-bottom: 28px; }
.board-section:last-of-type .section-body { border-bottom: 1px solid var(--rule); }

/* ─── DETAILS ───────────────────────────────────────────────────────── */

.details-list {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 14px 24px;
  align-items: baseline;
}
.details-list dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
}
.details-list dt::after {
  content: " ·";
  color: var(--rule);
  margin-left: 4px;
}
.details-list dd {
  color: var(--ink);
  font-size: 16px;
  font-family: var(--serif);
}

/* ─── SUPPLY MANIFEST (Checklist) ───────────────────────────────────── */

.checklist-group {
  margin-bottom: 28px;
}
.checklist-cat {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--rust);
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px dashed var(--rule);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.checklist-cat::before { content: '▸ '; color: var(--creek); margin-right: 4px; }
.checklist-cat::after {
  content: attr(data-count);
  color: var(--ink-faint);
  font-weight: 400;
  letter-spacing: .12em;
}

.checklist-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 8px 0;
  cursor: pointer;
  font-size: 15.5px;
  font-family: var(--serif);
  transition: padding .15s;
}
.checklist-item:hover { padding-left: 4px; }

.checklist-item input[type=checkbox] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border: 1.5px solid var(--ink-soft);
  background: var(--paper);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  margin: 0;
  transition: background .15s, border-color .15s;
}
.checklist-item input[type=checkbox]:checked {
  background: var(--creek);
  border-color: var(--creek);
}
.checklist-item input[type=checkbox]:checked::before {
  content: '';
  position: absolute;
  top: 1px; left: 5px;
  width: 4px; height: 9px;
  border-right: 2px solid var(--paper);
  border-bottom: 2px solid var(--paper);
  transform: rotate(45deg);
}
.checklist-item.checked span:nth-of-type(1) {
  text-decoration: line-through;
  text-decoration-color: var(--ink-faint);
  text-decoration-thickness: 1px;
  color: var(--ink-faint);
}
.qty {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--ink-faint);
  background: none;
  padding: 0;
  border-radius: 0;
}
.qty::before { content: '× '; color: var(--rule); }

/* ─── SCHEDULE ──────────────────────────────────────────────────────── */

.schedule-list {
  position: relative;
  margin-top: 4px;
  padding-left: 8px;
}
.schedule-list::before {
  content: '';
  position: absolute;
  left: 78px; top: 14px; bottom: 14px;
  width: 1px;
  background: var(--creek);
}
.schedule-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 28px;
  padding: 10px 0;
  position: relative;
  align-items: baseline;
}
.schedule-row::before {
  content: '';
  position: absolute;
  left: 73px; top: 20px;
  width: 11px; height: 11px;
  background: var(--paper);
  border: 1.5px solid var(--creek);
  border-radius: 50%;
  z-index: 1;
}
.schedule-row:first-child::before { background: var(--creek); }
.schedule-row:last-child::before { background: var(--rust); border-color: var(--rust); }

.sched-time {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--creek);
  font-weight: 500;
}
.sched-item {
  font-size: 15.5px;
  color: var(--ink);
  padding-left: 24px;
  font-family: var(--serif);
}

/* ─── WEATHER ───────────────────────────────────────────────────────── */

.weather-card {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 14px 24px;
  align-items: center;
}
.weather-icon {
  font-size: 52px;
  filter: grayscale(.25);
  opacity: .95;
  line-height: 1;
}
.weather-temps {
  display: flex;
  align-items: baseline;
  gap: 24px;
}
.weather-temps .hi {
  font-family: var(--display);
  font-size: 30px;
  color: var(--rust);
  letter-spacing: -0.012em;
  line-height: 1;
}
.weather-temps .lo {
  font-family: var(--display);
  font-size: 24px;
  color: var(--creek);
  letter-spacing: -0.012em;
  line-height: 1;
}
.weather-precip {
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-top: 12px;
  border-top: 1px dashed var(--rule);
}
.weather-note {
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .16em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

/* ─── ZONE MAP ──────────────────────────────────────────────────────── */

#map-container {
  height: 360px;
  border: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
  background: var(--paper-deep);
}
.leaflet-tile-pane { filter: saturate(.7) sepia(.14) contrast(1.03); }
body.dark .leaflet-tile-pane { filter: invert(.88) saturate(.65) hue-rotate(170deg) brightness(.9); }

.leaflet-container {
  font-family: var(--serif) !important;
  background: var(--paper-deep) !important;
}
.leaflet-popup-content-wrapper {
  border-radius: 0 !important;
  background: var(--paper) !important;
  color: var(--ink) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,.2) !important;
  border: 1px solid var(--rule);
}
.leaflet-popup-tip { background: var(--paper) !important; }
.leaflet-popup-content {
  font-family: var(--serif) !important;
  font-size: 14px !important;
}
.leaflet-control-attribution {
  font-family: var(--mono) !important;
  font-size: 9px !important;
  background: rgba(239,231,207,.8) !important;
}

/* ─── INPUTS ───────────────────────────────────────────────────────── */

.notes-textarea, .journal-textarea, .cw-textarea, .ny-input, .cw-input {
  width: 100%;
  background: var(--paper-deep);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 14px 16px;
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.55;
  resize: vertical;
  transition: border-color .15s, background .15s;
}
.notes-textarea:focus, .journal-textarea:focus, .cw-textarea:focus, .ny-input:focus, .cw-input:focus {
  outline: none;
  border-color: var(--creek);
  background: var(--paper);
}
.notes-textarea::placeholder, .journal-textarea::placeholder, .ny-input::placeholder, .cw-textarea::placeholder, .cw-input::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}

/* ─── NOTES (timestamped entries, mirrors journal but moss-accent) ─── */

.notes-add {
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px dashed var(--rule);
}
.notes-add-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 10px;
}
.notes-entries {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.notes-entry {
  background: var(--paper-deep);
  border-left: 3px solid var(--moss);
  padding: 14px 18px 16px;
  position: relative;
}
.notes-meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.notes-meta::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--moss);
  border-radius: 50%;
}
.notes-text {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  font-family: var(--serif);
}

/* ─── ENTRY EDIT / DELETE — shared across journal, notes, ny-item ──── */

.journal-entry,
.notes-entry,
.ny-item {
  position: relative;
}

/* View vs edit mode — toggled by `.entry-editing` on the entry root */
.journal-entry > .entry-edit,
.notes-entry   > .entry-edit,
.ny-item       > .entry-edit { display: none; }

.journal-entry.entry-editing > .entry-view,
.notes-entry.entry-editing   > .entry-view,
.ny-item.entry-editing       > .entry-view { display: none; }

.journal-entry.entry-editing > .entry-edit,
.notes-entry.entry-editing   > .entry-edit,
.ny-item.entry-editing       > .entry-edit { display: block; }

/* Hover-revealed action row (top-right of the entry) */
.entry-actions {
  position: absolute;
  top: 10px;
  right: 14px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;
}
.journal-entry:hover .entry-actions,
.notes-entry:hover   .entry-actions,
.ny-item:hover       .entry-actions,
.journal-entry:focus-within .entry-actions,
.notes-entry:focus-within   .entry-actions,
.ny-item:focus-within       .entry-actions {
  opacity: 1;
  pointer-events: auto;
}
.journal-entry.entry-editing .entry-actions,
.notes-entry.entry-editing   .entry-actions,
.ny-item.entry-editing       .entry-actions { display: none; }

.entry-btn {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: none;
  border: none;
  padding: 3px 6px;
  cursor: pointer;
  transition: color .15s;
}
.entry-btn:hover        { color: var(--creek); }
.entry-btn.delete:hover { color: var(--rust); }

/* Inline edit form */
.entry-edit .entry-edit-input {
  width: 100%;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--creek);
  border-radius: 0;
  padding: 10px 12px;
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.5;
  resize: vertical;
}
.entry-edit .entry-edit-input:focus {
  outline: none;
  border-color: var(--rust);
}
.entry-edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  justify-content: flex-end;
}
.entry-edit-actions .btn-primary,
.entry-edit-actions .btn-secondary {
  padding: 7px 12px;
  font-size: 10px;
  letter-spacing: .2em;
}

/* ny-item used to be a grid at the <li> level; move the grid to
   the inner .entry-view so the edit form lives as a block sibling. */
.ny-item {
  display: block;
  padding: 14px 0;
}
.ny-item .entry-view {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: baseline;
}
.ny-item .entry-view::before {
  content: '→';
  font-family: var(--mono);
  color: var(--rust);
  font-size: 12px;
}
.ny-item .ny-text {
  font-family: var(--serif);
  color: var(--ink);
}
.ny-item .entry-edit {
  padding: 4px 0 0 26px;
}

/* ─── PLATE BOOK (Photos) ──────────────────────────────────────────── */

.photo-upload-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px dashed var(--rule);
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 18px;
}
.photo-thumb {
  position: relative;
  aspect-ratio: 4/5;
  background: var(--paper-edge);
  padding: 8px 8px 28px;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 10px 24px -18px rgba(0,0,0,.4);
  transition: transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s;
}
.photo-thumb:nth-child(odd)  { transform: rotate(-0.4deg); }
.photo-thumb:nth-child(even) { transform: rotate(0.4deg); }
.photo-thumb:hover {
  transform: translateY(-4px) rotate(0);
  box-shadow: 0 2px 0 rgba(0,0,0,.06), 0 20px 36px -16px rgba(0,0,0,.5);
}
.photo-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(.88) contrast(1.02);
}
.gps-badge {
  position: absolute;
  bottom: 7px; left: 8px; right: 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: none;
  padding: 0;
  border-radius: 0;
}
.gps-badge::before { content: '◉ GPS '; color: var(--creek); }
#photo-upload-status {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ─── FIELD JOURNAL ─────────────────────────────────────────────────── */

.journal-add {
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px dashed var(--rule);
}
.journal-add-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  justify-content: space-between;
}
.journal-gps-status {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.journal-entries {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.journal-entry {
  background: var(--paper-deep);
  border: none;
  border-left: 3px solid var(--creek);
  padding: 14px 18px 16px;
  position: relative;
}
.journal-meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.journal-meta::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--creek);
  border-radius: 50%;
}
.journal-text {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  font-family: var(--serif);
}
.gps-tag { cursor: pointer; color: var(--creek); }
.gps-tag::before { content: '◉ '; }

/* ─── FOR NEXT CYCLE (Next-Year Notes) ─────────────────────────────── */

.ny-add {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}
.ny-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}
/* .ny-item base — grid + ::before arrow moved to `.entry-view` above so the
   edit form can live as a sibling block. This rule only handles the row's
   top/bottom rules, padding, and base font size. */
.ny-item {
  border: none;
  border-top: 1px dotted var(--rule);
  border-radius: 0;
  font-size: 15.5px;
}
.ny-item:last-child { border-bottom: 1px dotted var(--rule); }
.ny-date {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ─── BUTTONS ───────────────────────────────────────────────────────── */

.btn-primary, .btn-secondary {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .24em;
  text-transform: uppercase;
  padding: 10px 16px;
  border-radius: 0;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
}
.btn-primary:hover {
  background: var(--creek);
  border-color: var(--creek);
}
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink-soft);
}
.btn-secondary:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* ─── LIGHTBOX ──────────────────────────────────────────────────────── */

.lightbox {
  display: none;
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(11,14,18,.94);
  align-items: center; justify-content: center;
  padding: 40px;
}
.lightbox.open { display: flex; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.lightbox-inner {
  position: relative;
  max-width: 92vw; max-height: 90vh;
  background: var(--paper);
  padding: 20px 20px 44px;
  box-shadow: 0 40px 100px rgba(0,0,0,.6);
}
.lightbox-inner img {
  max-width: 100%; max-height: 72vh;
  display: block;
  filter: saturate(.92);
}
.lightbox-caption {
  color: var(--ink);
  font-family: var(--serif);
  font-style: italic;
  margin-top: 14px;
  font-size: 15px;
}
.lightbox-gps {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 6px;
  cursor: pointer;
  transition: color .15s;
}
.lightbox-gps:hover { color: var(--creek); text-decoration: none; }
.lightbox-close {
  position: absolute; top: -36px; right: 0;
  background: none; border: none;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .24em;
  cursor: pointer;
  text-transform: uppercase;
  padding: 4px 0;
}
.lightbox-close:hover { color: var(--creek); }

/* ─── PTR ──────────────────────────────────────────────────────────── */

.ptr-indicator {
  position: fixed; top: 0; left: 0; right: 0; z-index: 999;
  text-align: center; padding: 10px;
  background: var(--creek);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .28em;
  text-transform: uppercase;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity .2s;
  pointer-events: none;
}

/* ─── CHAT WIDGET ──────────────────────────────────────────────────── */

.chat-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 1000;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--creek);
  color: var(--paper);
  border: 2px solid var(--paper);
  font-family: var(--display);
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--creek-deep), 0 18px 30px -12px rgba(0,0,0,.5);
  transition: transform .2s, box-shadow .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-fab:hover {
  transform: scale(1.06);
  box-shadow: 0 0 0 1px var(--creek-deep), 0 22px 38px -14px rgba(0,0,0,.6);
}

.chat-widget {
  position: fixed; bottom: 92px; right: 16px; z-index: 1000;
  width: min(400px, calc(100vw - 32px));
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 0;
  box-shadow: 0 24px 56px -16px rgba(0,0,0,.4);
  display: flex; flex-direction: column;
  transform: translateY(10px) scale(.98);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.chat-widget.open { opacity: 1; transform: none; pointer-events: auto; }

.chat-header {
  background: var(--creek-deep);
  color: var(--paper);
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 16px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  cursor: pointer;
}
.chat-title { font-weight: 500; }
.chat-title::before { content: '◉ '; color: var(--moss); margin-right: 2px; }
.chat-close-btn { color: rgba(255,255,255,.75); font-size: 10px; letter-spacing: .22em; }
.chat-close-btn:hover { color: #fff; }

.chat-tabs {
  display: flex;
  gap: 0;
  padding: 0 14px;
  border-bottom: 1px solid var(--rule-soft);
  background: var(--paper-deep);
}
.chat-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 10px 4px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.chat-tab:hover { color: var(--ink); }
.chat-tab.active { color: var(--creek); border-bottom-color: var(--creek); font-weight: 500; }

.chat-body { padding: 0; }
.chat-panel { display: none; padding: 16px; }
.chat-panel.active { display: block; }

.cw-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
  gap: 10px;
}
.cw-gps-status {
  font-family: var(--mono); font-size: 9.5px;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-faint);
}

.cw-feedback {
  height: 16px;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: .16em; text-transform: uppercase;
  margin-top: 8px;
}
.cw-feedback.ok { color: var(--moss); }
.cw-feedback.ok::before { content: '✓ '; }
.cw-feedback.err { color: var(--rust); }
.cw-feedback.err::before { content: '✕ '; }

/* ─── UTILITY ──────────────────────────────────────────────────────── */

.empty {
  color: var(--ink-faint);
  font-size: 14.5px;
  font-style: italic;
  padding: 12px 0;
  font-family: var(--serif);
}
.loading, .error {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 6px 0;
}
.loading::before { content: '↻ '; }
.error { color: var(--rust); }
.error::before { content: '✕ '; }

/* ─── EVENT INDEX (/) ──────────────────────────────────────────────── */

.index-page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 64px 28px 40px;
}
.index-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
}
.index-meta .station {
  color: var(--ink-soft);
}

.index-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(56px, 12vw, 128px);
  line-height: 0.88;
  letter-spacing: -0.028em;
  color: var(--ink);
  margin-bottom: 22px;
  text-wrap: balance;
}
.index-subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(16px, 2vw, 19px);
  color: var(--ink-soft);
  max-width: 58ch;
  margin-bottom: 44px;
  line-height: 1.5;
  padding-left: 18px;
  border-left: 2px solid var(--moss);
}
.index-rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 0 0 28px;
  position: relative;
}
.index-rule::after {
  content: '';
  position: absolute;
  left: 0; top: -3px;
  width: 5px; height: 5px;
  background: var(--creek);
  border-radius: 50%;
}

.index-head {
  display: grid;
  grid-template-columns: 80px 1fr 140px 60px;
  gap: 28px;
  padding: 10px 0;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--rule);
}

.event-row {
  display: grid;
  grid-template-columns: 80px 1fr 140px 60px;
  gap: 28px;
  padding: 26px 0;
  border-bottom: 1px solid var(--rule-soft);
  align-items: baseline;
  color: var(--ink);
  border-radius: 0;
  box-shadow: none;
  text-decoration: none;
  transition: background .2s, padding .2s;
  background: none;
}
.event-row:hover {
  background: var(--paper-deep);
  padding-left: 16px;
  padding-right: 16px;
  text-decoration: none;
  border-bottom-color: var(--creek);
}
.row-idx {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--rust);
}
.row-name {
  font-family: var(--display);
  font-size: clamp(20px, 2.6vw, 26px);
  letter-spacing: -0.012em;
  line-height: 1.15;
  color: var(--ink);
  text-wrap: balance;
}
.row-date {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.row-cycle {
  font-family: var(--display);
  font-size: 20px;
  color: var(--creek);
  text-align: right;
  letter-spacing: -0.01em;
}
.row-cycle.none {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: .2em;
}

.index-footer {
  margin-top: 48px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

/* ─── ANIMATIONS ───────────────────────────────────────────────────── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.masthead > *,
.board-section,
.event-row,
.index-meta,
.index-title,
.index-subtitle,
.index-rule,
.index-head,
.index-footer {
  opacity: 0;
  animation: fadeUp .7s cubic-bezier(.2,.7,.2,1) forwards;
}
.masthead > *:nth-child(1) { animation-delay: .05s; }
.masthead > *:nth-child(2) { animation-delay: .10s; }
.masthead > *:nth-child(3) { animation-delay: .15s; }
.masthead > *:nth-child(4) { animation-delay: .20s; }
.masthead > *:nth-child(5) { animation-delay: .25s; }
.masthead > *:nth-child(6) { animation-delay: .30s; }
.masthead > *:nth-child(7) { animation-delay: .35s; }

.board-section:nth-of-type(1) { animation-delay: .40s; }
.board-section:nth-of-type(2) { animation-delay: .43s; }
.board-section:nth-of-type(3) { animation-delay: .46s; }
.board-section:nth-of-type(4) { animation-delay: .49s; }
.board-section:nth-of-type(5) { animation-delay: .52s; }
.board-section:nth-of-type(6) { animation-delay: .55s; }
.board-section:nth-of-type(7) { animation-delay: .58s; }
.board-section:nth-of-type(8) { animation-delay: .61s; }
.board-section:nth-of-type(9) { animation-delay: .64s; }

.index-meta     { animation-delay: .05s; }
.index-title    { animation-delay: .12s; }
.index-subtitle { animation-delay: .22s; }
.index-rule     { animation-delay: .30s; }
.index-head     { animation-delay: .36s; }
.event-row:nth-of-type(1) { animation-delay: .42s; }
.event-row:nth-of-type(2) { animation-delay: .48s; }
.event-row:nth-of-type(3) { animation-delay: .54s; }
.event-row:nth-of-type(4) { animation-delay: .60s; }
.event-row:nth-of-type(5) { animation-delay: .66s; }
.event-row:nth-of-type(6) { animation-delay: .72s; }
.index-footer { animation-delay: .80s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .masthead > *, .board-section, .event-row, .index-meta, .index-title,
  .index-subtitle, .index-rule, .index-head, .index-footer { opacity: 1; }
}

/* ─── RESPONSIVE ──────────────────────────────────────────────────── */

/* ═══════════════════════════════════════════════════════════════════════
   WIDE-SCREEN LAYOUT · two-column grid kicks in on any non-phone browser
═══════════════════════════════════════════════════════════════════════ */

@media (min-width: 760px) {
  .board-stack {
    max-width: var(--max-stack);
    padding: 0 36px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 44px;
    row-gap: 0;
    align-items: start;
  }
  .board-section--wide { grid-column: 1 / -1; }
  .board-section--col  { grid-column: auto; }

  /* Collapsed sections shouldn't inherit a border-bottom from
     :last-of-type since order shifts across columns in grid. */
  .board-section:last-of-type .section-body { border-bottom: none; }

  /* Section bodies lose the left rail in multi-col layout — reads cleaner */
  .section-body {
    padding: 10px 0 32px;
    border-left: none;
    margin-left: 0;
  }
  .section-header {
    padding: 22px 0 10px;
  }
  .board-section.collapsed .section-header { padding-bottom: 22px; }

  /* Masthead & index take more room */
  .masthead    { max-width: 1120px; padding: 72px 40px 48px; }
  .index-page  { max-width: 1160px; padding: 72px 40px 48px; }

  /* Details list keeps narrow labels in col mode */
  .board-section[data-section="details"] .details-list {
    grid-template-columns: 130px 1fr;
    gap: 12px 20px;
  }

  /* Supply Manifest — two columns inside its wide container */
  .board-section[data-section="supplyChecklist"] .section-body {
    column-count: 2;
    column-gap: 48px;
  }
  .checklist-group {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Map uses its extra width */
  #map-container { height: 400px; }

  /* Photo grid denser when wide */
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

  /* Masthead footer — spread countdown & datestamp */
  .masthead-footer { grid-template-columns: auto 1fr auto; gap: 40px; }
}

@media (min-width: 1100px) {
  .board-stack { column-gap: 60px; padding: 0 48px; }

  .masthead    { padding: 80px 48px 56px; }
  .index-page  { padding: 80px 48px 56px; }

  /* Supply Manifest goes to three columns — 36 items fits cleanly */
  .board-section[data-section="supplyChecklist"] .section-body {
    column-count: 3;
    column-gap: 52px;
  }

  #map-container { height: 460px; }
}

@media (min-width: 1440px) {
  .board-stack { column-gap: 80px; }

  /* Four-column supply manifest on ultrawides */
  .board-section[data-section="supplyChecklist"] .section-body {
    column-count: 4;
    column-gap: 48px;
  }
}

@media (max-width: 720px) {
  .masthead { padding: 44px 22px 32px; }
  .board-stack { padding: 0 22px; }
  .section-body { padding: 8px 0 28px 18px; }
  .index-page { padding: 44px 22px 32px; }
}

@media (max-width: 560px) {
  .chrome { padding: 9px 16px; font-size: 9.5px; letter-spacing: .14em; }
  .chrome-mid { display: none; }

  .masthead { padding: 32px 18px 28px; }
  .masthead-meta-top { font-size: 9.5px; letter-spacing: .2em; margin-bottom: 18px; }
  .masthead-description { padding-left: 14px; font-size: 17px; }
  .masthead-footer { grid-template-columns: 1fr; gap: 18px; }
  .datestamp { text-align: left; }
  .countdown-value { font-size: 44px; }

  .board-section { padding: 0 18px; }
  .section-body { padding-left: 14px; }
  .section-title { gap: 10px; font-size: 22px; }
  .section-title::before { font-size: 10px; }

  .details-list { grid-template-columns: 1fr; gap: 2px 0; }
  .details-list dt { margin-top: 10px; }
  .details-list dt::after { display: none; }

  .schedule-list::before { left: 62px; }
  .schedule-row { grid-template-columns: 64px 1fr; gap: 20px; }
  .schedule-row::before { left: 57px; }
  .sched-item { padding-left: 16px; }

  .index-page { padding: 36px 18px 28px; }
  .index-head { display: none; }
  .event-row { grid-template-columns: 60px 1fr 50px; gap: 14px; padding: 20px 0; }
  .event-row .row-date { grid-column: 2; font-size: 10px; color: var(--ink-faint); margin-top: 4px; }
  .row-name { font-size: 20px; line-height: 1.2; }
  .row-cycle { font-size: 16px; }

  .weather-card { grid-template-columns: 60px 1fr; gap: 10px 16px; }
  .weather-icon { font-size: 40px; }
  .weather-temps .hi { font-size: 26px; }
  .weather-temps .lo { font-size: 20px; }

  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 14px; }

  .journal-entry { padding: 12px 14px 14px; }
}
