/* map: directions viewer (.gm-view) and the office map editor (.gm-ed) */

/* ---- viewer ---- */
.gm-view { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.gm-title { font-size: 1.05rem; }
.gm-map { position: relative; border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; background: var(--surface-2); }
.gm-svg { display: block; width: 100%; height: auto; max-height: 62vh; aspect-ratio: 4 / 3; }
.gm-whole { position: absolute; right: 8px; top: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .8rem; font-weight: 650; cursor: pointer; min-height: 32px; }
.gm-warn { position: absolute; left: 8px; right: 8px; bottom: 8px; background: var(--warn-soft, var(--surface)); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r1); padding: 6px 10px; font-size: .82rem; }
.gm-case { fill: none; stroke: var(--surface); stroke-linecap: round; stroke-linejoin: round; opacity: .95; }
.gm-line { fill: none; stroke: var(--accent); stroke-linecap: round; stroke-linejoin: round; }
.gm-start { fill: var(--ok); stroke: var(--surface); }
.gm-pin path { fill: var(--bad); stroke: var(--surface); stroke-width: 1.4; }
.gm-pin-dot { fill: var(--surface); }
.gm-via rect { fill: var(--warn); stroke: var(--surface); stroke-width: 2; }
.gm-lbl { fill: var(--ink); stroke: var(--surface); paint-order: stroke; stroke-linejoin: round; font-weight: 650; pointer-events: none; font-family: inherit; }
.gm-lbl.strong { font-weight: 800; }
.gm-steps { margin: 0; padding: 0; list-style: none; counter-reset: gm; display: flex; flex-direction: column; gap: 6px; }
.gm-steps li { counter-increment: gm; display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; background: var(--surface-2); border-radius: var(--r2); line-height: 1.35; }
.gm-steps li::before { content: counter(gm); flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 750; font-size: .8rem; display: grid; place-items: center; margin-top: 1px; }
.gm-note { background: var(--accent-soft); border-radius: var(--r2); padding: 10px 12px; }
.gm-note b { display: block; font-size: .8rem; margin-bottom: 2px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.gm-loc { margin: 0; }
.gm-none { margin: 0; }
.gm-host { min-height: 80px; }
.gm-phase { fill: var(--gm-pc, var(--accent)); fill-opacity: .06; stroke: var(--gm-pc, var(--accent)); stroke-opacity: .7; stroke-linejoin: round; pointer-events: none; }
.gm-phase-lbl { fill: var(--gm-pc, var(--accent)); stroke: var(--surface); paint-order: stroke; stroke-linejoin: round; font-weight: 800; pointer-events: none; font-family: inherit; opacity: .9; }
.gm-halo { fill: var(--bad); fill-opacity: .14; stroke: var(--bad); stroke-opacity: .5; stroke-width: 1; }
.gm-where { margin: 0; font-size: 1rem; line-height: 1.4; }
.gm-pinonly .gm-map { border-color: var(--line); }
.gm-draft { background: var(--warn-soft, var(--surface-2)); border: 1px solid var(--warn); border-radius: var(--r2); padding: 9px 12px; font-size: .9rem; line-height: 1.4; }

/* ---- editor ---- */
.gm-ed { display: flex; flex-direction: column; gap: 12px; }
.gm-help { margin: 8px 0 12px; padding-left: 18px; }
.gm-help li { margin: 2px 0; }
.gm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.gm-bar .seg button { min-height: 36px; }
.gm-prog { min-width: 180px; }
.gm-prog-t { font-weight: 700; font-size: .92rem; }
.gm-prog-b { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 4px; border: 1px solid var(--line); }
.gm-prog-b i { display: block; height: 100%; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .25s; }
.gm-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; align-items: start; }
.gm-vp { position: relative; overflow: hidden; height: clamp(380px, 70vh, 860px); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r2); touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; outline: none; }
.gm-vp:active { cursor: grabbing; }
.gm-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.gm-stage img { display: block; max-width: none; pointer-events: none; -webkit-user-drag: none; }
.gm-ov { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.gm-ov [data-k] { pointer-events: all; cursor: pointer; }
.gm-zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.gm-zoom .btn { min-width: 40px; min-height: 40px; font-size: 1.15rem; padding: 4px 10px; }
.gm-hint { position: absolute; left: 10px; bottom: 10px; right: 64px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); padding: 7px 12px; font-size: .86rem; pointer-events: none; opacity: .96; }
.gm-side { max-height: clamp(380px, 70vh, 860px); overflow: auto; }
.gm-side h3 { margin: 0 0 8px; font-size: 1rem; }
.gm-sel { margin-top: 12px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.gm-li { width: 100%; text-align: left; border: 0; background: none; font: inherit; color: inherit; }
.gm-li.on { background: var(--accent-soft); }
.gm-edge { stroke: var(--accent); stroke-linecap: round; opacity: .9; fill: none; }
.gm-edge.sel { stroke: var(--warn); }
.gm-edge.dim { opacity: .45; }
.gm-hit { stroke: transparent; fill: none; pointer-events: all; cursor: pointer; }
.gm-node { fill: var(--surface); stroke: var(--accent); }
.gm-node.sel { fill: var(--warn); stroke: var(--ink); }
.gm-node.dim { opacity: .5; }
.gm-pin-d { fill: var(--accent); stroke: transparent; }
.gm-pin-d.sel { fill: var(--warn); }
.gm-pin-d.dim { opacity: .75; }
.gm-gate { fill: var(--ok); stroke: var(--surface); }
.gm-gate.off { fill: var(--ink-2); }
.gm-gate.sel { fill: var(--warn); stroke: var(--ink); }
.gm-ghost { fill: var(--accent-soft); stroke: var(--accent); stroke-dasharray: 3 2; }
.gm-edge.draft { stroke: var(--warn); opacity: .95; stroke-linecap: butt; }
.gm-edge.draft.sel { stroke: var(--bad); }
.gm-gate.draft { fill: var(--warn); stroke: var(--ink); }
.gm-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.gm-legend:empty { display: none; }
.gm-bar .gm-legend { flex-basis: 100%; }
.gm-key { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.gm-key i { display: inline-block; flex: none; }
.gm-k-draft { width: 26px; height: 0; border-top: 3px dashed var(--warn); }
.gm-k-gate { width: 11px; height: 11px; background: var(--warn); border: 1.5px dashed var(--ink); border-radius: 2px; }
.gm-k-home { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.gm-check { margin-top: 12px; padding: 10px; border: 1px solid var(--warn); border-radius: var(--r2); background: var(--warn-soft, var(--surface-2)); display: flex; flex-direction: column; gap: 8px; }
.gm-check.ok { border-color: var(--ok); background: var(--ok-soft, var(--surface-2)); }
.gm-check p { margin: 0; }
.gm-bar .btn.on { background: var(--accent-soft); border-color: var(--accent); }
.gm-seed details { margin-top: 6px; }
.gm-seed summary { cursor: pointer; font-weight: 650; min-height: 32px; display: flex; align-items: center; }
.gm-seed .row { flex-wrap: wrap; gap: 8px; }
.gm-test .row { align-items: center; }

@media (max-width: 900px) {
  .gm-main { grid-template-columns: minmax(0, 1fr); }
  .gm-side { max-height: none; }
  .gm-vp { height: clamp(320px, 60vh, 700px); }
}
@media print { .gm-whole { display: none; } .gm-steps li { break-inside: avoid; } }

/* ---- pan and zoom on the directions page ---- */
.gm-zoomable .gm-svg { touch-action: none; cursor: grab; max-height: none; aspect-ratio: 4 / 3; }
.gm-zoomable .gm-svg:active { cursor: grabbing; }
.gm-zbtn { position: absolute; right: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 6px; }
.gm-zbtn button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 1.35rem; font-weight: 700; line-height: 1; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.gm-zoomable .gm-whole { min-height: 44px; padding: 8px 14px; }
.gm-zoomable .gm-warn { right: 64px; }

/* ---- "Send directions" sheet ---- */
.dirs { display: flex; flex-direction: column; gap: 14px; }
.dirs-lede { margin: 0; }
.dirs-sec { border: 1px solid var(--line); border-radius: var(--r2); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dirs-sec h3 { margin: 0; font-size: 1rem; }
.dirs-sec p { margin: 0; }
.dirs-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.dirs-k { font-weight: 650; font-size: .9rem; }
.modal .dirs .dirs-seg button { min-height: 44px; min-width: 44px; padding: 8px 12px; }
.modal .dirs .btn, .modal .dirs .btn.sm { min-height: 44px; }
.dirs-link { width: 100%; font-size: 16px; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r1); background: var(--surface-2); color: var(--ink); box-sizing: border-box; }
.dirs-made { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dirs-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.dirs-acts .btn { flex: 1 1 132px; justify-content: center; white-space: nowrap; }
.dirs .btn svg { flex: none; }
.dirs-ph { display: flex; flex-direction: column; gap: 8px; }
.dirs-ph-img { width: 100%; max-width: 360px; height: auto; border-radius: var(--r1); border: 1px solid var(--line); align-self: center; -webkit-touch-callout: default; }
.dirs-warn { color: var(--bad); }
.dirs-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dirs-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface-2); border-radius: var(--r1); min-width: 0; }
.dirs-list .grow { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.dirs-cancel { color: var(--bad); flex: none; }

/* ---- the page someone opens: #/d/TOKEN (owner colours: navy and gold) ---- */
.dirp { min-height: 100vh; min-height: 100dvh; background: #F6F2EA; color: #0E2233; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); box-sizing: border-box; overflow-x: hidden; }
.dirp-in { max-width: 760px; margin: 0 auto; padding: 0 0 28px; display: flex; flex-direction: column; gap: 14px; }
.dirp-h { background: #0E2233; color: #fff; padding: 22px 18px 18px; }
.dirp-club { margin: 0 0 4px; color: #D6AB60; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; font-size: .8rem; }
.dirp-h h1 { margin: 0; font-size: 1.6rem; line-height: 1.2; color: #fff; overflow-wrap: anywhere; }
.dirp-sub { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .92rem; color: #E8E1D2; }
.dirp-loading { padding: 0 18px; color: #4A5562; }
.dirp-map { padding: 0 12px; }
.dirp-map .gm-view { gap: 14px; }
.dirp-map .gm-title { display: none; }
.dirp-map .gm-map { background: #E9E4DA; border-color: #D9D1C1; }
.dirp-map .gm-svg { max-height: 70vh; }
.dirp-msg { margin: 0 12px; padding: 14px 16px; border-radius: 12px; background: #fff; border: 1px solid #D9D1C1; font-size: 1rem; line-height: 1.45; }
.dirp-msg.warn { border-color: #D6AB60; background: #FFF8E8; }
.dirp-msg p { margin: 0; }
.dirp-foot { margin: 0 18px; font-size: .9rem; color: #4A5562; }
