/* Waypost trail planner. Shares tokens and type with styles.css. */
.planner { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.planner [hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.p-top { display: flex; align-items: center; gap: 20px; padding: 8px 18px; border-bottom: 1px solid var(--rule); background: var(--paper); flex: none; }
.p-top h1 { font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; padding-left: 18px; border-left: 2px solid var(--rule); line-height: 1.6; }
.p-search { display: flex; gap: 8px; margin-left: auto; flex: 0 1 380px; }
.p-search input { flex: 1; min-width: 0; font: inherit; padding: 6px 12px; border: 2px solid var(--ink); border-radius: 8px; background: #fff; color: var(--ink); min-height: 40px; }
.p-back { font-weight: 600; font-size: .95rem; white-space: nowrap; }

.p-app { flex: 1; min-height: 0; display: grid; grid-template-columns: 400px 1fr; }
.p-panel { overflow-y: auto; padding: 4px 20px 24px; border-right: 1px solid var(--rule); background: var(--paper); font-size: .97rem; line-height: 1.45; }
.p-sec { padding: 18px 0 20px; border-bottom: 1px solid var(--rule); }
.p-sec h2 { font-size: 1.15rem; font-weight: 900; letter-spacing: -.01em; margin-bottom: 10px; }
.p-help { color: var(--ink-2); font-size: .9rem; margin: 8px 0; }
.p-wide { width: 100%; }
.p-row { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 8px; }
.linkish.dark { color: var(--ink); font-weight: 600; }
.linkish.dark:hover { color: var(--plate-deep); }
.p-import { cursor: pointer; padding: 6px 0; font-size: .9rem; text-decoration: underline; text-underline-offset: .2em; }
.p-import input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.p-import:focus-within { outline: 3px solid var(--plate); outline-offset: 3px; border-radius: 4px; }

.p-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.p-tools button {
  display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 6px 10px;
  font: inherit; font-weight: 600; font-size: .92rem; text-align: left; color: var(--ink);
  background: transparent; border: 2px solid var(--rule); border-radius: 8px; cursor: pointer;
}
.p-tools button:hover { border-color: var(--ink-2); }
.p-tools button[aria-pressed="true"] { border-color: var(--ink); background: #F5F7EF; box-shadow: inset 0 0 0 1px var(--ink); }

.p-trails { list-style: none; margin: 10px 0 0; padding: 0; }
.p-trails li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--rule); }
.p-trails input { flex: 1; min-width: 0; font: inherit; font-weight: 600; border: 0; background: transparent; color: var(--ink); padding: 4px 0; }
.p-trails input:focus-visible { outline: 2px solid var(--plate); outline-offset: 2px; }
.p-trails span { color: var(--ink-2); font-size: .88rem; white-space: nowrap; }
.p-trails button { font: inherit; font-size: .85rem; border: 0; background: none; color: var(--plate-deep); text-decoration: underline; cursor: pointer; padding: 4px; }

.p-selected { margin-top: 12px; padding: 12px; border: 2px solid var(--ink); border-radius: 8px; background: #F5F7EF; }
.p-selected h3 { font-size: 1rem; margin-bottom: 4px; }
.p-selected p { margin: 2px 0; font-size: .9rem; color: var(--ink-2); }
.p-selected select { font: inherit; padding: 6px 8px; border: 2px solid var(--ink); border-radius: 6px; background: #fff; margin: 8px 8px 0 0; min-height: 38px; }

.p-status { font-weight: 800; margin: 0 0 10px; }
.p-status.bad { color: var(--plate-deep); }
.p-counts { display: grid; grid-template-columns: 1fr auto; gap: 0; margin: 0; }
.p-counts dt, .p-counts dd { padding: 6px 0; border-top: 1px solid var(--rule); margin: 0; }
.p-counts dd { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.p-counts .sum { border-top: 2px solid var(--ink); }
.p-issues { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.p-issues button { width: 100%; display: flex; gap: 10px; align-items: baseline; text-align: left; font: inherit; font-size: .92rem; color: var(--ink); background: #fff; border: 0; border-left: 6px solid var(--amber); border-radius: 4px; padding: 8px 10px; cursor: pointer; }
.p-issues button.fail { border-left-color: var(--plate); }
.p-issues button.note { border-left-color: var(--ink-2); cursor: default; }
.p-issues button:hover { background: #F5F7EF; }
.p-issues b { white-space: nowrap; }

.p-profile { margin-top: 16px; }
.p-profile-title { font-weight: 800; margin: 0 0 4px; font-size: .92rem; }
#profile-svg { width: 100%; height: 120px; background: #fff; border-radius: 6px; }
.p-profile-range { margin: 4px 0 0; font-size: .85rem; color: var(--ink-2); }
.p-assume { border: 0; margin-top: 14px; }
.p-assume summary { font-size: .95rem; padding: 8px 30px 8px 0; }
.p-assume summary::after { top: 2px; font-size: 1.4rem; }
.p-assume label { display: block; font-weight: 600; font-size: .9rem; margin: 10px 0 2px; }
.p-assume output { float: right; font-weight: 800; }
.p-assume input[type=range] { width: 100%; accent-color: var(--plate); margin-top: 4px; }

.p-ai { margin-top: 12px; }
.p-ai h4 { margin: 14px 0 4px; font-size: .98rem; font-weight: 800; }
.p-ai p, .p-ai li { font-size: .93rem; margin: 0 0 6px; max-width: none; }
.p-ai ul { margin: 0 0 6px; padding-left: 18px; }
.p-ai .p-ai-note { color: var(--ink-2); font-size: .85rem; border-top: 1px solid var(--rule); padding-top: 8px; margin-top: 10px; }

.p-quote { display: grid; gap: 10px; }
.p-quote label { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
.p-quote input { font: inherit; font-weight: 400; padding: 8px 10px; border: 2px solid var(--ink); border-radius: 7px; background: #fff; color: var(--ink); min-height: 42px; }
.p-quote [aria-invalid="true"] { border-color: var(--plate); background: #FCEDEC; }
.p-quote .hp { position: absolute; left: -9999px; }
.p-fine { font-size: .84rem; color: var(--ink-2); margin: 16px 0 0; }
.creator-light { border-top-color: var(--rule); }
.creator-light p { color: var(--ink-2); }
.creator-light p a:hover { color: var(--ink); }

/* map */
.p-mapwrap { position: relative; min-height: 0; }
#pmap { position: absolute; inset: 0; background: var(--forest); }
.p-maphint { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); margin: 0; z-index: 5; background: var(--ink); color: var(--paper); font-weight: 600; font-size: .92rem; padding: 8px 14px; border-radius: 8px; max-width: calc(100% - 120px); text-align: center; pointer-events: none; }
.p-legend { position: absolute; left: 12px; bottom: 28px; z-index: 5; list-style: none; margin: 0; padding: 8px 12px; background: rgba(232,236,223,.94); border-radius: 8px; font-size: .82rem; font-weight: 600; display: grid; gap: 3px; }
.p-legend li { display: flex; align-items: center; gap: 8px; }
.lg { width: 26px; height: 0; border-top: 3px solid #1F7A54; }
.lg-spine { border-top: 5px solid #19A463; outline: 2px solid #fff; border-radius: 3px; }
.lg-marg { border-top-color: var(--amber); }
.lg-block { border-top: 3px dashed var(--plate); }
.p-legend .lg-note { max-width: 15rem; margin-top: 3px; font-weight: 400; line-height: 1.3; }
.p-mapwrap.tool-add #pmap, .p-mapwrap.tool-add canvas { cursor: crosshair !important; }

/* markers (also used as icons in the tool buttons) */
.pm { position: relative; display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 4px; background: var(--tan); border: 2px solid var(--ink); color: var(--ink); font: 800 10px/1 "Overpass", sans-serif; font-style: normal; box-sizing: border-box; }
.pm-rep { background: #EFC3A2; }
.pm-rep::before, .pm-mast::before { content: ""; position: absolute; left: 50%; bottom: 100%; width: 2px; height: 8px; margin-left: -1px; background: var(--ink); }
.pm-mast { background: #fff; border-radius: 50%; }
.pm-mast::before { height: 14px; }
.pm-gw { background: var(--ink); color: #fff; border-radius: 3px 3px 3px 3px; clip-path: polygon(50% 0, 100% 38%, 100% 100%, 0 100%, 0 38%); }
.pm-counter { background: var(--creek); border-radius: 50%; }
.pm-on-map { cursor: grab; box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
.pm-on-map.pm-gw { box-shadow: none; filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 1px #fff); width: 26px; height: 26px; }
.pm-on-map.st-check { box-shadow: 0 0 0 4px var(--amber); }
.pm-on-map.st-fail { box-shadow: 0 0 0 4px var(--plate); }
.pm-on-map.sel { outline: 3px solid #fff; outline-offset: 5px; }

@media (max-width: 860px) {
  .planner { height: auto; overflow: visible; }
  .p-top { flex-wrap: wrap; gap: 8px 14px; }
  .p-search { order: 3; flex-basis: 100%; }
  .p-app { display: flex; flex-direction: column-reverse; }
  .p-mapwrap { height: 62dvh; position: sticky; top: 0; z-index: 2; }
  .p-panel { border-right: 0; padding-inline: 16px; }
}

/* press simulator */
.p-tools .p-simbtn { grid-column: 1 / -1; }
.p-sim-out { margin: 8px 0 0; font-size: .9rem; font-weight: 600; line-height: 1.4; }
.p-sim-out:empty { display: none; }
.p-sim-out.bad { color: var(--plate); }
.lg-sim { border-top: 5px solid var(--plate); outline: 2px solid #fff; border-radius: 3px; }
.pm-on-map.sim-on { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--plate); }
.pm-on-map.sim-first { animation: simpulse 1.1s ease-out infinite; }
@keyframes simpulse { 0% { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--plate), 0 0 0 6px rgba(200,52,58,.7); } 100% { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--plate), 0 0 0 26px rgba(200,52,58,0); } }
@media (prefers-reduced-motion: reduce) { .pm-on-map.sim-first { animation: none; } }
