:root {

  --surface:        #f2f3f1;
  --surface-raised: #ffffff;
  --surface-sunk:   #e6e8e5;
  --hairline:       #cfd3ce;

  --ink:            #14171a;
  --ink-2:          #4a5157;
  --ink-3:          #767f86;

  --pin-both:       #6a1b9a;
  --pin-inside:     #c62828;
  --pin-outside:    #2e7d32;
  --pin-info:       #1565c0;
  --pin-none:       #b58900;

  --unavailable:    #9aa3a9;

  --tap:            44px;
  --sheet-radius:   18px;

  --shadow-1: 0 1px 2px rgba(20, 23, 26, .10);
  --shadow-2: 0 6px 24px rgba(20, 23, 26, .16);

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overscroll-behavior: none;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--surface);
  -webkit-text-size-adjust: 100%;
}

:root {
  --map-head-h: 56px;
  --map-foot-h: 42px;
}

#map {
  position: absolute;
  top: calc(var(--map-head-h) + env(safe-area-inset-top));
  bottom: calc(var(--map-foot-h) + env(safe-area-inset-bottom));
  left: 0;
  right: 0;

  background: var(--surface);
}

.map-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--surface);
  color: var(--ink-2);
  font: 500 15px/1.2 var(--sans);
  pointer-events: none;
  transition: opacity .35s ease;
}
.map-loading[hidden] { display: none; }
.map-loading--out { opacity: 0; }

.map-loading-spin {
  width: 20px;
  height: 20px;
  border: 3px solid var(--hairline);
  border-top-color: var(--ink-3);
  border-radius: 50%;
  animation: map-loading-spin .8s linear infinite;
}
@keyframes map-loading-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .map-loading-spin { animation: none; }
}

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  height: calc(var(--map-head-h) + env(safe-area-inset-top));
  padding: 0 12px;
  padding-top: env(safe-area-inset-top);

  background: var(--surface-raised);
  border-bottom: 1px solid var(--hairline);
  pointer-events: auto;
}
.topbar > * { pointer-events: auto; }

.topbar .nav { flex: 0 0 auto; }

.topbar .nav { z-index: 12; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.02em;
  white-space: nowrap;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wordmark span { color: var(--ink-3); font-weight: 500; }
@media (max-width: 560px) { .wordmark span { display: none; } }

@media (max-width: 420px) { .wordmark { font-size: 0; gap: 0; } }
.wordmark-logo { display: block; flex: 0 0 auto; width: 34px; height: 34px;
  object-fit: contain; object-position: center; }

.count {
  margin-left: auto;
  margin-right: 4px;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 6px 10px;
  white-space: nowrap;
}

.build {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  padding: 6px 4px;
  white-space: nowrap;
}
@media (max-width: 700px) { .build { display: none; } }

.filters {
  display: flex;
  gap: 8px;
  padding: 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.filters::-webkit-scrollbar { display: none; }

.filters-wrap {
  position: fixed;
  left: 0;

  right: 56px;
  bottom: calc(var(--map-foot-h) + env(safe-area-inset-bottom) + 12px);
  z-index: 9;
  transition: transform .26s cubic-bezier(.2,.8,.25,1);
}
.filters-wrap::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: 28px;
  pointer-events: none;
  background: linear-gradient(to right, rgba(242,243,241,0), rgba(242,243,241,.92));
}

.chip {
  flex: 0 0 auto;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: #e6e8ea;
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.chip:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.chip[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.chip--locked {
  background: #eef0f1;
  color: var(--ink-2);
  border-style: dashed;
  cursor: default;
}
.chip--locked::after {
  content: "🔒";
  margin-left: 5px;
  font-size: 11px;
}
.chip .dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.28);
}

.admin-map-toggle {
  display: inline-flex;
  margin: 0;
}
.chip--admin {
  background: #fff;
  color: var(--ink);
  border: 1px solid #c9922e;
  border-radius: 999px;
}
.chip--admin[aria-pressed="true"] {
  background: #fbf1dc;
  color: var(--ink);
  border-color: #c9922e;
}

.dot--inside  { background: var(--pin-inside); }
.dot--outside { background: var(--pin-outside); }
.dot--both    { background: var(--pin-both); }
.dot--info    { background: var(--pin-info); }

.sheet {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--map-foot-h) + env(safe-area-inset-bottom));
  z-index: 20;
  background: var(--surface-raised);
  border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
  box-shadow: var(--shadow-2);
  transform: translateY(100%);
  transition: transform .26s cubic-bezier(.2,.8,.25,1);
  max-height: calc(100vh - var(--map-head-h) - var(--map-foot-h)
                   - env(safe-area-inset-top) - env(safe-area-inset-bottom)
                   - 8px);
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet.is-peek { transform: translateY(calc(100% - var(--peek, 96px))); }
.sheet.is-half { transform: translateY(45%); }
.sheet.is-full { transform: translateY(0); }

.grabber {
  flex: 0 0 auto;
  width: 100%;
  min-height: 28px;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: grab;
  touch-action: none;
}
.grabber::after {
  content: "";
  width: 40px; height: 4px;
  border-radius: 2px;
  background: var(--hairline);
}

.sheet-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 2px 16px 12px;
}

#sheet .sheet-head {
  flex-direction: column;
  align-items: stretch;
}

.sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.sheet-actions .call { width: 100%; }

.sheet-title { min-width: 0; }
.sheet-title h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sheet-title p {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--ink-2);
}
.sheet-title p.sheet-place-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.sheet-title p.sheet-place-title[hidden] { display: none; }

.call {
  flex: 0 0 auto;
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.call:focus-visible { outline: 3px solid var(--pin-info); outline-offset: 2px; }
.call[disabled] { background: var(--surface-sunk); color: var(--ink-3); cursor: default; }

.call--like {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: #fff; color: #1877F2;
  border: 1.5px solid #1877F2;
}
.call--like .like-thumb { fill: currentColor; flex: none; }
.call--like:hover { background: #eaf2fe; }
.call--like.is-liked { background: #1877F2; color: #fff; border-color: #1877F2; }
.call--like.is-liked:hover { background: #166fe0; }

.sheet-like { margin-top: 12px; padding: 14px; border: 1px solid #d7dae0;
  border-radius: 10px; background: #fbfbfc; }
.sheet-like[hidden] { display: none; }
.sheet-like > strong { display: block; margin-bottom: 4px; color: var(--ink);
  font-size: 15px; }
.sheet-like .fineprint { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-3); }
.like-named { display: flex; align-items: center; gap: 8px; margin: 12px 0;
  color: var(--ink); cursor: pointer; }
.like-named input { width: 18px; height: 18px; flex: none; }

.sheet-like .field { display: block; margin: 12px 0 0; }
.sheet-like .field .label { display: block; margin-bottom: 5px;
  font-size: 13px; font-weight: 600; color: var(--ink-2); }
.sheet-like .field textarea { display: block; width: 100%; box-sizing: border-box;
  min-height: 66px; padding: 9px 11px; font: inherit;

  font-size: 16px;
  color: var(--ink); background: #fff; border: 1px solid #cfd3da;
  border-radius: 9px; resize: vertical; }
.sheet-like .field .fineprint { display: block; margin-top: 5px; }

.sheet-like .btnrow { display: flex; gap: 10px; margin: 14px 0 0; }
.sheet-like .btnrow .btn { flex: 1 1 0; min-height: var(--tap);
  border-radius: 10px; font: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; }
.sheet-like #likeSend { border: 0; background: #1877F2; color: #fff; }
.sheet-like #likeSend:hover { background: #166fe0; }
.sheet-like #likeCancel { border: 1px solid #cfd3da; background: #fff;
  color: var(--ink); }
.sheet-like .gate { margin-top: 12px; }
.sheet-like .gate[hidden] { display: none; }

.sheet-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px 20px;
}

.sheet-photo {
  display: block;
  max-width: 100%;
  max-height: 240px;
  width: auto;
  height: auto;
  margin: 0 auto 14px;
  border-radius: 10px;
  background: var(--surface-sunk);
}

.sheet-photo[hidden] { display: none; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 6px;
  background: var(--surface-sunk);
  color: var(--ink-2);
}
.tag.is-warn { background: #fdf1d8; color: #7a5600; }

.sheet.off--both   { --off: var(--pin-both); }
.sheet.off--inside { --off: var(--pin-inside); }
.sheet.off--outside{ --off: var(--pin-outside); }
.sheet.off--info   { --off: var(--pin-info); }
.sheet.off--none   { --off: var(--pin-none); }
.sheet.off--both .grabber::after,
.sheet.off--inside .grabber::after,
.sheet.off--outside .grabber::after,
.sheet.off--info .grabber::after,
.sheet.off--none .grabber::after { background: var(--off); opacity: .55; }
.sheet-title h2 {
  border-left: 3px solid var(--off, transparent);
  padding-left: 10px; margin-left: -13px;
}
.tags .tag--offering {
  background: var(--off, var(--surface-sunk));
  color: #fff;
}

.rows { margin: 0 0 16px; }
.row {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--hairline);
  font-size: 14px;
  line-height: 1.45;
}
.row dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 2px;
}
.row dd { margin: 0; }

.desc {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 16px;
}

.notice {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-sunk);
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 14px;
}
.notice strong { display: block; margin-bottom: 2px; }
.notice[hidden] { display: none; }

.gate {
  border: 1px dashed var(--hairline);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}
.gate strong { display: block; color: var(--ink); margin-bottom: 4px; font-size: 14px; }

.gate--soon { border-style: solid; border-color: var(--accent-soft);
  background: var(--accent-soft); color: var(--ink-2); }
.gate--soon strong { color: var(--accent); }

a.call { display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; }

.empty {
  position: fixed;
  left: 50%; top: calc(var(--map-head-h) + env(safe-area-inset-top) + 12px);
  transform: translateX(-50%);
  z-index: 8;
  width: max-content;
  max-width: calc(100vw - 32px);
  text-align: center;
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 10px 16px;
  box-shadow: var(--shadow-1);
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-2);
}
.empty strong { display: block; color: var(--ink); margin-bottom: 2px;
  font-size: 13.5px; }
.empty[hidden] { display: none; }

@media (min-width: 860px) {
  .sheet {
    left: 16px;
    top: 64px;
    bottom: 16px;
    right: auto;
    width: 380px;
    max-height: none;
    border-radius: 16px;
    transform: translateX(calc(-100% - 24px));
    transition: transform .26s cubic-bezier(.2,.8,.25,1);
  }
  .sheet.is-peek,
  .sheet.is-half,
  .sheet.is-full { transform: translateX(0); }
  .grabber { display: none; }
  .sheet-head { padding-top: 16px; }

  .filters { bottom: 16px; left: 412px; right: 16px; padding: 0; }
  .filters { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet   { transition: none; }
  .chip    { transition: none; }
  .filters { transition: none; }
}

.maplibregl-ctrl-bottom-left,
.maplibregl-ctrl-bottom-right { bottom: 4px; }

.map-foot {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 40;
  min-height: calc(var(--map-foot-h) + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  padding: 0 12px;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface-raised);
  border-top: 1px solid var(--hairline);
}

@media (min-width: 860px){

  .sheet {
    top: calc(var(--map-head-h) + 16px);
    bottom: calc(var(--map-foot-h) + 16px);
  }
  .filters-wrap { bottom: calc(var(--map-foot-h) + 16px); }
}

.map-approx-banner {
  position: absolute;
  top: 64px;
  left: 12px;
  right: 12px;
  z-index: 11;
  margin: 0 auto;
  max-width: 640px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface-raised, #fff);
  border: 1px solid var(--hairline, #d9d5cd);
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink, #16181c);
  text-align: center;
  pointer-events: auto;
}
.map-approx-banner a { color: var(--accent, #23357a); font-weight: 600; }

.gate--ok { border-color: var(--pin-outside); background: #f0f7f0; }
.gate--ok strong { color: var(--pin-outside); }
.gate--ok .rows { margin: 8px 0 6px; }
.gate--ok .fineprint { font-size: 12px; color: var(--ink-3); margin: 6px 0 0; }

.map-toast {

  position: fixed;
  left: 50%;
  bottom: calc(var(--stack-bottom, calc(var(--map-foot-h)
          + env(safe-area-inset-bottom) + 34px)) + 82px + 12px);
  transform: translateX(-50%);
  max-width: 22rem;
  background: #ffffff;
  color: #14171a;
  border: 1px solid #d9d9d0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.35;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  z-index: 8;
  opacity: 1;
  transition: opacity 0.5s ease;
}
.map-toast--out {
  opacity: 0;
}

.sponsor-marker {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #76ff03;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  position: relative;
  padding: 0;
  cursor: pointer;
}
.sponsor-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #76ff03;
  margin-top: -2px;
}
.dot--sponsor { background: #76ff03; }

.sponsor-sheet.is-open { transform: translateY(0); }
.sponsor-sheet-logo {
  max-width: 96px;
  max-height: 48px;
  object-fit: contain;
  margin-right: 10px;
}
.sponsor-tag,
.sponsor-banner-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c2410c;
  margin: 0;
}

.map-bottom-stack {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--stack-bottom, calc(var(--map-foot-h)
          + env(safe-area-inset-bottom) + 34px));
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.map-bottom-stack > * { pointer-events: auto; }

.map-bottom-stack .filters-wrap {
  position: relative;
  left: auto; right: auto; bottom: auto;
  align-self: stretch;
  margin-right: 56px;
}

body.sheet-open .map-bottom-stack .filters-wrap { display: none; }

.sponsor-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  max-width: calc(100vw - 24px);
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.95);
  color: #14171a;
  border: 1px solid #d9d9d0;
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
  overflow: hidden;
}
.sponsor-banner-logo {
  max-width: 64px;
  max-height: 20px;
  object-fit: contain;
}
.sponsor-banner-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-toast-link {
  display: inline-block;
  margin-left: 10px;
  padding: 4px 12px;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}

.wx-panel {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 12px);
  left: 12px;
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--surface-raised);
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(20, 23, 26, 0.14);
  max-width: min(78vw, 320px);
}

.wx-panel[hidden] { display: none; }
.wx-layers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wx-layer-btn {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.wx-layer-btn.is-active {
  background: var(--ink);
  color: var(--surface-raised);
  border-color: var(--ink);
}
.wx-time {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wx-slider {
  flex: 1 1 auto;
  min-height: 44px;
  accent-color: var(--ink);
}
.wx-time-label {
  flex: 0 0 auto;
  min-width: 92px;
  text-align: right;
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.sheet-admin-edit { display: inline-block; margin-top: 6px; font-size: 13px;
  font-weight: 600; color: #1a4b8f; text-decoration: underline; cursor: pointer; }
.sheet-admin-edit[hidden] { display: none; }

.mf-sheet[hidden] { display: none; }

.mf-sheet { position: fixed; z-index: 60; background: #fff;
  border: 1px solid var(--hairline, #d9d5cd); border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,.16);
  right: 14px; bottom: 64px; width: 340px;
  display: flex; flex-direction: column;
  max-height: 70vh; max-height: 70dvh; }

@media (max-width: 640px) {
  .mf-sheet { left: 0; right: 0; bottom: 0; width: auto;
    border-radius: 14px 14px 0 0;
    max-height: 80vh; max-height: 80dvh; }

  .plan-collapse-btn { cursor: pointer; }
  .plan-collapse-caret {
    display: block; flex: 0 0 auto; width: 11px; height: 11px;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;

    transform: rotate(-135deg); transition: transform .18s ease;
  }

  .plan-panel.is-collapsed { max-height: none; overflow: visible; }
  .plan-panel.is-collapsed .plan-body { display: none; }
  .plan-panel.is-collapsed .plan-panel-title,
  .plan-panel.is-collapsed .plan-collapse-btn { border-radius: 16px; }

  .plan-panel.is-collapsed .plan-collapse-caret { transform: rotate(45deg); }
}

.mf-head { display: flex; align-items: center; justify-content: space-between;
  gap: 8px; flex: 0 0 auto; padding: 14px 16px 8px;
  border-bottom: 1px solid var(--hairline, #d9d5cd); background: #fff;
  border-radius: 12px 12px 0 0; }
.mf-head-actions { display: flex; gap: 6px; }
.mf-note { flex: 0 0 auto; font-size: 12.5px; color: var(--ink-3, #666e76);
  margin: 0; padding: 8px 16px 0; }

.mf-body { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 4px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }

.mf-group { margin-top: 12px; }
.mf-group-title { font-size: 12px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--ink-3, #666e76); margin-bottom: 6px;
  position: sticky; top: 0; background: #fff; padding: 4px 0; z-index: 1; }
.mf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.mf-grid .check { display: flex; align-items: center; gap: 8px;
  font-size: 14px; padding: 5px 0; }
.mf-count { font-variant-numeric: tabular-nums; }

.place-search {
  position: absolute;
  top: calc(var(--map-head-h) + 10px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 24px));
  z-index: 5;
}

.place-search-input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  box-shadow: var(--shadow-1);
  outline: none;
}

.place-search-bar {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.place-search-bar .place-search-input { flex: 1 1 auto; width: auto; }
.place-search-type {
  flex: 0 0 auto;
  height: 40px;
  max-width: 42%;
  padding: 0 30px 0 14px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  box-shadow: var(--shadow-1);
  cursor: pointer;
  outline: none;

}
.place-search-type:focus {
  border-color: var(--ink-3);
  box-shadow: var(--shadow-2);
}
.place-search-input::placeholder { color: var(--ink-3); }
.place-search-input:focus {
  border-color: var(--ink-3);
  box-shadow: var(--shadow-2);
}

.place-search-results {
  list-style: none;
  margin: 6px 0 0;
  padding: 4px;
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: var(--shadow-2);
  max-height: 320px;
  overflow-y: auto;
}
.place-search-results[hidden] { display: none; }

.place-search-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.place-search-item.is-active,
.place-search-item:hover { background: var(--surface-sunk); }

.place-search-name { font-size: 15px; color: var(--ink); }
.place-search-meta {
  font-size: 13px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.place-search-tag { font-size: 12px; color: var(--ink-3); margin-left: auto; }
.place-search-item.is-abandoned .place-search-name { color: var(--ink-2); }

.place-search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.psf-chip {
  flex: 0 0 auto;
  padding: 5px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.psf-chip:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.psf-chip.is-on {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.psf-chip.chip--locked {
  background: #eef0f1;
  color: var(--ink-3);
  border-style: dashed;
  cursor: default;
}
.psf-chip.chip--locked::after {
  content: "🔒";
  margin-left: 5px;
  font-size: 10px;
}

.plan-panel {

  position: absolute; top: calc(var(--map-head-h) + env(safe-area-inset-top) + 12px);
  right: 12px; z-index: 45;
  width: 312px; max-width: calc(100vw - 24px);

  max-height: calc(100vh - var(--map-head-h) - 150px); overflow-y: auto;
  background: var(--surface-raised, #fff); color: var(--ink, #14171a);
  border: 1px solid var(--hairline, #cfd3ce); border-radius: 16px;
  box-shadow: 0 6px 24px rgba(22,24,28,.16);
  padding: 0 0 16px; font-size: 14px;
}

.plan-panel-title {
  margin: 0; padding: 0; position: relative;
  display: flex; align-items: center;
  background: var(--accent, #23357a); color: #fff;
  border-radius: 16px 16px 0 0;
  font-size: 17px; font-weight: 700; letter-spacing: .01em;
}
.plan-collapse-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; margin: 0; padding: 14px 18px 12px;
  background: none; border: 0; border-radius: 16px 16px 0 0;
  color: inherit; font: inherit; text-align: left;

  cursor: default;
}
.plan-collapse-label { flex: 1 1 auto; min-width: 0; }

.plan-collapse-caret { display: none; }
.plan-field { display: flex; flex-direction: column; gap: 7px; margin: 0 18px 8px; }
.plan-label { font-weight: 700; font-size: 13px; color: var(--ink, #14171a); }
.plan-hint { color: var(--ink-3, #767f86); font-size: 12px; line-height: 1.35; }
.plan-input {
  min-height: 42px; padding: 0 12px; font: inherit; font-size: 16px;
  color: var(--ink, #14171a); background: var(--accent-soft, #eef1fa);
  border: 1px solid var(--hairline, #cfd3ce); border-radius: 10px;
  transition: border-color .12s, box-shadow .12s;
}
.plan-input:focus { outline: none; border-color: var(--accent, #23357a);
  box-shadow: 0 0 0 3px rgba(35,53,122,.15); }
.plan-input[type="file"] { padding: 9px; font-size: 13px; background: var(--surface-sunk, #e6e8e5); }

.plan-btn {
  width: 100%; min-height: 42px; margin-top: 2px;
  border-radius: 999px; border: 1px solid var(--accent, #23357a);
  background: var(--accent, #23357a); color: #fff;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow-1); transition: background .12s, color .12s;
}
.plan-btn:hover { background: #1b295f; }
.btn.plan-btn {
  border-radius: 999px;
}
#plan-add-toggle { background: var(--surface-sunk, #e6e8e5); color: var(--ink, #14171a);
  border-color: var(--hairline, #cfd3ce); }
#plan-add-toggle:hover { background: #dcded9; }
#plan-add-toggle.is-on { background: var(--accent, #23357a); color: #fff; border-color: var(--accent, #23357a); }
#plan-clear { background: transparent; color: var(--ink-2, #4a5157); border-color: var(--hairline, #cfd3ce); }
#plan-clear:hover { background: var(--surface-sunk, #e6e8e5); }
.plan-or {
  display: flex; align-items: center; text-align: center; gap: 10px;
  margin: 12px 18px; color: var(--ink-3, #767f86);
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600;
}
.plan-or::before, .plan-or::after { content: ""; flex: 1; height: 1px; background: var(--hairline, #cfd3ce); }
.plan-sep { border: 0; border-top: 1px solid var(--hairline, #cfd3ce); margin: 14px 18px 10px; }
.plan-summary { margin: 0 18px 8px; font-weight: 700; color: var(--accent, #23357a); }
.plan-error { margin: 0 18px 8px; color: #c62828; font-size: 13px; }

.plan-wp-dot {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent, #23357a); color: #fff; border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; cursor: grab;
  box-shadow: 0 1px 5px rgba(22,24,28,.45);
}
.plan-wp-dot:active { cursor: grabbing; }

.plan-file-hidden {
  position: absolute; left: 0; top: 0;
  width: 1px; height: 1px; opacity: 0; pointer-events: none;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  border: 0; padding: 0; margin: 0;
}

.plan-field--start { margin-top: 12px; position: relative; }

.plan-start-row { display: flex; align-items: center; gap: 8px; }

.plan-start {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: stretch; gap: 0; max-width: 100%;
  border: 1px solid var(--hairline, #cfd3ce); border-radius: 9px;
  background: #fff; overflow: hidden;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.plan-start-input {
  flex: 1 1 auto; min-width: 0; border: 0; outline: none; background: transparent;
  padding: 8px 10px; font-size: 12px; color: var(--ink, #14171a);
  font-family: inherit;
}
.plan-start-input::placeholder { color: var(--ink-3, #767f86); }
.plan-start-file {
  position: relative;
  flex: 0 0 34px; width: 34px; max-width: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--ink-3, #767f86);
  border-left: 1px solid var(--hairline, #cfd3ce);
  transition: color .12s, background .12s;
  overflow: hidden;
}

.plan-start-file span {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.plan-start-file:hover { color: var(--accent, #23357a); background: var(--tint, #f4f7fa); }
.plan-start-file svg {
  width: 17px; height: 17px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}

.plan-start.is-dragover {
  border-color: var(--accent, #23357a); background: var(--accent-soft, #eef1fa);
  box-shadow: 0 0 0 3px rgba(35,53,122,.15);
}
.plan-start.is-dragover .plan-start-input { background: transparent; }
.plan-drop:hover { border-color: var(--accent, #23357a); color: var(--ink, #14171a); }
.plan-drop.is-dragover {
  border-color: var(--accent, #23357a); background: var(--accent-soft, #eef1fa);
  color: var(--accent, #23357a);
}

.plan-stops { list-style: none; margin: 0 18px 10px; padding: 0; max-height: 34vh; overflow-y: auto; }
.plan-stop {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; margin-bottom: 5px;
  background: var(--surface-sunk, #e6e8e5);
  border: 1px solid var(--hairline, #cfd3ce); border-radius: 8px;
  font-size: 13px;
}
.plan-stop--dragging { opacity: .85; border-color: var(--accent, #23357a);
  box-shadow: 0 3px 10px rgba(22,24,28,.2); }
.plan-stop-handle {
  cursor: grab; color: var(--ink-3, #767f86); font-size: 14px;
  touch-action: none; user-select: none; padding: 0 2px;
}
.plan-stop-handle:active { cursor: grabbing; }
.plan-stop-num {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent, #23357a); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.plan-stop-label { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; color: var(--ink, #14171a); }
.plan-stop-del {
  flex: 0 0 auto; border: 0; background: none; cursor: pointer;
  color: var(--ink-3, #767f86); font-size: 18px; line-height: 1; padding: 0 4px;
}
.plan-stop-del:hover { color: #c62828; }

.plan-stop-via {
  flex: 0 0 auto; cursor: pointer; padding: 1px 7px; border-radius: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: .02em; line-height: 1.6;
  border: 1px solid var(--line, #d7dde3);
  background: #fff; color: var(--ink-2, #4a5560);
}
.plan-stop-via:hover { border-color: var(--accent, #23357a); }

.plan-help {
  flex: 0 0 auto; margin: 0 16px 0 auto; cursor: pointer;
  padding: 0; font-family: inherit;
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.55);
  color: #fff; background: rgba(255,255,255,.12);
  font-size: 11px; font-weight: 700; line-height: 1;
}
.plan-help:hover, .plan-help:focus-visible {
  background: rgba(255,255,255,.28); border-color: #fff; outline: none;
}
.plan-help.is-on { background: #fff; border-color: #fff; color: var(--accent, #23357a); }

.plan-help--inline {
  margin: 0; border-color: var(--hairline, #cfd3ce);
  background: #fff; color: var(--ink-3, #767f86);
}
.plan-help--inline:hover, .plan-help--inline:focus-visible {
  background: var(--tint, #f4f7fa); border-color: var(--accent, #23357a);
  color: var(--accent, #23357a);
}
.plan-help--inline.is-on {
  background: var(--accent, #23357a); border-color: var(--accent, #23357a); color: #fff;
}
.plan-help-pop--inline { right: 0; top: 30px; }

.plan-help-pop {
  position: absolute; z-index: 30; right: 12px; top: 46px; max-width: 260px;
  padding: 10px 12px; border-radius: 10px; background: #fff;
  border: 1px solid var(--line, #d7dde3);
  box-shadow: 0 8px 22px rgba(0,0,0,.18);
  color: var(--ink, #14171a); font-size: 12px; font-weight: 400; line-height: 1.45;
  text-align: left; letter-spacing: 0;
}

.plan-tools {
  display: flex; gap: 6px; margin: 0 0 10px;
}
.plan-tool {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center;
  gap: 3px; cursor: pointer; padding: 7px 4px; border-radius: 9px;
  background: #fff; border: 1px solid var(--line, #d7dde3);
  color: var(--ink-2, #4a5560); font-size: 10px; font-weight: 700;
  letter-spacing: .02em; line-height: 1;
  transition: border-color .12s, background .12s, color .12s;
}
.plan-tool svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.plan-tool .tool-plus { stroke-width: 2.1; }
.plan-tool:hover { border-color: var(--accent, #23357a); color: var(--ink, #14171a); }

.plan-tool.is-on {
  background: var(--accent, #23357a); border-color: var(--accent, #23357a);
  color: #fff;
}

.plan-tool.is-fast {
  background: #fdf0cf; border-color: #d9a520; color: #6b4e05;
}
.plan-tool.is-fast:hover { border-color: #b8860b; color: #4a3603; }
.plan-tool.is-scenic {
  background: #1f7a3d; border-color: #1f7a3d; color: #fff;
}
.plan-tool.is-scenic:hover { border-color: #17612f; color: #fff; }
.plan-tool-label { white-space: nowrap; }

.plan-opt-head {
  position: relative; display: flex; align-items: center; gap: 6px;
  margin-bottom: 4px;
}
.plan-opt-label {
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  color: var(--ink-2, #4a5560);
}
.plan-select {
  width: 100%; padding: 7px 8px; border-radius: 8px; background: #fff;
  border: 1px solid var(--line, #d7dde3); color: var(--ink, #14171a);
  font-size: 13px;
}
.plan-select:focus { outline: 2px solid var(--accent, #23357a); outline-offset: 1px; }
.plan-range { width: 100%; margin: 2px 0 4px; accent-color: var(--accent, #23357a); }

.plan-cmp { min-width: 220px; }
.plan-cmp-head {
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  color: var(--ink-2, #4a5560); margin-bottom: 6px; padding-right: 14px;
}
.plan-cmp-note { font-size: 12px; color: var(--ink-3, #767f86); }
.plan-cmp-row {
  display: flex; align-items: center; gap: 7px; padding: 4px 2px;
  border-top: 1px solid var(--line-2, #eef2f5);
}
.plan-cmp-row:first-of-type { border-top: 0; }
.plan-cmp-row.is-off { opacity: .55; }
.plan-cmp-swatch {
  flex: 0 0 auto; width: 12px; height: 4px; border-radius: 2px;
  background: var(--ink-3, #767f86);
}
.plan-cmp-swatch.is-off { background: transparent; border: 1px dashed var(--line, #d7dde3); height: 6px; }
.plan-cmp-name { flex: 1 1 auto; font-size: 12px; color: var(--ink, #14171a); }
.plan-cmp-detail {
  flex: 0 0 auto; font-size: 11px; font-variant-numeric: tabular-nums;
  color: var(--ink-3, #767f86); white-space: nowrap;
}
.plan-cmp-use {
  flex: 0 0 auto; cursor: pointer; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 10px; background: #fff;
  border: 1px solid var(--line, #d7dde3); color: var(--ink-2, #4a5560);
}
.plan-cmp-use:hover { border-color: var(--accent, #23357a); color: var(--accent, #23357a); }

.plan-stop-cmp {
  flex: 0 0 auto; cursor: pointer; border: 0; background: none; padding: 0 3px;
  color: var(--ink-3, #767f86); font-size: 13px; line-height: 1;
}
.plan-stop-cmp:hover { color: var(--accent, #23357a); }

.plan-stop-cmp.is-active { color: var(--accent, #23357a); font-weight: 700; }
.plan-stop-via[data-pinned] { box-shadow: inset 0 0 0 1px var(--accent, #23357a); }

.plan-stop-miles {
  flex: 0 0 auto; font-size: 10px; font-variant-numeric: tabular-nums;
  color: var(--ink-3, #767f86); white-space: nowrap;
}
.plan-stop { cursor: grab; }
.plan-stop:active { cursor: grabbing; }

.plan-stop { transition: transform 140ms ease; }
.plan-stop--dragging {
  transition: none;
  position: relative;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,.22);
  transform-origin: center;
  scale: 1.02;
  cursor: grabbing;
}

@media (prefers-reduced-motion: reduce) {
  .plan-stop { transition: none; }
}
body.plan-row-dragging { cursor: grabbing; user-select: none; }

.plan-stop-pop { min-width: 180px; }
.plan-stop-pop-title { font-size: 12px; font-weight: 700; color: var(--ink, #14171a); }
.plan-stop-pop-sub {
  font-size: 11px; color: var(--ink-3, #767f86); margin: 2px 0 8px;
  word-break: break-word;
}
.plan-stop-pop-acts { display: flex; flex-direction: column; gap: 5px; }
.plan-stop-pop-btn {
  cursor: pointer; font-size: 12px; padding: 5px 8px; border-radius: 8px;
  background: #fff; border: 1px solid var(--line, #d7dde3);
  color: var(--ink, #14171a); text-align: left;
}
.plan-stop-pop-btn:hover { border-color: var(--accent, #23357a); }
.plan-stop-pop-btn.is-danger { color: #c62828; }
.plan-stop-pop-btn.is-danger:hover { border-color: #c62828; background: #fff5f5; }
.plan-stop:hover { background: var(--tint, #f4f7fa); }
.plan-stop-via[data-via="scenic"] {
  background: var(--accent, #23357a); border-color: var(--accent, #23357a);
  color: #fff;
}

.plan-choice { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }

.plan-choice-title {
  font-size: 12px; font-weight: 600; color: var(--ink, #14171a);
  max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.plan-choice-step {
  display: flex; align-items: center; gap: 6px; justify-content: space-between;
}
.plan-step-arrow {
  flex: 0 0 auto; cursor: pointer; width: 26px; height: 26px; line-height: 1;
  border: 1px solid var(--line, #d7dde3); background: #fff;
  color: var(--ink, #14171a); border-radius: 6px; font-size: 12px;
}
.plan-step-arrow:hover:not(:disabled) { border-color: var(--accent, #23357a); }
.plan-step-arrow:disabled { opacity: .35; cursor: default; }
.plan-step-label {
  flex: 1 1 auto; text-align: center; font-size: 12px; font-weight: 600;
  color: var(--ink, #14171a);
}
.plan-choice-btn {
  text-align: left; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--hairline, #cfd3ce); background: var(--surface-sunk, #e6e8e5);
  color: var(--ink, #14171a); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.plan-choice-btn:hover { background: var(--accent-soft, #eef1fa); border-color: var(--accent, #23357a); }

#plan-save { background: var(--surface-sunk, #e6e8e5); color: var(--ink, #14171a);
  border-color: var(--hairline, #cfd3ce); }
#plan-save:hover { background: #dcded9; }
.plan-export-row {
  display: flex; align-items: center; gap: 8px; margin: 0 18px 8px;
}
.plan-export-fmt-label { font-size: 12px; color: var(--ink-3, #767f86); flex: 0 0 auto; }
.plan-export-fmt {
  flex: 0 0 auto; min-height: 34px; padding: 0 8px; font: inherit; font-size: 13px;
  color: var(--ink, #14171a); background: #fff;
  border: 1px solid var(--hairline, #cfd3ce); border-radius: 8px;
}
.plan-export-row .plan-btn { flex: 1 1 auto; margin: 0; }
.plan-mytrips { margin: 10px 18px 0; font-size: 13px; }.plan-mytrips > summary { cursor: pointer; font-weight: 700; color: var(--accent, #23357a); padding: 4px 0; }
.plan-trip-list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 26vh; overflow-y: auto; }
.plan-trip-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.plan-trip-open {
  flex: 1 1 auto; text-align: left; padding: 7px 9px; border-radius: 8px;
  border: 1px solid var(--hairline, #cfd3ce); background: var(--surface-sunk, #e6e8e5);
  color: var(--ink, #14171a); font: inherit; font-size: 13px; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.plan-trip-open:hover { background: var(--accent-soft, #eef1fa); border-color: var(--accent, #23357a); }
.plan-trip-del { flex: 0 0 auto; border: 0; background: none; cursor: pointer;
  color: var(--ink-3, #767f86); font-size: 18px; line-height: 1; padding: 0 4px; }
.plan-trip-del:hover { color: #c62828; }
.plan-trip-empty { color: var(--ink-3, #767f86); padding: 6px 0; }

.plan-addr-row { display: flex; gap: 8px; }
.plan-addr-row .plan-input { flex: 1 1 auto; }
.plan-addr-row .plan-btn { flex: 0 0 auto; margin: 0; width: auto; padding: 0 14px; }
.plan-addr-results {
  list-style: none; margin: 6px 0 0; padding: 0;
  border: 1px solid var(--hairline, #cfd3ce); border-radius: 8px; overflow: hidden;
}
.plan-addr-results[hidden] { display: none; }
.plan-addr-result {
  padding: 8px 10px; font-size: 13px; line-height: 1.35; cursor: pointer;
  border-bottom: 1px solid var(--hairline, #eceef0);
}
.plan-addr-result:last-child { border-bottom: 0; }
.plan-addr-result:hover { background: var(--accent-soft, #eef1fa); }
.plan-addr-attrib { color: var(--ink-3, #767f86); text-decoration: underline; }

.plan-addr-marker {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent, #23357a); border: 3px solid #fff;
  box-shadow: 0 1px 6px rgba(22,24,28,.4); cursor: pointer;
}
.plan-addr-pop { min-width: 160px; }
.plan-addr-pop-name { font-size: 13px; line-height: 1.35; margin-bottom: 8px; color: var(--ink, #14171a); }
.plan-addr-add { width: 100%; margin: 0; }

.btn:not(.plan-btn) {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap);
  padding: 10px 16px;
  border-radius: 10px;
  font: inherit; font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--hairline);
  background: var(--surface-raised);
  color: var(--ink);
  text-decoration: none;
}
.btn[hidden] { display: none; }
.btn:not(.plan-btn):disabled { background: #9aa2b8; color: #fff; cursor: not-allowed; }
.btn-primary:not(.plan-btn) { border: 0; background: var(--ink); color: #fff; }
.btn-primary:not(.plan-btn):hover { background: #000; }
.btn-primary:not(.plan-btn):disabled { background: #9aa2b8; cursor: not-allowed; }
.btn-quiet:not(.plan-btn) {
  border: 1px solid var(--hairline);
  background: var(--surface-raised);
  color: var(--ink);
  text-decoration: none;
}
.btn-quiet[hidden] { display: none; }

.field { display: block; margin: 12px 0; }
.field[hidden] { display: none; }
.field .label,
.label { display: block; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.field .hint,
.hint { display: block; font-size: 13px; color: var(--ink-3); margin-bottom: 6px; }
.hint[hidden] { display: none; }
.field input[type="text"],
.field input:not([type="checkbox"]):not([type="radio"]),
.field textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 9px 12px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--ink);
  font: inherit;
}
.alert {
  color: #8a1c1c; background: #fdecec;
  border: 1px solid #f3c4c4; border-radius: 10px;
  padding: 8px 10px; margin: 10px 0; font-size: 14px;
}
.alert[hidden] { display: none; }

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(20, 23, 26, .55);
}
.dialog-backdrop[hidden] { display: none; }
.dialog {
  background: var(--surface-raised);
  color: var(--ink);
  border-radius: 14px;
  padding: 18px;
  width: 100%; max-width: 420px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-shadow: var(--shadow-2, 0 10px 30px rgba(0,0,0,.25));
}
.dialog-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 6px;
}
.dialog-head h2 { margin: 0; font-size: 19px; }
.dialog-close {
  border: 0; background: none; color: var(--ink-3);
  font-size: 26px; line-height: 1; cursor: pointer;
  min-width: var(--tap); min-height: var(--tap);
}
.dialog-body { margin: 0 0 8px; color: var(--ink-2); }
.dialog-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 16px;
}

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px;
  overflow: hidden; }

.sheet-report { margin-top: 12px; padding: 12px; border: 1px solid #d7dae0;
  border-radius: 10px; background: #fbfbfc; }
.sheet-report[hidden] { display: none; }
.sheet-report > strong { display: block; margin-bottom: 8px; color: var(--ink); }
.report-reasons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.report-reason { min-height: var(--tap); padding: 8px 12px; border-radius: 8px;
  border: 1px solid #cfd3da; background: #fff; color: var(--ink);
  cursor: pointer; font: inherit; }
.report-reason[aria-pressed="true"] { border-color: var(--ink);
  background: var(--surface-sunk); color: var(--ink); }

.sheet-report .btnrow { display: flex; gap: 10px; margin: 14px 0 0; }
.sheet-report .btnrow .btn { flex: 1 1 0; min-height: var(--tap); }

.supporter-badge,
.fb-moderator-badge,
.community-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  margin-left: 6px;
  vertical-align: middle;
  white-space: nowrap;
}
.supporter-badge  { background: #fde8ef; color: #b0114e; }
.fb-moderator-badge { background: #e3ecfb; color: #17458f; }
.community-badge  { background: #e8ecef; color: #2b3742; }
.community-badge--bab_team { background: #e6f0ea; color: #1f5c3d; }
