/* pumptrack layout on top of the Mobi Field Tools design system (vendor/tokens.css, vendor/mobi-ops.css).
   Every colour, space and radius is a design-system token. Phone first. */
html, body { margin: 0; background: var(--screen-bg); }
body { font-family: var(--font-sans); color: var(--text-primary); -webkit-font-smoothing: antialiased; }
* { box-sizing: border-box; }

.pt { max-width: 640px; margin: 0 auto; padding: 0 var(--space-16) var(--space-24); min-height: 100vh; }
.pt .mo-header { padding-left: 0; padding-right: 0; }
.pt-stack > * + * { margin-top: var(--space-12); }

.pt-wordmark { font: 400 22px/1.2 var(--font-sans); color: var(--accent); }
.pt-wordmark b { font-weight: 700; color: var(--text-primary); }

.pt-signin { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: var(--space-16); }
.pt-signin img { width: 88px; height: 88px; }
.pt-signin .mo-btn { min-width: 240px; }
.pt-help { font-size: 13px; line-height: 1.3; color: var(--text-muted); }
.pt-pad { padding: var(--space-12) var(--space-14); }
.pt-user { font-size: 16px; font-weight: 700; margin-bottom: var(--space-4); }

/* Station: a nearer station in follow mode. A "!" in the header unfolds a one-line offer. */
.pt-alert { width: 36px; height: 36px; margin: 6px; border: 0; border-radius: 50%; background: var(--status-progress-bg);
  color: var(--status-progress-fg); font: 700 18px/1 var(--font-sans); cursor: pointer; }
.pt-alert.is-open { background: var(--status-progress-fg); color: #fff; }
.pt-alert:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pt-nearer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); width: 100%;
  min-height: 44px; padding: var(--space-4) var(--space-12); border: 0; border-radius: var(--radius-card);
  background: var(--status-progress-bg); color: var(--status-progress-fg); font: 14px/1.2 var(--font-sans); text-align: left; cursor: pointer; }
.pt-nearer:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pt-nearer__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-nearer__go { display: inline-flex; align-items: center; font-weight: 700; flex: none; }

/* Choose a station */
.pt-follow { display: flex; align-items: center; gap: var(--space-12); }
.pt-follow > div { flex: 1; min-width: 0; }
.pt-follow > div > * + * { margin-top: var(--space-4); }
.pt-follow__title { font-size: 14px; font-weight: 700; }
.pt-pick { display: flex; flex-direction: column; gap: 2px; width: 100%; min-height: 56px; padding: var(--space-10) var(--space-14);
  border: 0; border-top: 1px solid var(--divider); background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.pt-pick:first-child { border-top: 0; }
.pt-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pt-pick__name { font-size: 16px; font-weight: 700; }
.pt-pick__meta { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.pt-note { margin-top: var(--space-8); }

/* Station view: the transmitter tile */
.pt-tile { display: flex; flex-direction: column; gap: 2px; min-width: 0; min-height: 56px; padding: var(--space-8) var(--space-12);
  border: 1px solid var(--outline); border-radius: var(--radius-card); background: var(--surface); }
.pt-tile.has-tasks { border: 1.5px solid var(--text-primary); }
.pt-tile__title { font-size: 12px; color: var(--text-muted); }
.pt-tile__tasks { font-size: 14px; line-height: 1.25; color: var(--text-muted); overflow-wrap: anywhere; }
.pt-tile.has-tasks .pt-tile__tasks { font-weight: 700; color: var(--text-primary); }
section > .mo-section { margin-bottom: var(--space-8); }
section > .pt-tile + .pt-tile { margin-top: var(--space-8); }

/* Station view: one row per dock (dock · bike · flagged chips), opening in place */
.pt-glyph { width: auto; height: 12px; flex: none; }
.pt-glyph--bolt { height: 13px; }
.pt-row { border-top: 1px solid var(--divider); }
.pt-row:first-child { border-top: 0; }
.pt-row__head { display: grid; grid-template-columns: 40px 64px minmax(0, 1fr) 18px; align-items: center; gap: var(--space-8);
  min-height: 56px; padding: var(--space-8) var(--space-12); color: inherit; text-decoration: none;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.pt-row__head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pt-row__head:active { background: var(--screen-bg); }
.pt-row__head > svg { color: var(--text-muted); }
.pt-row__dock { display: inline-flex; align-items: center; gap: var(--space-4); font: 500 12px/1 var(--font-mono); color: var(--text-muted); }
.pt-row__bike { display: inline-flex; align-items: center; gap: var(--space-4); font: 500 14px/1 var(--font-mono); }
.pt-row__num { font-weight: 500; }
.pt-row__blank { width: 40px; border-bottom: 1.5px solid var(--text-muted); opacity: .6; align-self: flex-end; margin-bottom: 2px; }
.pt-row__flags { display: flex; flex-wrap: wrap; gap: var(--space-4); min-width: 0; }
.pt-row__ops { font-weight: 700; letter-spacing: .04em; }
.pt-issue { display: flex; flex-direction: column; gap: 2px; padding: var(--space-10) var(--space-14); border-top: 1px solid var(--divider); }
.pt-issue:first-child { border-top: 0; }
.pt-issue__title { font-size: 14px; font-weight: 500; }
.pt-updated { display: flex; align-items: center; justify-content: space-between; gap: var(--space-12); }
a.pt-tile { text-decoration: none; color: inherit; }
a.pt-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Detail screens: Bike, Dock, Transmitter */
.pt-issue__meta { display: flex; align-items: center; gap: var(--space-8); flex-wrap: wrap; }
.pt-link { color: inherit; text-decoration: underline; }
.mo-btn.pt-armed { background: var(--status-failed-bar); }
/* The design system has no disabled look; a button that does nothing must not look ready. */
.mo-btn:disabled { opacity: .45; cursor: default; }
.pt-rows { overflow: hidden; }

/* Issue flow: issue screen, Report, comments */
.pt-issue--link { display: flex; color: inherit; text-decoration: none; }
.pt-issue--link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pt-actions { display: flex; gap: var(--space-12); }
.pt-actions > .mo-btn:first-child { flex: 1; }
.pt-comment { font-size: 14px; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; }
.pt-gap { margin-top: var(--space-12); }
.pt-select, .pt-textarea { display: block; width: 100%; border: var(--size-hairline) solid var(--outline); border-radius: var(--radius-card);
  background: var(--surface); color: var(--text-primary); font: 400 16px/1.35 var(--font-sans); outline: none; }
.pt-select { height: var(--size-row-lg); padding: 0 var(--space-12); }
.pt-textarea { padding: var(--space-12); resize: vertical; min-height: 64px; }
.pt-select:focus, .pt-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pt-select:disabled, .pt-textarea:disabled { background: var(--screen-bg); color: var(--text-muted); }

/* Bottom sheet over the tab bar */
.pt-shade { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; justify-content: flex-end;
  background: rgba(0, 0, 0, .4); }
.pt-sheet { max-width: 640px; width: 100%; max-height: 85vh; margin: 0 auto; overflow-y: auto; display: flex; flex-direction: column;
  gap: var(--space-12); padding: var(--space-20) var(--space-16) calc(var(--space-24) + env(safe-area-inset-bottom));
  background: var(--surface); border-radius: var(--radius-card-lg) var(--radius-card-lg) 0 0; outline: none; }
/* A long list scrolls the sheet instead of squeezing its buttons. */
.pt-sheet > * { flex-shrink: 0; }
.pt-sheet__title { margin: 0 0 var(--space-4); font-size: 16px; font-weight: 700; }
.pt-check { display: flex; align-items: center; gap: var(--space-12); min-height: 48px; padding: var(--space-8) var(--space-14);
  border-top: 1px solid var(--divider); font-size: 14px; line-height: 1.3; cursor: pointer; }
.pt-check:first-child { border-top: 0; }
.pt-check input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--accent); }

/* Mark pumped sheet; a tool row with a hint and buttons */
.pt-selecttools { display: flex; align-items: center; gap: var(--space-8); }
.pt-selecttools > .pt-help { flex: 1; min-width: 0; }
.pt-selecttools .mo-btn { height: var(--size-row); padding: 0 var(--space-14); font-size: 14px; }
.pt-selecttools--wrap { flex-wrap: wrap; }
/* A toggle in a tool row, on: filled */
.pt-selecttools .mo-btn.pt-on { background: var(--accent); border-color: var(--accent); color: var(--on-brand); }
.pt-bubbles__label { margin-bottom: calc(-1 * var(--space-4)); }
/* Bikes in the Mark pumped sheet: pills that wrap, tapped on and off (lighter than the filter toggles) */
.pt-bubbles { display: flex; flex-wrap: wrap; gap: var(--space-8); }
.pt-bubble { display: inline-flex; align-items: baseline; gap: 6px; min-height: 40px; padding: 0 var(--space-14);
  border-radius: var(--radius-full); border: 1px dashed var(--text-muted); background: var(--surface);
  color: var(--text-muted); font: 400 13px/1 var(--font-sans); cursor: pointer; align-items: center; }
.pt-bubble b { font: 500 15px/1 var(--font-mono); text-decoration: line-through; }
.pt-bubble.is-on { border-style: solid; border-color: var(--accent); background: var(--accent-bg); color: var(--accent-strong); }
.pt-bubble.is-on b { text-decoration: none; }
.pt-bubble:disabled { cursor: default; opacity: .6; }
.pt-bubble:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pt-pick:disabled { cursor: default; opacity: .5; }

/* Menu: task values, Advanced rules */
.pt-value { display: flex; align-items: center; gap: var(--space-12); min-height: 52px; padding: var(--space-6) var(--space-12) var(--space-6) var(--space-14); border-top: var(--size-hairline) solid var(--divider, var(--outline)); }
.pt-value:first-child { border-top: 0; }
.pt-value__name { flex: 1; min-width: 0; font-size: 14px; }
.pt-value .mo-seg { width: 184px; flex-shrink: 0; }
.pt-value .mo-seg__opt { height: 40px; font-size: 13px; }
.pt-pick--link { flex-direction: row; align-items: center; color: inherit; text-decoration: none; }
.pt-pick--link > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pt-rule { padding: var(--space-8) var(--space-12) var(--space-8) var(--space-14); border-top: var(--size-hairline) solid var(--divider, var(--outline)); }
.pt-rule:first-child { border-top: 0; }
.pt-rule__row { display: flex; align-items: center; gap: var(--space-12); min-height: 40px; }
.pt-rule__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pt-rule__name { font-size: 14px; font-weight: 500; }
.pt-rule__input { display: flex; align-items: center; gap: var(--space-6); flex-shrink: 0; }
.pt-rule__unit { width: 32px; font-size: 13px; color: var(--text-muted); }
.pt-rule__hint { margin-top: var(--space-4); font-size: 12px; color: var(--status-failed-fg); text-align: right; }
.pt-numfield { width: 72px; height: 48px; box-sizing: border-box; padding: 0 10px; border: var(--size-hairline) solid var(--outline); border-radius: 12px; background: var(--surface, #fff); color: var(--text-primary); font: 16px var(--font-mono); text-align: right; }
.pt-numfield:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pt-numfield[aria-invalid="true"] { border-color: var(--status-failed-fg); }


/* Timeline: open issues and services, newest first (station.js Timeline) */
.pt-tl { margin: 0; padding: 0; list-style: none; }
.pt-tl .mo-tl__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; color: inherit; text-decoration: none; }
.pt-tl .mo-tl__head { flex-wrap: wrap; }
.pt-tl__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pt-tl__link .mo-tl__title { text-decoration: underline; text-underline-offset: 3px; }
.pt-tl__notes { font-size: 13px; line-height: 1.35; white-space: pre-line; overflow-wrap: anywhere; }
.pt-tl__notes.is-clamped { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Staging strip (app.js): on every screen of pumptrack-staging.mobibikes.info, above the header. */
.pt-staging { position: sticky; top: 0; z-index: 30; padding: 4px var(--space-16); text-align: center;
  font: 700 12px/16px var(--font-sans); letter-spacing: 0.08em; color: #fff; background: #b45309; }

/* Screen frame (shell.js): breadcrumb over the header; search and avatar on its right. */
.pt-top { padding-top: var(--space-8); }
.pt-top .mo-header { padding-top: var(--space-8); }
.pt-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); font-size: 13px; }
.pt-crumbs a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); text-decoration: none; font-weight: 500; }
.pt-crumbs a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pt-crumbs__sep { color: var(--text-muted); }
.pt-tools { display: flex; align-items: center; gap: var(--space-4); }
.pt-tool { text-decoration: none; color: var(--text-primary); }
.pt-avatar { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 2px;
  border-radius: 50%; background: var(--accent); color: #fff; font: 700 14px/1 var(--font-sans); text-decoration: none; }
.pt-avatar:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The action bar (shell.js ActionBar): bottom of the Station and object screens, the same place
   everywhere, labelled with what it acts on. */
main.pt--bar { padding-bottom: 0; }
.pt-bar { position: sticky; bottom: 0; z-index: 10; margin: var(--space-16) calc(-1 * var(--space-16)) 0;
  padding: var(--space-8) var(--space-16) calc(var(--space-12) + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--outline); }
.pt-bar__label { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: var(--space-6); }
.pt-bar__row { display: flex; gap: var(--space-8); align-items: center; }
.pt-bar__row > .mo-btn { min-height: 48px; }
.pt-bar__row > .mo-btn:first-child { flex: 1; }
.pt-bar__more { display: inline-flex; align-items: center; gap: var(--space-4); }
.pt-bar__note { margin-top: var(--space-6); }

/* Search */
.pt-search { display: flex; align-items: flex-end; gap: var(--space-8); }
.pt-search > .mo-field { flex: 1; min-width: 0; }
.pt-search__scan { display: inline-flex; align-items: center; gap: var(--space-4); min-height: 48px; }

/* Discover (discover.js, map.js): the map fills the screen; search, avatar and filter chips float
   on top; the station sheet sits at the bottom. The map box is its own stacking context, so
   Leaflet's panes (z-index up to 1000) stay under the overlays. */
.pt-disc { position: fixed; inset: 0; overflow: hidden; }
.pt-is-staging .pt-disc { top: 24px; }
.pt-disc__map { position: absolute; inset: 0; z-index: 0; background: var(--surface-muted, #eef1ee); }
.pt-map { width: 100%; height: 100%; }
.pt-disc__top { position: absolute; top: 0; left: 0; right: 0; z-index: 10; padding: var(--space-8) var(--space-12) 0;
  pointer-events: none; }
.pt-disc__top > * { pointer-events: auto; }
.pt-disc__bar { display: flex; align-items: center; gap: var(--space-8); max-width: 640px; margin: 0 auto; }
.pt-disc__search { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-8); min-height: 48px;
  padding: 0 var(--space-16); border-radius: 24px; background: var(--surface); color: var(--text-muted);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); text-decoration: none; font-size: 15px; }
.pt-disc__search:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pt-disc__bar .pt-avatar { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); }
.pt-chips { display: flex; gap: var(--space-6); overflow-x: auto; padding-bottom: var(--space-4); scrollbar-width: none; }
.pt-chips--float { max-width: 640px; margin: var(--space-8) auto 0; }
.pt-chips:not(.pt-chips--float) .pt-chip { box-shadow: none; }
.pt-chips::-webkit-scrollbar { display: none; }
.pt-chip { flex: none; min-height: 44px; padding: 0 var(--space-14); border: 1px solid var(--outline); border-radius: 20px;
  background: var(--surface); color: var(--text-primary); font: 500 14px/1 var(--font-sans); cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
.pt-chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pt-chip.is-on::before { content: '✓ '; }
.pt-chip:disabled { color: var(--text-muted); cursor: default; }
.pt-chip--clear { color: var(--accent); }
.pt-chip__n { display: inline-block; min-width: 20px; margin-left: var(--space-6); padding: 2px 6px; border-radius: 10px;
  background: var(--status-neutral-bg); color: var(--text-primary); font: 700 12px/1.2 var(--font-sans); text-align: center; }
.pt-chip.is-on .pt-chip__n { background: rgba(255, 255, 255, 0.25); color: #fff; }
.pt-chip.is-none { color: var(--text-muted); }
.pt-chip.is-none .pt-chip__n { font-weight: 500; color: var(--text-muted); }
.pt-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pt-disc__locate { position: absolute; right: var(--space-12); z-index: 10; width: 48px; height: 48px; border: 0;
  border-radius: 50%; background: var(--surface); color: var(--text-muted); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  display: flex; align-items: center; justify-content: center; cursor: pointer; transition: bottom 0.2s; }
.pt-disc__locate.is-on { color: var(--accent); }
.pt-disc__locate:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Station pins and the matching list badges: the score on a disc, tier by colour AND number. */
.leaflet-marker-icon.pt-pin { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.pt-pin { display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); font: 700 13px/1 var(--font-sans); }
.pt-pin--unknown, .pt-pin--zero { background: var(--status-neutral-bg); color: var(--status-neutral-fg); }
.pt-pin--low { background: var(--status-updated-fg); color: #fff; }
.pt-pin--mid { background: #d18a00; color: #fff; }
.pt-pin--high { background: var(--status-failed-fg); color: #fff; }
.pt-pin--count { background: var(--accent); color: #fff; }
.pt-pin.is-selected { border-width: 3px; border-color: var(--text-primary); font-size: 15px; }
.pt-badge { flex: none; width: 34px; height: 34px; }
.pt-me { fill: var(--accent); fill-opacity: 1; stroke: #fff; stroke-width: 3; }
.pt-me__acc { fill: var(--accent); fill-opacity: 0.12; stroke: var(--accent); stroke-opacity: 0.3; stroke-width: 1; }

/* The station sheet */
.pt-dsheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; flex-direction: column;
  max-width: 640px; margin: 0 auto; background: var(--screen-bg); border-radius: 16px 16px 0 0;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.2); transition: height 0.2s ease-out; }
.pt-dsheet.is-dragging { transition: none; }
.pt-dsheet__grip { flex: none; display: flex; justify-content: center; align-items: center; height: 28px; cursor: grab;
  touch-action: none; }
.pt-dsheet__grip:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pt-dsheet__bar { width: 40px; height: 5px; border-radius: 3px; background: var(--outline); }
.pt-dsheet__body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 var(--space-16) calc(var(--space-16) + env(safe-area-inset-bottom)); }
.pt-dsheet__body > * + * { margin-top: var(--space-12); }
.pt-dsheet__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); }
.pt-peek { min-height: 120px; }
.pt-peek__head { display: flex; gap: var(--space-12); align-items: flex-start; margin-bottom: var(--space-8); }
.pt-peek__text { flex: 1; min-width: 0; }
.pt-peek__name { font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-peek__open { text-decoration: none; min-height: 48px; display: flex; align-items: center; justify-content: center; }
.pt-dlist { overflow: hidden; }
.pt-drow { display: flex; align-items: center; gap: var(--space-12); min-height: 60px; padding: var(--space-8) var(--space-14);
  border-top: 1px solid var(--divider); color: inherit; text-decoration: none; }
.pt-drow:first-child { border-top: 0; }
.pt-drow:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pt-drow__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pt-drow__text .pt-pick__name { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-drow__dist { flex: none; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.leaflet-container { font-family: var(--font-sans); }

/* Object screens (details.js ObjectView): previous / next through the station's bikes or docks */
.pt-step { display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); }
.pt-step__btn { min-height: 48px; min-width: 112px; }
.pt-status { display: inline-block; margin-top: var(--space-4); }

/* Account (account.js): placeholders for what is to come */
.is-soon { opacity: 0.6; }
div.pt-pick.is-soon { cursor: default; }
/* The header's right side (shell.js AppHeader): extra items, then search and avatar, in one row. */
.pt-top .mo-header__aside { display: flex; align-items: center; gap: var(--space-2); }
.pt-top .mo-header__aside div + div { font-size: inherit; }
