:root {
  --bg: #14161a; --panel: #1d2127; --panel2: #232830; --line: #323945;
  --fg: #dde3ea; --dim: #8b95a3; --accent: #58a6ff; --ok: #3fb950;
  --warn: #d29922; --err: #f85149; --added: #3fb950; --removed: #f85149;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  display: flex; flex-direction: column; }

.topbar { display: flex; align-items: center; gap: 16px; padding: 8px 16px;
  background: var(--panel); border-bottom: 1px solid var(--line); }
/* Brand lockup: Traverse mark + wordmark. The light/bold split carries the
   two halves of the name without a second colour. */
.brand { display: flex; align-items: center; gap: 9px; color: var(--fg);
  text-decoration: none; font-size: 17px; line-height: 1; letter-spacing: .005em; }
.brand img { display: block; flex: none; }
.brand-l { font-weight: 300; }
.brand-r { font-weight: 600; }
/* Sponsor lockup beside the brand, as on the brochure cover: a small
   letter-spaced label, then the (white) Karstec logo. */
.sponsor { display: flex; align-items: center; gap: 8px; padding-left: 14px;
  border-left: 1px solid var(--line); text-decoration: none; }
.sponsor img { display: block; flex: none; height: 26px; width: auto; opacity: .92; }
.sponsor:hover img { opacity: 1; }
.sponsor-l { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim);
  white-space: nowrap; }
#nav { margin-left: auto; display: flex; gap: 12px; align-items: center; }
#nav a, #nav span { color: var(--dim); text-decoration: none; }
#nav a:hover { color: var(--fg); }
.nav-links { display: flex; gap: 12px; align-items: center; }
/* Your clubs, beside your name: links to their pages. */
#nav a.nav-club { text-decoration: underline dotted; text-underline-offset: 3px; }
#nav a.nav-club.current { color: var(--fg); text-decoration: none; font-weight: 600; }
.my-clubs { gap: 8px; align-items: center; flex-wrap: wrap; margin: -4px 0 12px; }
.my-clubs .chip { font-size: 13px; padding: 2px 11px; text-decoration: none; color: var(--accent); border-color: var(--accent); }
.navtoggle { display: none; }
.langsel { padding: 3px 6px; }

/* notifications bell */
.bell-wrap { position: relative; display: inline-flex; }
#bell { font-size: 15px; line-height: 1; }
.bell-badge { position: absolute; top: -7px; right: -9px; min-width: 15px; height: 15px;
  padding: 0 3px; box-sizing: border-box; border-radius: 8px; background: var(--err);
  color: #fff; font-size: 10px; font-weight: 700; line-height: 15px; text-align: center; }
.bell-panel { position: absolute; top: 26px; right: 0; width: 340px; max-height: 60vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.bell-head { display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--fg); }
.bell-head a { font-size: 12px; color: var(--accent); }
.notif { display: block; padding: 9px 12px; border-bottom: 1px solid var(--line);
  color: var(--fg); font-size: 13px; }
.notif:hover { background: var(--panel2); }
.notif.unread { border-left: 3px solid var(--accent); padding-left: 9px; }
.notif-meta { color: var(--dim); font-size: 11px; margin-top: 2px; }
.notif-empty { padding: 16px 12px; color: var(--dim); font-size: 13px; text-align: center; }
/* offline: the list is the last one seen (same colours as the offline strip) */
#bell.stale { opacity: .55; }
.notif-offline { padding: 7px 12px; background: #3a2f12; color: #f4d58d; border-bottom: 1px solid #6b5520; font-size: 12px; }

/* @mention autocomplete dropdown (position:fixed, anchored under the field by JS) */
.mention-box { position: fixed; z-index: 60; max-height: 180px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.mention-item { padding: 6px 10px; font-size: 13px; color: var(--fg); cursor: pointer; white-space: nowrap; }
.mention-item.active, .mention-item:hover { background: var(--panel2); }

main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.page { padding: 20px; max-width: 900px; margin: 0 auto; width: 100%; }
h1 { font-size: 20px; margin: 0 0 12px; } h2 { font-size: 16px; margin: 18px 0 8px; }
a { color: var(--accent); }
.muted { color: var(--dim); } .small { font-size: 12px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }

input, select, textarea, button {
  background: var(--panel2); color: var(--fg); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 9px; font: inherit; }
textarea { width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 1px solid var(--accent); }
button { cursor: pointer; }
button.primary { background: #1f6feb; border-color: #1f6feb; color: #fff; }
button.danger { color: var(--err); }
button:disabled { opacity: .5; cursor: default; }
label { display: block; margin: 8px 0 3px; color: var(--dim); font-size: 12px; }

.chip { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); }
.chip.open { color: var(--ok); border-color: var(--ok); }
.chip.merged { color: #a371f7; border-color: #a371f7; }
.chip.closed { color: var(--dim); }
.danger-zone { border-color: var(--err); }
.danger-zone summary { cursor: pointer; color: var(--err); }
.chip.correction { color: var(--warn, #d29922); border-color: var(--warn, #d29922); }
/* Made offline (outbox.js): waiting to be sent, or back for the person to decide. */
.chip.waiting { color: var(--dim); border-style: dashed; }
.chip.attention { color: var(--warn); border-color: var(--warn); text-decoration: none; }
.outbox-link { color: var(--dim); text-decoration: none; font-size: 14px; white-space: nowrap; }
.outbox-link.attention { color: var(--warn); font-weight: 600; }
.outbox-item table.list { width: 100%; }
.photo-waiting img { opacity: .6; outline: 1px dashed var(--dim); }
.flash { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 90; max-width: min(92vw, 560px);
  background: var(--panel2); color: var(--fg); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 16px; box-shadow: 0 8px 24px rgba(0,0,0,.45); font-size: 14px; }
textarea.code { font-family: ui-monospace, monospace; font-size: 13px; white-space: pre; overflow-x: auto; tab-size: 8; }
.chip.pass { color: var(--ok); border-color: var(--ok); }
.chip.fail { color: var(--err); border-color: var(--err); }

.stats { display: flex; gap: 18px; flex-wrap: wrap; }
.stats .stat b { display: block; font-size: 17px; }
.stats .stat span { color: var(--dim); font-size: 12px; }
.delta { color: var(--ok); }
.delta.minus { color: var(--removed); }

table.list { width: 100%; border-collapse: collapse; }
table.list td, table.list th { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
table.list tr:hover td { background: var(--panel2); }

/* cave workspace: viewer + sidebar */
.workspace { flex: 1; min-height: 0; display: flex; }
.viewer-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.viewer-toolbar { display: flex; gap: 8px; align-items: center; padding: 8px 12px;
  background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.viewer-box { flex: 1; min-height: 0; position: relative; }
.cave-svg { position: absolute; inset: 0; width: 100%; height: 100%; background: #0d1015; cursor: grab; }
/* Split view (app.js makeViewer): the plan on the left, the extended
   elevation on the right — stacked on a narrow screen. */
.viewer-box.split > .cave-svg { right: 50%; width: 50%; }
.split-pane { position: absolute; top: 0; bottom: 0; left: 50%; right: 0; border-left: 2px solid var(--line); }
.split-pane[hidden] { display: none; }
.split-label { position: absolute; top: 6px; left: 8px; z-index: 3; pointer-events: none; font-size: 12px;
  color: var(--dim); background: rgba(13, 16, 21, .8); padding: 1px 7px; border-radius: 4px; }
.split-label[hidden] { display: none; }
.split-label-plan { left: 52px; }   /* clear of the zoom buttons */
@media screen and (max-width: 760px) {
  .viewer-box.split > .cave-svg { right: 0; width: 100%; bottom: 50%; height: 50%; }
  .split-pane { left: 0; top: 50%; border-left: none; border-top: 2px solid var(--line); }
}
.empty-cave { position: absolute; inset: 0; z-index: 15; display: flex; align-items: center;
  justify-content: center; text-align: center; color: var(--dim); pointer-events: none; padding: 20px; }
.empty-cave a { pointer-events: auto; }
.cave-svg:active { cursor: grabbing; }
.sidebar { width: 360px; border-left: 1px solid var(--line); background: var(--panel);
  overflow-y: auto; padding: 12px; position: relative; flex-shrink: 0; }
.sidebar-resizer { position: sticky; top: 0; float: left; margin-left: -12px; width: 6px;
  height: 100vh; cursor: col-resize; z-index: 25; }
.sidebar-resizer:hover { background: var(--accent); opacity: .5; }
.sidebar h2 { margin-top: 10px; }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 10px; }
.tabs button { border-radius: 6px 6px 0 0; border-bottom: none; color: var(--dim); }
.tabs button.active { color: var(--fg); background: var(--panel2); }

.legend { display: flex; gap: 14px; font-size: 12px; color: var(--dim); align-items: center; }
.legend i { display: inline-block; width: 18px; height: 3px; margin-right: 4px; vertical-align: middle; }

/* layers dropdown + zoom controls */
details.layers { position: relative; }
details.layers > summary { list-style: none; cursor: pointer; padding: 6px 9px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; }
details.layers[open] > summary { border-color: var(--accent); }
details.layers > .menu { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; min-width: 230px; box-shadow: 0 6px 24px rgba(0,0,0,.5); }
details.layers .menu label { display: flex; gap: 6px; align-items: center; margin: 5px 0; color: var(--fg); font-size: 13px; }
details.layers .menu hr { border: none; border-top: 1px solid var(--line); margin: 8px 0; }
.zoombtns { position: absolute; top: 10px; left: 10px; z-index: 20; display: flex; flex-direction: column; gap: 4px; }
.zoombtns button { width: 30px; height: 30px; padding: 0; font-size: 15px; }

/* station panel */
.station-panel { background: var(--panel2); border: 1px solid var(--accent); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 10px; }
.station-panel .close { float: right; border: none; background: none; color: var(--dim); font-size: 14px; }

/* svg element classes */
.leg { stroke: #9fb4cc; stroke-linecap: round; }
.station-label { fill: #c7d3e0; stroke: #0d1015; paint-order: stroke;
  pointer-events: none; font-family: system-ui, sans-serif; }
.sel-ring { fill: none; stroke: var(--accent); }
.sel-label { fill: var(--accent); stroke: #0d1015; paint-order: stroke;
  pointer-events: none; font-family: system-ui, sans-serif; font-weight: 600; }
tr.selected-row td { background: #1f3a5f !important; }
.item.selected-row { background: #1f3a5f; }
.leg.context { stroke: #55606e; }
.leg.added { stroke: var(--added); }
.leg.removed { stroke: var(--removed); }
.leg.trip-hl { stroke: var(--accent); }
.leg.dim, .splay.dim { opacity: .22; }
.splay { stroke: #2c3542; }
/* Scrap line colours by type (width/dash set in JS so they scale with zoom). */
.scrap-line { fill: none; stroke: #8fa3b8; stroke-linecap: round; stroke-linejoin: round; }
.scrap-line.wall { stroke: #d8e2ee; }
.scrap-line.water, .scrap-line.stream { stroke: #58a6ff; }
.scrap-line.added { stroke: var(--added) !important; }
.scrap-symbol { fill: #8fa3b8; }
.scrap-symbol.added { fill: var(--added); }
.scrap-line.approach { stroke: #e2c268; }
.scrap-line.pit, .scrap-line.chimney { stroke: #9ecb8a; }
.scrap-line.floor-step, .scrap-line.ceiling-step { stroke: #7f8b99; }
.scrap-line.rock-border, .scrap-line.rock-edge { stroke: #8a94a3; }
.scrap-line.overhang { stroke: #b0a0c0; }
.scrap-line.contour { stroke: #6d7f6d; }
.scrap-line.flowstone { stroke: #c8a15a; }
.scrap-line.slope { stroke: #8a94a3; }
.scrap-symbol.debris, .scrap-symbol.blocks, .scrap-symbol.bedrock { fill: #99aabb; }
.scrap-symbol.flowstone { fill: #c8a15a; }
.scrap-symbol.water-flow { fill: #58a6ff; }

/* rendered markdown (descriptions, comments) */
.md { line-height: 1.5; }
.md h3, .md h4, .md h5 { margin: 10px 0 4px; }
.md p { margin: 6px 0; }
.md code { background: var(--panel2); padding: 0 4px; border-radius: 4px; }
.md pre { background: var(--panel2); padding: 8px 10px; border-radius: 6px; overflow-x: auto; }
.md blockquote { border-left: 3px solid var(--line); margin: 6px 0; padding: 2px 10px; color: var(--dim); }
.md table { margin: 8px 0; font-size: 13px; }
.md ul, .md ol { margin: 6px 0; padding-left: 22px; }
.mention { color: var(--accent); background: rgba(88, 166, 255, .15); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.station { fill: #cdd9e5; cursor: pointer; }
.station:hover { fill: var(--accent); }
.entrance { fill: var(--accent); }
.lead-mark { cursor: pointer; stroke: #0d1015; stroke-width: .5; }
.photo-badge { fill: #6cb6ff; opacity: .85; }
.atlas-marker { fill: var(--warn); stroke: #0d1015; cursor: pointer; }
.atlas-marker:hover { fill: var(--accent); }
.atlas-label { fill: #1d2127; stroke: #ffffff; paint-order: stroke;
  pointer-events: none; font-family: system-ui, sans-serif; font-weight: 600; }
.atlas-near line { stroke: #f59e0b; }
.atlas-near circle { fill: rgba(245, 158, 11, .18); stroke: #f59e0b; cursor: help; }
.atlas-passage { stroke-linecap: round; opacity: .85; pointer-events: none; }
.photo-thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.photo-thumbs img { height: 56px; border-radius: 4px; border: 1px solid var(--line); cursor: zoom-in; }
.lead-mark.open { fill: var(--warn); }
.lead-mark.closed { fill: #4a5261; }
.pick-banner { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; gap: 10px; align-items: center;
  background: var(--accent); color: #fff; padding: 6px 8px 6px 12px; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.45); font-size: 13px; max-width: calc(100% - 90px); }
.pick-banner[hidden] { display: none; }
/* No connection: what's on screen is the copy kept on this device (offline.js). */
.dx-panel { margin-top: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); }
.dx-shots { max-height: 260px; overflow: auto; }
.dx-flag { color: var(--warn); }
.offline-bar { background: #3a2f12; color: #f4d58d; border-bottom: 1px solid #6b5520; padding: 4px 16px; font-size: 13px; }
/* Club invitations waiting for an answer, on every page (app.js renderInviteBar). */
.invitebar { background: rgba(88, 166, 255, .1); border-bottom: 1px solid var(--accent); padding: 6px 16px; }
.invitebar[hidden] { display: none; }
.invitebar .row { gap: 8px; align-items: center; margin: 3px 0; flex-wrap: wrap; }
.trips-notice { position: absolute; left: 10px; bottom: 10px; z-index: 5; background: rgba(22, 27, 34, .93); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 10px; font-size: 13px; box-shadow: 0 4px 14px rgba(0,0,0,.35); max-width: calc(100% - 20px); }
.trips-notice[hidden] { display: none; }
.item.trip-off { opacity: .5; }
.pick-banner button { background: #fff; color: #111; border: none; }
.route-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0; }
.route-stats .stat b { font-size: 14px; }
.route-line { fill: none; stroke: var(--accent); stroke-opacity: .55; stroke-linejoin: round; stroke-linecap: round; pointer-events: none; }
.rig-mark { cursor: pointer; stroke: #0d1015; stroke-width: .8; }
.rig-mark.installed { fill: var(--ok); }
.rig-mark.partial { fill: var(--warn); }
.rig-mark.removed { fill: #4a5261; }
.rig-mark.unverified { fill: #a371f7; }
.chip.rig-installed { color: var(--ok); border-color: var(--ok); }
.chip.rig-partial { color: var(--warn); border-color: var(--warn); }
.chip.rig-removed { color: var(--dim); }
.chip.rig-unverified { color: #a371f7; border-color: #a371f7; }
.rig-form .rows > div { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin: 3px 0; }
.rig-form .rows input[type=number] { width: 70px; }
.rig-form .rows input[data-g=length_m] { width: 90px; }
.rig-form .rows select { max-width: 220px; }
.rig-form:not([data-state=partial]) .inplace { display: none; }

.item { padding: 8px 6px; border-bottom: 1px solid var(--line); }
.item:hover { background: var(--panel2); }
.checks li { margin: 3px 0; }
.checks .error { color: var(--err); } .checks .warn { color: var(--warn); } .checks .info { color: var(--dim); }
.comment { border-left: 3px solid var(--line); padding: 6px 10px; margin: 8px 0; }
.comment .who { color: var(--dim); font-size: 12px; }
.error-box { color: var(--err); margin: 8px 0; white-space: pre-wrap; }
.notice { color: var(--ok); margin: 8px 0; }
input[type=range] { accent-color: var(--accent); }

/* ---- annual report: a light "paper" on screen, and exactly that in print ---- */
.paper { background: #fff; color: #1f2328; padding: 36px 42px; border-radius: 6px; font-size: 13.5px; line-height: 1.5; }
.paper h1 { font-size: 26px; margin: 2px 0 4px; color: #111; }
.paper h2 { font-size: 18px; margin: 22px 0 4px; color: #111; border-bottom: 1px solid #e3e6ea; padding-bottom: 3px; }
.paper h3 { font-size: 14px; margin: 12px 0 2px; color: #111; }
.paper ul { margin: 4px 0; padding-left: 20px; }
.r-dim { color: #6b7280; }
.r-eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 11px; color: #d97706; }
.r-figures { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 18px 0 6px; }
.r-figures div { border: 1px solid #e3e6ea; border-radius: 6px; padding: 8px 10px; }
.r-figures b { display: block; font-size: 17px; color: #111; white-space: nowrap; }
.r-figures span { font-size: 11.5px; color: #6b7280; }
.r-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 12.5px; }
.r-table th { text-align: left; font-weight: 600; border-bottom: 1.5px solid #cfd4da; padding: 4px 6px; }
.r-table td { border-bottom: 1px solid #eceff2; padding: 4px 6px; vertical-align: top; }
.report-plan { width: 100%; height: auto; border: 1px solid #e3e6ea; border-radius: 4px; margin: 8px 0 2px; background: #fcfcfd; }
.r-legend { display: flex; gap: 14px; font-size: 11.5px; color: #6b7280; }
.r-legend i { display: inline-block; width: 14px; height: 3px; margin-right: 5px; vertical-align: middle; }
.r-post { margin: 8px 0; break-inside: avoid; }
.r-post a { color: #111; }
.r-foot { margin-top: 26px; border-top: 1px solid #e3e6ea; padding-top: 6px; font-size: 11px; }
@media print {
  body { background: #fff; }
  .topbar, .no-print { display: none !important; }
  .page { padding: 0; max-width: none !important; }
  .paper { padding: 0; border-radius: 0; }
  .r-cave > h2, .report-plan { break-after: avoid; }
  .report-plan, .r-figures, tr { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  @page { size: A4; margin: 16mm 14mm; }
}

/* ---- phones (and narrow windows) ------------------------------------------
   One column. The map comes first at ~60% of the screen and the sidebar
   follows it; wide tables scroll sideways inside their card instead of
   widening the page (which made phones zoom the whole app out); the top-bar
   links fold behind ☰ while the bell stays visible. Screen only — the annual
   report keeps its A4 print layout. */
@media screen and (max-width: 760px) {
  body { font-size: 15px; }
  /* 16px stops iOS zooming the page on every field you tap. */
  input, select, textarea, button { font-size: 16px; }
  button, details.layers > summary { min-height: 38px; }
  input[type=file] { max-width: 100%; }
  .small, .muted.small { font-size: 13px; }

  .topbar { position: relative; gap: 10px; padding: 8px 12px; }
  .brand { font-size: 16px; }
  .sponsor { padding-left: 10px; }
  .sponsor-l { display: none; }   /* phones: the logo alone */
  .sponsor img { height: 22px; }
  .navtoggle { display: block; padding: 4px 11px; font-size: 20px; line-height: 1; }
  .nav-links { display: none; }
  #nav.open .nav-links { display: flex; flex-direction: column; align-items: stretch; gap: 0;
    position: absolute; top: 100%; left: 0; right: 0; z-index: 70;
    background: var(--panel); border-bottom: 1px solid var(--line); box-shadow: 0 10px 24px rgba(0,0,0,.45); }
  #nav.open .nav-links > * { padding: 13px 18px; border-top: 1px solid var(--line); }
  #nav.open .nav-links > .langsel { margin: 8px 14px; padding: 6px 9px; }
  .nav-user { font-size: 13px; }
  .nav-user .nav-club { display: inline-block; padding: 6px 4px; }   /* big enough to tap */
  .bell-panel { position: fixed; top: 52px; left: 8px; right: 8px; width: auto; max-height: 70vh; }

  .page { padding: 12px; }
  h1 { font-size: 19px; }
  .card { padding: 12px; }
  /* A table wider than the screen scrolls inside its card. */
  table.list, .r-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.list td, table.list th { white-space: nowrap; }
  table.list td:first-child a, table.list td:nth-child(2) a { white-space: normal; }

  /* cave / join-request / map-sheet workspaces: map above, sidebar below */
  /* The whole page scrolls (toolbar included) rather than a fixed app shell —
     the natural phone model, and it lets the address bar hide. */
  html, body { height: auto; }
  body, main { display: block; }
  .workspace { flex-direction: column; }
  .viewer-pane { flex: none; height: 60vh; height: 60dvh; min-height: 300px; }
  .sidebar { width: auto !important; flex: none; border-left: none; border-right: none !important;
    border-top: 1px solid var(--line); overflow: visible; }
  .sidebar-resizer { display: none; }
  .viewer-toolbar { gap: 6px; padding: 6px 8px; }
  .viewer-toolbar select { flex: 1 1 30%; min-width: 0; }
  .viewer-toolbar #stationsearch { width: 100% !important; }
  .viewer-toolbar > .row { flex: 1 1 100%; }
  .viewer-toolbar .stats { gap: 10px; }
  .stats .stat b { font-size: 15px; }
  .legend { flex-wrap: wrap; gap: 8px; }
  details.layers > .menu { max-height: 70vh; overflow-y: auto; max-width: calc(100vw - 16px); }
  .tabs { overflow-x: auto; flex-wrap: nowrap; }
  .tabs button { flex: none; }
  .zoombtns button { width: 40px; height: 40px; font-size: 18px; }

  /* annual report on screen */
  .paper { padding: 18px 14px; }
  .paper h1 { font-size: 22px; }
  .r-figures { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}

/* ---- club blog ---- */
.md img.md-img { display: block; max-width: 100%; max-height: 70vh; margin: 10px auto; border-radius: 6px; }
.vis-badge { display: inline-block; font-size: 12px; font-weight: 600; border: 1px solid; border-radius: 4px; padding: 0 6px; white-space: nowrap; vertical-align: middle; }
.vis-badge.public { color: var(--ok); border-color: var(--ok); }
.vis-badge.club { color: var(--warn); border-color: var(--warn); }
.vis-banner { border: 1px solid; border-radius: 8px; padding: 8px 12px; margin: 10px 0 14px; font-size: 14px; }
.vis-banner.public { color: var(--ok); border-color: var(--ok); background: rgba(63, 185, 80, .08); }
.vis-banner.club { color: var(--warn); border-color: var(--warn); background: rgba(210, 153, 34, .08); }
.vis-banner span { color: var(--fg); }
.post-item { padding: 10px 0; border-top: 1px solid var(--line); }
.post-item:first-of-type { border-top: 0; }
.post-item h3 { margin: 0 0 2px; font-size: 16px; }
.post-body { font-size: 15px; }
.post-fields label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--dim); }
.post-fields input { width: 100%; box-sizing: border-box; font-size: 15px; }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.editor-grid textarea { width: 100%; min-height: 420px; font-family: ui-monospace, monospace; font-size: 13px; box-sizing: border-box; }
.editor-preview { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; min-height: 420px; overflow: auto; }
@media (max-width: 800px) { .editor-grid { grid-template-columns: 1fr; } .editor-grid textarea, .editor-preview { min-height: 240px; } }

/* ---- club search ---- */
.club-search { margin: 4px 0 10px; }
.club-search input { width: 100%; box-sizing: border-box; font-size: 16px; padding: 8px 12px; }
.club-hits { margin: 8px 0 0; }
.club-hit { padding: 8px 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.club-hit:first-child { border-top: 0; padding-top: 0; }
.club-hit:last-child { padding-bottom: 0; }
.club-hit > div { flex-basis: 100%; }
mark { background: rgba(210, 153, 34, .35); color: inherit; border-radius: 2px; padding: 0 1px; }
.scrap-text { font-family: Helvetica, Arial, sans-serif; pointer-events: none; }

/* ---- drawing editor (drawedit.js) ---- */
.draw-bar { position: absolute; top: 8px; left: 50px; right: 8px; z-index: 6; background: rgba(29, 33, 39, .94);
  border: 1px solid var(--line); border-radius: 8px; padding: 5px 7px; font-size: 13px; box-shadow: 0 4px 16px rgba(0, 0, 0, .35); }
.draw-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.draw-row select, .draw-row input { width: auto; padding: 3px 6px; font-size: 13px; }
.draw-row button { padding: 3px 8px; font-size: 13px; }
.draw-tools button { min-width: 32px; font-size: 15px; }
.draw-tools button.on { background: #1f6feb; border-color: #1f6feb; color: #fff; }
.draw-sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 3px; }
.draw-props { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--line); }
.draw-props label { display: inline-flex; align-items: center; gap: 3px; margin: 0; }
.draw-props input[type=color] { width: 36px; height: 26px; padding: 2px; cursor: pointer; }
.draw-hint { margin-top: 3px; color: var(--dim); font-size: 12px; }
.draw-save { margin-top: 6px; padding: 8px 10px; border-top: 1px solid var(--line); max-width: 560px; }
.draw-save h3 { margin: 0 0 4px; font-size: 15px; }
.draw-save label { display: block; margin-top: 6px; }
.draw-save input, .draw-save textarea { width: 100%; box-sizing: border-box; }
#drawbtn.on, #extbtn.on { background: #1f6feb; color: #fff; opacity: 1; }   /* the editor that's open */
@media screen and (max-width: 760px) { .draw-bar { left: 8px; top: 48px; } }
/* Dragging on the map must never select the text drawn on it. */
.cave-svg { -webkit-user-select: none; user-select: none; }
