/* Mobile app styles (apps/mobile.html). MOBILE_SPEC.md §5–§12.
 *
 * Light theme only. Colours/fonts come from 00-tokens.css (loaded first).
 * Touch targets ≥ 44px; safe-area insets respected on the app bars.
 * The lower half styles markup produced by the SHARED panel builders
 * (project-info.js, credits.js, proponent.js, events.js) for the narrow screen.
 */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--ce-font);
  color: var(--ce-navy);
  background: var(--ce-bg-muted);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
html.m-scroll-locked, html.m-scroll-locked body { overflow: hidden; }

:root {
  --m-appbar-h: 56px;
  --m-nav-h: 60px;
  --m-safe-top: env(safe-area-inset-top, 0px);
  --m-safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- Generic controls ---------- */
.m-iconbtn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: var(--ce-touch); height: var(--ce-touch);
  padding: 0 var(--ce-space-2);
  border: 0; background: transparent; border-radius: var(--ce-radius-pill);
  cursor: pointer; flex-shrink: 0;
}
.m-iconbtn:active { background: var(--ce-bg-muted); }
.m-iconbtn svg { width: 24px; height: 24px; fill: currentColor; }
.m-badge {
  position: absolute; top: 4px; right: 2px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--ce-blue); color: #fff;
  font-size: 11px; font-weight: bold; line-height: 18px; text-align: center;
}
.m-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--ce-space-2);
  min-height: var(--ce-touch); padding: 0 var(--ce-space-4);
  border-radius: var(--ce-radius-pill); border: 1px solid var(--ce-border);
  background: var(--ce-bg); color: var(--ce-navy); font-weight: bold; font-size: 15px;
  cursor: pointer; text-decoration: none;
}
.m-btn svg { width: 20px; height: 20px; fill: currentColor; }
.m-btn--primary { background: var(--ce-navy); border-color: var(--ce-navy); color: #fff; }
.m-btn--blue { background: var(--ce-blue); border-color: var(--ce-blue); color: #fff; }
.m-btn--block { width: 100%; }
.m-btn--ghost { border-color: transparent; background: transparent; color: var(--ce-blue); }
.m-btn:disabled { opacity: .6; }

/* ---------- App bar (Explore) ---------- */
.m-appbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--ce-space-1);
  min-height: calc(var(--m-appbar-h) + var(--m-safe-top));
  padding: var(--m-safe-top) var(--ce-space-2) 0;
  background: var(--ce-bg);
  box-shadow: 0 1px 0 var(--ce-border);
}
.m-logo { display: inline-flex; align-items: center; height: var(--ce-touch); padding: 0 4px; flex-shrink: 0; }
.m-logo img { width: 32px; height: 32px; }
.m-search {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 4px 0 12px;
  background: var(--ce-bg-muted); border-radius: var(--ce-radius-pill);
}
.m-search svg { width: 18px; height: 18px; fill: var(--ce-text-subtle); flex-shrink: 0; }
.m-search input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; background: transparent; outline: none;
  font-size: 16px; /* ≥16px stops iOS zoom-on-focus */
  color: var(--ce-navy);
}
.m-search input::-webkit-search-cancel-button { display: none; }
.m-search-clear {
  width: 32px; height: 32px; border: 0; background: transparent; border-radius: 50%;
  font-size: 20px; line-height: 1; color: var(--ce-text-subtle); cursor: pointer;
}
.m-title { flex: 1; margin: 0; padding: 0 var(--ce-space-2); font-size: 20px; }

/* ---------- Sub-bar: filter pills + count/share, pinned under the app bar ---------- */
.m-subbar {
  position: sticky; top: calc(var(--m-appbar-h) + var(--m-safe-top)); z-index: 25;
  background: var(--ce-bg-muted);
  box-shadow: 0 1px 0 var(--ce-border);
  margin-bottom: var(--ce-space-3);
}

/* ---------- Filter pills ---------- */
.m-pills {
  display: flex; gap: var(--ce-space-2); overflow-x: auto;
  padding: var(--ce-space-2) var(--ce-space-3);
  background: var(--ce-bg);
  box-shadow: 0 1px 0 var(--ce-border);
  scrollbar-width: none;
}
.m-pills::-webkit-scrollbar { display: none; }
.m-pill {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
  height: 32px; padding: 0 4px 0 12px;
  border-radius: var(--ce-radius-pill);
  background: #e6f2fc; color: var(--ce-navy); font-size: 13px; font-weight: bold;
  border: 1px solid #bcdbf3; white-space: nowrap;
}
.m-pill button {
  width: 28px; height: 28px; border: 0; background: transparent; border-radius: 50%;
  font-size: 17px; line-height: 1; cursor: pointer; color: var(--ce-navy);
}
.m-pill-clearall {
  flex-shrink: 0; height: 32px; padding: 0 10px; border: 0; background: transparent;
  color: var(--ce-blue); font-weight: bold; font-size: 13px; cursor: pointer; white-space: nowrap;
}

/* ---------- List header + list ---------- */
.m-list-header {
  display: flex; align-items: center; justify-content: space-between; gap: var(--ce-space-2);
  padding: var(--ce-space-2) var(--ce-space-2) var(--ce-space-2) var(--ce-space-4);
  font-size: 14px; color: var(--ce-text-muted);
}
.m-list-header strong { color: var(--ce-navy); font-size: 15px; }
.m-list {
  display: flex; flex-direction: column; gap: var(--ce-space-3);
  padding: 0 var(--ce-space-3) var(--ce-space-4);
}
.m-view { padding-bottom: calc(var(--m-nav-h) + var(--m-safe-bottom) + var(--ce-space-4)); min-height: 100vh; }

/* ---------- Project card ---------- */
.m-card {
  position: relative;
  background: var(--ce-bg); border-radius: var(--ce-radius);
  box-shadow: var(--ce-shadow); overflow: hidden;
  cursor: pointer;
  content-visibility: auto; contain-intrinsic-size: auto 290px;
}
.m-card:active { transform: scale(.995); }
.m-cover { position: relative; aspect-ratio: 2 / 1; background: #1d2433; overflow: hidden; }
.m-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.m-cover-foot {
  position: absolute; left: var(--ce-space-2); right: var(--ce-space-2); bottom: var(--ce-space-2);
  display: flex; align-items: center; justify-content: space-between; gap: var(--ce-space-2);
}
/* Nature Accreditation pill (natureBadgeHtml, methods.js) */
.nature-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px 4px 8px; border: 1.5px solid #fff; border-radius: var(--ce-radius-pill);
  background: rgba(34, 85, 48, .75); color: #fff;
  font-size: 12px; font-weight: bold; white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,.3); backdrop-filter: blur(2px);
}
.nature-badge svg { width: 14px; height: 14px; flex-shrink: 0; fill: #fff; }
.m-nature { position: absolute; top: var(--ce-space-2); left: var(--ce-space-2); }
.m-method-pill {
  min-width: 0;
  padding: 4px 10px; border-radius: var(--ce-radius-pill);
  color: #fff; /* white text on every method colour */
  font-size: 12px; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.m-card-id {
  flex-shrink: 0;
  padding: 4px 8px; border-radius: var(--ce-radius-pill);
  background: rgba(20, 28, 45, .72); color: #fff;
  font-size: 12px; font-weight: bold; letter-spacing: .02em;
}
.m-heart {
  position: absolute; top: 6px; right: 6px;
  width: var(--ce-touch); height: var(--ce-touch);
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: rgba(255,255,255,.92); cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.m-heart svg { width: 22px; height: 22px; fill: none; stroke: var(--ce-navy); stroke-width: 2; }
.m-heart[aria-pressed="true"] svg { fill: var(--ce-red-strong); stroke: var(--ce-red-strong); }
.m-card-body { padding: var(--ce-space-3) var(--ce-space-4) var(--ce-space-4); }
.m-card-name {
  margin: 0 0 6px; font-size: 16px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.m-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--ce-text-muted); }
.m-card-meta b { color: var(--ce-navy); }
.m-card-area { font-weight: bold; color: var(--ce-navy); }
/* State + ACTIVE/REVOKED pills (cards, detail header) */
.m-status, .m-state-pill {
  display: inline-block; padding: 2px 8px; border-radius: var(--ce-radius-pill);
  font-size: 11px; font-weight: bold; line-height: 16px; text-transform: uppercase; letter-spacing: .04em;
}
.m-status--active { background: var(--ce-green-strong); color: #fff; }
.m-status--revoked { background: var(--ce-red-strong); color: #fff; }
.m-detail-badges { display: inline-flex; gap: 6px; }
.m-alert-badge {
  display: inline-block; margin-top: var(--ce-space-2);
  padding: 4px 10px; border-radius: var(--ce-radius-pill);
  background: #fff3cd; color: #856404; font-size: 12px; font-weight: bold;
}

/* Skeletons */
.m-card--skeleton { cursor: default; }
.m-skel { background: linear-gradient(90deg, #eceff3 25%, #f6f7f9 50%, #eceff3 75%); background-size: 200% 100%; animation: m-shimmer 1.2s infinite; border-radius: 6px; }
.m-card--skeleton .m-cover { background: none; }
.m-card--skeleton .m-cover .m-skel { position: absolute; inset: 0; border-radius: 0; }
.m-skel-line { height: 14px; margin-top: 8px; }
@keyframes m-shimmer { to { background-position: -200% 0; } }

/* Empty / message states */
.m-empty {
  margin: var(--ce-space-5) var(--ce-space-4); padding: var(--ce-space-5) var(--ce-space-4);
  text-align: center; color: var(--ce-text-muted);
  background: var(--ce-bg); border-radius: var(--ce-radius);
}
.m-empty p { margin: 0 0 var(--ce-space-4); font-size: 16px; color: var(--ce-navy); }

/* ---------- Bottom nav ---------- */
.m-bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex;
  height: calc(var(--m-nav-h) + var(--m-safe-bottom));
  padding-bottom: var(--m-safe-bottom);
  background: var(--ce-bg); box-shadow: 0 -1px 0 var(--ce-border);
}
.m-navbtn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 0; background: transparent; cursor: pointer;
  font-size: 11px; font-weight: bold; color: var(--ce-text-subtle);
  position: relative;
}
.m-navbtn svg { width: 24px; height: 24px; fill: currentColor; }
.m-navbtn[aria-current="page"] { color: var(--ce-blue); }
.m-navbtn .m-badge { top: 4px; right: calc(50% - 22px); background: var(--ce-red-strong); }

/* ---------- Overlays: detail, filter modal ---------- */
.m-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column;
  background: var(--ce-bg);
}
.m-overlay-scroll { flex: 1; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.m-detail { animation: m-slide-in .22s ease-out; }
@keyframes m-slide-in { from { transform: translateX(100%); } to { transform: none; } }
.m-detail.is-swiping { box-shadow: -8px 0 24px rgba(0,0,0,.18); }
.m-detail .m-appbar { position: relative; }
.m-back { display: inline-flex; align-items: center; gap: 2px; padding: 0 var(--ce-space-3) 0 var(--ce-space-1); font-weight: bold; color: var(--ce-blue); font-size: 16px; }
.m-back span { font-size: 26px; line-height: 1; margin-top: -2px; }
.m-spacer { flex: 1; }
.m-detail-watch[aria-pressed="true"] svg, .m-watch-btn[aria-pressed="true"] svg { fill: var(--ce-red-strong); stroke: var(--ce-red-strong); }
.m-detail-watch svg, .m-watch-btn svg { fill: none; stroke: currentColor; stroke-width: 2; }

.m-detail-cover { position: relative; aspect-ratio: 2 / 1; background: #1d2433; }
.m-detail-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-viewmap {
  position: absolute; right: var(--ce-space-3); bottom: var(--ce-space-3);
  min-height: 40px; padding: 0 14px; font-size: 14px;
  background: rgba(255,255,255,.95); border: 0; box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.m-detail-head { padding: var(--ce-space-4) var(--ce-space-4) 0; }
.m-detail-head h1 { margin: 0 0 6px; font-size: 21px; line-height: 1.25; }
.m-detail-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 14px; color: var(--ce-text-muted); }
.m-detail-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--ce-space-2); }
.m-detail-pills span { padding: 4px 10px; border-radius: var(--ce-radius-pill); font-size: 12px; font-weight: bold; color: #fff; }
.m-alert {
  margin: var(--ce-space-3) var(--ce-space-4) 0; padding: var(--ce-space-3);
  border-radius: var(--ce-radius-sm); background: #fff3cd; color: #856404; font-size: 14px;
}
.m-alert strong { display: block; margin-bottom: 4px; }
.m-alert button { margin-top: var(--ce-space-2); min-height: 36px; padding: 0 12px; font-size: 13px; border-color: #e0c56e; background: #fffaf0; }
.m-actions { display: flex; gap: var(--ce-space-2); padding: var(--ce-space-4); }
.m-actions .m-btn { flex: 1; }

.m-tabs {
  position: sticky; top: 0; z-index: 5;
  display: flex; background: var(--ce-bg); box-shadow: 0 1px 0 var(--ce-border);
  overflow-x: auto; scrollbar-width: none;
}
.m-tabs::-webkit-scrollbar { display: none; }
.m-tab {
  flex: 1 0 auto; min-height: 48px; padding: 0 var(--ce-space-3);
  border: 0; background: transparent; cursor: pointer; white-space: nowrap;
  font-size: 14px; font-weight: bold; color: var(--ce-text-subtle);
  border-bottom: 3px solid transparent;
}
.m-tab[aria-selected="true"] { color: var(--ce-navy); border-bottom-color: var(--ce-blue); }
.m-tab.is-locked { color: #a0a7b4; }
.m-tabpanel { padding: var(--ce-space-4); min-height: 50vh; font-size: 15px; line-height: 1.45; }

.m-segmented { display: flex; padding: 3px; margin-bottom: var(--ce-space-4); background: var(--ce-bg-muted); border-radius: var(--ce-radius-pill); }
.m-segmented input { position: absolute; opacity: 0; pointer-events: none; }
.m-segmented label, .m-segmented button {
  flex: 1; display: flex; align-items: center; justify-content: center;
  min-height: 38px; border: 0; border-radius: var(--ce-radius-pill); background: transparent;
  font-size: 14px; font-weight: bold; color: var(--ce-text-muted); cursor: pointer;
}
.m-segmented input:checked + label,
.m-segmented button[aria-pressed="true"] { background: var(--ce-bg); color: var(--ce-navy); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.m-segmented .hidden { display: none; }
.m-proponent-title { margin: 0 0 var(--ce-space-3); font-size: 18px; line-height: 1.3; }
.m-proponent-title:empty { display: none; }
.m-participant-help { margin: var(--ce-space-5) 0 0; padding-top: var(--ce-space-4); border-top: 1px solid var(--ce-border-soft); font-size: 13px; line-height: 1.45; color: var(--ce-text-muted); }
.m-participant-help dt { font-weight: bold; color: var(--ce-navy); }
.m-participant-help dd { margin: 2px 0 var(--ce-space-3); }

.m-summary-cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ce-space-2); margin-bottom: var(--ce-space-4); }
.m-summary-card { padding: var(--ce-space-3); border-radius: var(--ce-radius-sm); background: var(--ce-bg-soft); border: 1px solid var(--ce-border-soft); }
.m-summary-card .summary-label { font-size: 12px; color: var(--ce-text-muted); }
.m-summary-card .summary-value { margin-top: 4px; font-size: 20px; font-weight: bold; }
#credits-chart-container { position: relative; height: 260px; }
/* Credits chart key (credits.js applyCompactCreditsLayout); swatches match the chart colours */
.m-chart-key { margin-top: var(--ce-space-2); font-size: 13px; line-height: 1.4; }
.m-chart-key:empty { display: none; }
.m-chart-key .m-key-note { margin: 0 0 var(--ce-space-2); color: var(--ce-text-muted); }
.m-chart-key ul { display: grid; grid-template-columns: 1fr 1fr; gap: 6px var(--ce-space-3); margin: 0; padding: 0; list-style: none; }
.m-chart-key li { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.m-chart-key li:nth-child(n+3) { grid-column: 1 / -1; }
.m-key-label { font-weight: bold; }
.m-key-value { color: var(--ce-text-muted); }
.m-key-swatch { flex: none; width: 12px; height: 12px; border-radius: 2px; }
.m-key-swatch--k { background: #0984e3; }
.m-key-swatch--nk { background: #25385B; }
.m-key-swatch--reg { width: 3px; height: 14px; background: #2ecc71; }
.m-key-swatch--cred { background: rgba(230, 126, 34, 0.18); border-left: 2px solid #e67e22; border-right: 2px solid #e67e22; }
.m-key-swatch--revoked { width: 0; height: 14px; border-left: 3px dashed #c0392b; border-radius: 0; }
#credits-loading-indicator, .m-spinner {
  width: 32px; height: 32px; margin: 0 auto;
  border: 3px solid var(--ce-border); border-top-color: var(--ce-blue); border-radius: 50%;
  animation: m-spin .8s linear infinite;
}
#credits-loading-indicator { position: absolute; top: 50%; left: 50%; margin: -16px 0 0 -16px; }
.m-loading { display: flex; justify-content: center; padding: var(--ce-space-5); }
@keyframes m-spin { to { transform: rotate(360deg); } }

.m-locked-panel { text-align: center; padding: var(--ce-space-5) var(--ce-space-3); color: var(--ce-text-muted); }
.m-locked-panel p { margin: 0 0 var(--ce-space-4); }

/* Filter modal */
.m-modal { z-index: 80; }
.m-modal-head { display: flex; align-items: center; gap: var(--ce-space-2); padding: var(--m-safe-top) var(--ce-space-2) 0; min-height: calc(var(--m-appbar-h) + var(--m-safe-top)); box-shadow: 0 1px 0 var(--ce-border); }
.m-modal-head h2 { flex: 1; margin: 0; font-size: 18px; text-align: center; }
.m-modal-foot { padding: var(--ce-space-3) var(--ce-space-4) calc(var(--ce-space-3) + var(--m-safe-bottom)); box-shadow: 0 -1px 0 var(--ce-border); background: var(--ce-bg); }
.m-acc { border-bottom: 1px solid var(--ce-border); }
.m-acc > summary {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 56px; padding: 0 var(--ce-space-4); cursor: pointer; list-style: none;
  font-weight: bold; font-size: 16px;
}
.m-acc > summary::-webkit-details-marker { display: none; }
.m-acc > summary .m-acc-val { margin-left: auto; margin-right: var(--ce-space-2); font-weight: normal; font-size: 13px; color: var(--ce-blue); }
.m-chev { width: 10px; height: 10px; border-right: 2px solid var(--ce-text-subtle); border-bottom: 2px solid var(--ce-text-subtle); transform: rotate(45deg); transition: transform .15s; flex-shrink: 0; }
.m-acc[open] > summary .m-chev { transform: rotate(-135deg); }
.m-acc-body { padding: 0 var(--ce-space-4) var(--ce-space-4); }
.m-chips { display: flex; flex-wrap: wrap; gap: var(--ce-space-2); }
.m-chip { position: relative; }
.m-chip input { position: absolute; opacity: 0; pointer-events: none; }
.m-chip span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px;
  border-radius: var(--ce-radius-pill); border: 1px solid var(--ce-border);
  font-size: 14px; font-weight: bold; cursor: pointer; background: var(--ce-bg);
}
.m-chip input:checked + span { background: var(--ce-navy); border-color: var(--ce-navy); color: #fff; }
.m-chip input:focus-visible + span { outline: 2px solid var(--ce-blue); outline-offset: 2px; }
.m-range { display: flex; align-items: center; gap: var(--ce-space-2); margin-top: var(--ce-space-3); }
.m-range label { flex: 1; font-size: 12px; color: var(--ce-text-muted); }
.m-range input, .m-range select {
  display: block; width: 100%; margin-top: 4px; min-height: 44px; padding: 0 10px;
  border: 1px solid var(--ce-border); border-radius: var(--ce-radius-sm); background: var(--ce-bg);
  font-size: 16px; color: var(--ce-navy);
}
.m-check { display: flex; align-items: center; gap: var(--ce-space-3); min-height: 48px; font-size: 15px; cursor: pointer; }
.m-check input { width: 22px; height: 22px; margin: 0; accent-color: var(--ce-navy); flex-shrink: 0; }
.m-check.is-locked { color: #a0a7b4; }
.m-tree { list-style: none; margin: 0; padding: 0; }
.m-tree-row { display: flex; align-items: center; }
.m-tree-row .m-check { flex: 1; }
.m-tree-row .m-iconbtn .m-chev { transform: rotate(45deg); }
.m-tree li.is-open > .m-tree-row .m-chev { transform: rotate(-135deg); }
.m-tree ul { list-style: none; margin: 0; padding: 0 0 0 34px; }
.m-swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.m-hint { font-size: 12px; color: var(--ce-text-muted); margin: 4px 0 0; }
.m-subhead { margin: var(--ce-space-4) 0 var(--ce-space-2); font-size: 13px; font-weight: bold; color: var(--ce-text-muted); }
.m-acc-body > .m-subhead:first-child { margin-top: 0; }
.m-acc-body > .m-subhead + .m-range { margin-top: 0; }
.m-suggest {
  list-style: none; margin: var(--ce-space-2) 0 0; padding: 0; max-height: 240px; overflow-y: auto;
  border: 1px solid var(--ce-border); border-radius: var(--ce-radius); background: var(--ce-bg);
}
.m-suggest[hidden] { display: none; }
.m-suggest li + li { border-top: 1px solid var(--ce-border); }
.m-suggest-item {
  display: flex; align-items: center; justify-content: space-between; gap: var(--ce-space-2); width: 100%;
  min-height: 44px; padding: 8px 12px; border: 0; background: transparent; text-align: left;
  font-size: 15px; color: var(--ce-text); cursor: pointer;
}
.m-suggest-item:active { background: var(--ce-bg-muted); }
.m-suggest-item.is-lead { font-weight: bold; }
.m-suggest-item img { height: 20px; width: auto; flex: none; }
.m-suggest-empty { padding: 10px 12px; color: var(--ce-text-muted); font-size: 14px; }
.m-chips.is-locked .m-chip span { color: #a0a7b4; background: var(--ce-bg-muted); cursor: not-allowed; }
.m-unlock { min-height: 36px; margin-top: var(--ce-space-2); padding: 0; font-size: 13px; }

/* Bottom sheets */
.m-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(20, 28, 45, .45); animation: m-fade .15s; }
@keyframes m-fade { from { opacity: 0; } }
.m-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 75;
  max-height: 85vh; overflow-y: auto;
  padding: var(--ce-space-2) var(--ce-space-4) calc(var(--ce-space-4) + var(--m-safe-bottom));
  background: var(--ce-bg); border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,.2);
  animation: m-sheet-up .2s ease-out;
}
@keyframes m-sheet-up { from { transform: translateY(100%); } }
.m-sheet-grip { width: 40px; height: 4px; margin: 0 auto var(--ce-space-3); border-radius: 2px; background: var(--ce-border); }
.m-sheet h2 { margin: 0 0 var(--ce-space-2); font-size: 18px; }
.m-sheet p { margin: 0 0 var(--ce-space-4); color: var(--ce-text-muted); line-height: 1.45; }
.m-sheet .m-btn + .m-btn { margin-top: var(--ce-space-2); }
.m-sort-opt {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  min-height: 52px; padding: 0 var(--ce-space-1); border: 0; border-bottom: 1px solid var(--ce-border-soft);
  background: transparent; font-size: 16px; text-align: left; cursor: pointer;
}
.m-sort-opt[aria-checked="true"] { color: var(--ce-blue); font-weight: bold; }
.m-sort-opt[aria-checked="true"]::after { content: "✓"; }

/* Toast */
.m-toast {
  position: fixed; left: 50%; bottom: calc(var(--m-nav-h) + var(--m-safe-bottom) + 16px); z-index: 90;
  transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 10px 16px; border-radius: var(--ce-radius-pill);
  background: var(--ce-navy); color: #fff; font-size: 14px; box-shadow: var(--ce-shadow);
  touch-action: none; user-select: none; -webkit-user-select: none;
  transition: opacity .15s;
}
.m-toast--action { display: flex; align-items: center; gap: var(--ce-space-3); width: max-content; padding: 4px 6px 4px 16px; }
.m-toast-action {
  min-height: 36px; padding: 0 14px; border: 0; border-radius: var(--ce-radius-pill);
  background: rgba(255,255,255,.16); color: #fff; font-weight: bold; font-size: 14px; cursor: pointer;
  text-transform: uppercase; letter-spacing: .04em;
}

/* ---------- Map tab ---------- */
#view-map { padding-bottom: 0; }
.m-map {
  position: fixed; left: 0; right: 0; top: 0;
  bottom: calc(var(--m-nav-h) + var(--m-safe-bottom));
  background: #262626;
}
.m-basemap {
  position: fixed; right: var(--ce-space-3); top: calc(var(--m-safe-top) + 56px); z-index: 35;
  margin: 0; background: var(--ce-bg); box-shadow: var(--ce-shadow);
}
.m-basemap[hidden] { display: none; }
.m-basemap button { flex: 0 0 auto; min-height: 32px; padding: 0 12px; font-size: 13px; }
.m-basemap button[aria-pressed="true"] { background: var(--ce-navy); color: #fff; }
.m-map-status {
  position: fixed; left: 50%; top: calc(var(--m-safe-top) + 12px); z-index: 35; transform: translateX(-50%);
  padding: 8px 14px; border-radius: var(--ce-radius-pill); background: var(--ce-bg); box-shadow: var(--ce-shadow);
  font-size: 13px; font-weight: bold; white-space: nowrap;
}
.m-preview {
  position: fixed; left: var(--ce-space-3); right: var(--ce-space-3); z-index: 45;
  bottom: calc(var(--m-nav-h) + var(--m-safe-bottom) + var(--ce-space-3));
  display: flex; gap: var(--ce-space-3); align-items: center;
  padding: var(--ce-space-2); border-radius: var(--ce-radius);
  background: var(--ce-bg); box-shadow: 0 4px 16px rgba(0,0,0,.25);
  cursor: pointer; animation: m-sheet-up .2s ease-out;
}
.m-preview img { width: 104px; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: #1d2433; }
.m-preview-body { flex: 1; min-width: 0; }
.m-preview-body h3 { margin: 0 0 4px; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-preview-body div { font-size: 12px; color: var(--ce-text-muted); }
.m-preview-close { align-self: flex-start; }
.m-preview { flex-wrap: wrap; }
.m-preview-locs {
  flex-basis: 100%; display: flex; align-items: center; gap: 6px; min-width: 0;
  padding-top: var(--ce-space-2); border-top: 1px solid var(--ce-border-soft); cursor: default;
}
.m-preview-locs-label { flex-shrink: 0; font-size: 12px; font-weight: bold; color: var(--ce-text-muted); white-space: nowrap; }
.m-loc-pills { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.m-loc-pills::-webkit-scrollbar { display: none; }
.m-loc-pill, .m-loc-step {
  flex-shrink: 0; min-width: 36px; min-height: 32px; padding: 0 10px;
  border-radius: var(--ce-radius-pill); border: 1px solid var(--ce-border);
  background: var(--ce-bg-soft); color: var(--ce-blue); font-weight: bold; font-size: 14px; cursor: pointer;
}
.m-loc-step { padding: 0; font-size: 18px; line-height: 1; color: var(--ce-navy); }
.m-loc-pill[aria-pressed="true"] { background: var(--ce-navy); border-color: var(--ce-navy); color: #fff; }

/* ---------- Account ---------- */
.m-section { margin: var(--ce-space-3); padding: var(--ce-space-4); background: var(--ce-bg); border-radius: var(--ce-radius); }
.m-section h2 { margin: 0 0 var(--ce-space-2); font-size: 16px; }
.m-kv { display: flex; justify-content: space-between; gap: var(--ce-space-3); padding: 10px 0; border-bottom: 1px solid var(--ce-border-soft); font-size: 15px; }
.m-kv:last-child { border-bottom: 0; }
.m-kv span:first-child { color: var(--ce-text-muted); }
.m-kv span:last-child { font-weight: bold; text-align: right; word-break: break-all; }
.m-linkrow { display: flex; align-items: center; justify-content: space-between; min-height: 48px; color: var(--ce-navy); text-decoration: none; font-size: 15px; border: 0; background: none; width: 100%; padding: 0; cursor: pointer; }
.m-linkrow + .m-linkrow { border-top: 1px solid var(--ce-border-soft); }
.m-linkrow + .m-attributions { border-top: 1px solid var(--ce-border-soft); }
.m-attributions summary { list-style: none; }
.m-attributions summary::-webkit-details-marker { display: none; }
.m-attributions summary span { transition: transform .15s ease; }
.m-attributions[open] summary span { transform: rotate(90deg); }
.m-attributions ul { margin: 0 0 var(--ce-space-2); padding-left: 18px; font-size: 13px; line-height: 1.55; color: var(--ce-text-muted); }
.m-attributions li + li { margin-top: 4px; }
.m-attributions p { margin: 0 0 var(--ce-space-2); font-size: 12px; font-style: italic; color: var(--ce-text-muted); }
.m-attributions a { color: var(--ce-blue); }
.m-legal { margin: 0 var(--ce-space-3) var(--ce-space-4); padding: 0 var(--ce-space-1); font-size: 12px; line-height: 1.5; color: var(--ce-text-muted); text-align: center; }

/* =====================================================================
 * Shared panel markup (project-info.js / credits.js / proponent.js /
 * events.js) — restyled as stacked label/value rows for a phone.
 * ===================================================================== */
.info-grid, .prop-grid { display: block; }
.info-grid > .label, .prop-grid > .label {
  margin-top: var(--ce-space-4);
  font-size: 12px; font-weight: bold; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ce-text-muted);
}
.info-grid > .label + div, .prop-grid > .label + div { margin-top: 4px; overflow-wrap: anywhere; }
.info-grid > div[style*="display: flex"] { flex-wrap: wrap; gap: 6px; }
.grid-divider { margin: var(--ce-space-4) 0 0; border: 0; border-top: 1px solid var(--ce-border); }
.info-grid a { color: var(--ce-blue); }
.share-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border-radius: var(--ce-radius-pill); border: 1px solid var(--ce-border);
  background: var(--ce-bg); color: var(--ce-navy); font-weight: bold; font-size: 13px;
}
.pill-container { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-label {
  display: inline-block; padding: 4px 10px; border-radius: var(--ce-radius-pill);
  color: #fff; font-size: 12px; font-weight: bold;
}
.method-pill-group { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.cluster-button-container { display: flex; flex-wrap: wrap; gap: 6px; }
.cluster-pill-button, .postcode-pill-button {
  min-width: 40px; min-height: 36px; padding: 0 12px;
  border-radius: var(--ce-radius-pill); border: 1px solid var(--ce-border);
  background: var(--ce-bg-soft); font-weight: bold; font-size: 14px;
}
.cluster-pill-button { color: var(--ce-blue); cursor: pointer; }
.postcode-pill-button { pointer-events: none; color: var(--ce-navy); }
.expandable-content { display: flex; align-items: flex-start; flex-wrap: wrap; }
.read-more-container { overflow: hidden; line-height: 1.4em; max-height: 1.4em; transition: max-height .15s ease-out; }
.read-more-container.start-collapsed { max-height: 0; }
/* after .start-collapsed so it wins; toggleReadMore() (project-info.js) animates it */
.read-more-container.expanded { flex-basis: 100%; max-height: none; }
.read-more-btn {
  flex-shrink: 0; min-height: 36px; padding: 0 4px; border: 0; background: none;
  color: var(--ce-blue); font-weight: bold; font-size: 14px; cursor: pointer;
}
/* proponent.js hard-codes 300px chart boxes; let them use the full width */
.prop-grid div[style*="width:300px"], .prop-grid div[style*="width: 300px"] { width: 100% !important; max-width: 100%; }
.prop-grid canvas { max-width: 100%; }
.project-events-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: var(--ce-space-2); }
.project-events-table th, .project-events-table td { padding: 8px 6px; border-bottom: 1px solid var(--ce-border-soft); text-align: left; vertical-align: top; }
.project-events-table th { font-size: 11px; text-transform: uppercase; color: var(--ce-text-muted); }
#events_panel_result table { table-layout: fixed; }
#events_panel_result h3 { font-size: 16px !important; }
.loading-logo { animation: m-spin 1.2s linear infinite; }
#credit-market-container { margin-bottom: var(--ce-space-3); font-size: 14px; }

/* Leaflet controls: comfortable touch size */
.leaflet-touch .leaflet-bar a { width: 40px; height: 40px; line-height: 40px; }
