/* Printable outdoor trip sheet (/outdoors/print, ADR 0088).
   Light theme on screen, dark overrides in outdoors-print-dark.css,
   and an ink-friendly black-on-white layout under @media print. */

.op-page {
  --op-accent: #1d6f52;
  --op-accent-soft: #e3f4ec;
  --op-accent-line: #8ec9b1;
  --op-np-bg: #e7f3ec;
  --op-np-text: #165941;
  --op-np-line: #87c4a9;
  --op-sheet-bg: var(--surface);
}

/* ---- Hero & Print button ---- */
.op-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 18px;
}
.op-hero-text { flex: 1 1 420px; min-width: 0; }
.op-eyebrow {
  margin: 0 0 4px;
  color: var(--op-accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.op-hero h1 { margin: 0 0 8px; font-size: clamp(1.65rem, 4vw, 2.3rem); line-height: 1.1; }
.op-lead { margin: 0; color: var(--muted); font-size: 0.98rem; max-width: 62ch; line-height: 1.5; }

.op-hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: none;
}
.op-print-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--op-accent);
  border-radius: 12px;
  background: var(--op-accent);
  color: #fff;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 650;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: filter 0.15s, transform 0.1s;
}
.op-print-btn:hover { filter: brightness(1.06); }
.op-print-btn:active { transform: translateY(1px); }
.op-print-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.op-print-hint { color: var(--muted); font-size: 0.8rem; }

/* ---- Trip setup card ---- */
.op-builder {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 22px;
  display: grid;
  gap: 18px;
}

.op-form {
  display: grid;
  grid-template-columns: minmax(175px, 1fr) minmax(175px, 1fr) minmax(240px, 1.4fr) auto;
  gap: 14px 16px;
  align-items: start;
}
.op-field { display: grid; gap: 6px; min-width: 0; }
.op-field label {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.op-field input[type="date"],
.op-field select {
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.94rem;
  width: 100%;
}
.op-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.op-quick a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: none;
  background: var(--bg);
}
.op-quick a:hover { border-color: var(--op-accent); color: var(--text); }
.op-quick a.is-active {
  background: var(--op-accent-soft);
  border-color: var(--op-accent-line);
  color: var(--op-accent);
  font-weight: 650;
}

.op-field-go { align-self: start; padding-top: 23px; }
.op-apply {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--text);
  color: var(--surface);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.op-apply:hover { opacity: 0.9; }

/* ---- Location & Automatic US Parks Picker ---- */
.op-loc {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: grid;
  gap: 14px;
}
.op-loc-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  justify-content: space-between;
}
.op-loc-current { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.op-loc-label {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.op-reset-loc {
  font-size: 0.84rem;
  color: var(--accent-moon);
  text-decoration: none;
}
.op-reset-loc:hover { text-decoration: underline; }

.op-loc-search {
  position: relative;
  display: flex;
  gap: 8px;
  flex: 1 1 320px;
  max-width: 520px;
}
.op-loc-search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
}
.op-loc-search button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.op-loc-search button:hover { border-color: var(--muted); }

.op-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgb(0 0 0 / 0.16);
  max-height: 320px;
  overflow-y: auto;
}
.op-search-results[hidden] { display: none; }
.op-search-results a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
}
.op-search-results a:hover,
.op-search-results a:focus-visible { background: var(--bg); }
.op-sr-name { font-weight: 600; }
.op-sr-tag { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.op-sr-tag.is-np { color: var(--op-np-text); font-weight: 600; }
.op-sr-none { padding: 10px; color: var(--muted); font-size: 0.88rem; }

/* Nearby US Parks (200 mi) */
.op-parks {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  display: grid;
  gap: 12px;
}
.op-parks-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}
.op-parks-head h3 {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--op-accent);
}
.op-parks-count { color: var(--muted); font-size: 0.82rem; font-variant-numeric: tabular-nums; }

.op-np-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.op-park-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 5px 12px;
  border: 1px solid var(--op-np-line);
  border-radius: 10px;
  background: var(--op-np-bg);
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
}
.op-park-chip:hover { border-color: var(--op-accent); }
.op-park-chip.is-selected {
  background: var(--op-accent);
  border-color: var(--op-accent);
  color: #fff;
}
.op-park-chip.is-selected .op-park-badge,
.op-park-chip.is-selected .op-park-meta { color: #fff; border-color: rgb(255 255 255 / 0.4); }
.op-park-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 5px;
  border: 1px solid var(--op-np-line);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  color: var(--op-np-text);
}
.op-park-name { font-weight: 600; }
.op-park-meta { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

.op-sp-box summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  padding: 4px 0;
}
.op-sp-hint { color: var(--muted); font-size: 0.8rem; font-weight: 400; }
.op-sp-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 10px 0 8px;
}
.op-sp-tools input[type="search"] {
  flex: 1 1 240px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
}
.op-sp-shown { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }

.op-sp-grid {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 6px;
  max-height: 270px;
  overflow-y: auto;
  padding-right: 4px;
}
.op-sp-grid li[hidden] { display: none; }
.op-sp-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 0.84rem;
}
.op-sp-link:hover { border-color: var(--op-accent); }
.op-sp-link.is-selected {
  background: var(--op-accent-soft);
  border-color: var(--op-accent);
}
.op-sp-link .op-park-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Section checkboxes ---- */
.op-sections {
  margin: 0;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.op-sections legend {
  float: left;
  margin-right: 6px;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.op-sections label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  cursor: pointer;
  user-select: none;
}
.op-sections input[type="checkbox"] { accent-color: var(--op-accent); width: 16px; height: 16px; }

/* ---- The Printable Field Sheet ---- */
.op-sheet {
  background: var(--op-sheet-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  display: grid;
  gap: 18px;
}
.op-sheet-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--text);
}
.op-sheet-kicker {
  margin: 0 0 2px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--op-accent);
}
.op-sheet-title h2 { margin: 0 0 3px; font-size: 1.5rem; line-height: 1.15; }
.op-sheet-dates { margin: 0; color: var(--muted); font-size: 0.95rem; font-weight: 600; }

.op-sheet-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.op-sheet-meta > div { display: grid; gap: 1px; }
.op-sheet-meta dt {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.op-sheet-meta dd { margin: 0; font-size: 0.88rem; font-weight: 600; }

.op-sec { display: grid; gap: 8px; }
.op-sec[hidden] { display: none; }
.op-sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}
.op-sec-head h3 {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--op-accent);
}
.op-sec-note { color: var(--muted); font-size: 0.8rem; }

.op-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.op-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}
.op-table th,
.op-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.op-table thead th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom-width: 1.5px;
  white-space: nowrap;
}
.op-table tbody th { font-weight: 650; white-space: nowrap; }
.op-table tbody tr:last-child th,
.op-table tbody tr:last-child td { border-bottom: 0; }
.op-table tr.op-today th,
.op-table tr.op-today td { background: var(--accent-sun-soft); }
.op-table tr.op-wknd th { color: var(--op-accent); }

.op-sub { color: var(--muted); font-size: 0.78rem; font-weight: 400; }
.op-mute { color: var(--muted); }
.op-star { color: var(--op-accent); font-weight: 700; }
.op-empty { margin: 0; color: var(--muted); font-size: 0.88rem; }
.op-tides-cell { white-space: normal; line-height: 1.45; }
.op-tide-item { white-space: nowrap; }

.op-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}
.op-go { background: var(--fi-go-soft); color: var(--fi-go); border-color: var(--fi-go-line); }
.op-maybe { background: var(--fi-maybe-soft); color: var(--fi-maybe); border-color: var(--fi-maybe-line); }
.op-no { background: var(--fi-no-soft); color: var(--fi-no); border-color: var(--fi-no-line); }
.op-none { color: var(--muted); border-color: var(--line); }

.op-sheet-foot {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: grid;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}
.op-sheet-foot p { margin: 0; }
.op-disclaimer strong { color: var(--text); }

@media (max-width: 900px) {
  .op-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .op-field-go { padding-top: 23px; }
}

/* ---- Phones: quick controls, compact tables (all columns return on print) ---- */
@media (max-width: 720px) {
  .op-hero-actions { align-items: stretch; width: 100%; }
  .op-print-btn { justify-content: center; width: 100%; }
  .op-print-hint { text-align: center; }
  .op-builder { padding: 14px; }
  .op-form { grid-template-columns: 1fr; }
  .op-field-go { padding-top: 0; }
  .op-apply { width: 100%; }
  .op-sheet { padding: 14px; }
  .op-table { font-size: 0.82rem; }
  .op-table th, .op-table td { padding: 5px 5px; }
  .op-table .op-wide { display: none; }
  .op-sp-grid { grid-template-columns: 1fr; max-height: 220px; }
}

/* ---- Print: crisp, monochrome-friendly field sheet on Letter or A4 ---- */
@media print {
  @page { margin: 10mm; }

  html,
  html[data-theme="dark"],
  html[data-theme="night"],
  body {
    filter: none !important;
    background: #fff !important;
    color: #111 !important;
    font-size: 10pt;
  }

  .site-header,
  .circumstances,
  .site-footer,
  .consent,
  dialog,
  .no-print {
    display: none !important;
  }

  main.page {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
  }

  .op-sheet {
    background: #fff !important;
    color: #111 !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    gap: 11px !important;
  }

  .op-sheet-head {
    border-bottom: 1.5pt solid #111 !important;
    padding-bottom: 7px !important;
  }
  .op-sheet-kicker,
  .op-sec-head h3,
  .op-table tr.op-wknd th,
  .op-star,
  .op-disclaimer strong {
    color: #111 !important;
  }
  .op-sheet-dates,
  .op-sheet-meta dt,
  .op-sec-note,
  .op-sub,
  .op-mute,
  .op-sheet-foot,
  .op-table thead th {
    color: #444 !important;
  }

  .op-table { font-size: 8.5pt !important; }
  .op-table .op-wide { display: table-cell !important; }
  .op-table th,
  .op-table td {
    padding: 3.5px 5px !important;
    border-bottom: 0.5pt solid #ccc !important;
  }
  .op-table thead { display: table-header-group; }
  .op-table thead th { border-bottom: 1pt solid #333 !important; }
  .op-table tr.op-today th,
  .op-table tr.op-today td { background: #f2f2f2 !important; }
  .op-table-wrap { overflow: visible !important; }

  .op-sec { break-inside: avoid; }
  .op-table tr { break-inside: avoid; }

  .op-badge {
    background: #fff !important;
    color: #111 !important;
    border: 0.75pt solid #333 !important;
    padding: 0 5px !important;
    font-size: 7.5pt !important;
  }
  .op-badge.op-no {
    background: #111 !important;
    color: #fff !important;
  }

  .op-sheet-foot {
    border-top: 0.75pt solid #666 !important;
    font-size: 7.5pt !important;
    break-inside: avoid;
  }
}
