/* Fórsa Picket Map — one stylesheet, tokens shared with Rep Maps (map.css). */
:root {
  --navy: #1f3a56; --teal: #3a8b94; --teal-dark: #1f5d66;
  --coral: #d74e5c; --coral-dark: #b83c49; --coral-tint: #fbeaec; --amber: #b45309;
  --ink: #1c2733; --ink-2: #52626f; --ink-3: #8195a1;
  --line: #e3e9ee; --surface: #ffffff; --surface-2: #f6f8fa;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 10px 34px rgba(31, 58, 86, 0.18); --shadow-sm: 0 2px 10px rgba(31, 58, 86, 0.10);
  --topbar-h: 64px; --panel-w: 380px; --gap: 16px; --peek: 60px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--surface-2); -webkit-font-smoothing: antialiased;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.app { position: fixed; inset: 0; overflow: hidden; }
.map { position: absolute; inset: 0; background: #e9eef2; }

/* --- top bar ------------------------------------------------------------- */
.topbar {
  position: absolute; top: 0; left: 0; right: 0; height: var(--topbar-h); z-index: 30;
  display: flex; align-items: center; gap: 12px; padding: 0 var(--gap);
  background: rgba(255, 255, 255, 0.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(31, 58, 86, 0.08);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); font-weight: 700; letter-spacing: -0.01em; flex: none; }
.brand img { height: 36px; width: auto; }
.search { flex: 1; min-width: 0; display: flex; gap: 8px; max-width: 640px; margin: 0 auto; }
.search input {
  flex: 1; min-width: 0; height: 44px; border: 1px solid var(--line); border-radius: 999px; font: inherit; font-size: 16px;
  padding: 0 18px 0 42px; color: var(--ink); background: var(--surface) no-repeat 15px center / 16px 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238195a1' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.8-3.8'/%3E%3C/svg%3E");
  box-shadow: var(--shadow-sm);
}
.search input:focus { outline: 2px solid var(--teal); outline-offset: 2px; border-color: transparent; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

/* --- buttons ------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border: 0; border-radius: 999px; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; transition: background .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.btn-primary { background: var(--coral); color: #fff; }
.btn-primary:hover { background: var(--coral-dark); }
.btn-ghost { background: var(--surface); color: var(--navy); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-ghost .ico { font-size: 18px; line-height: 1; color: var(--coral); }
.btn-icon { min-width: 44px; padding: 0; background: transparent; color: var(--ink-2); }
.btn-icon:hover { background: var(--surface-2); }
.btn-link { background: none; color: var(--teal-dark); padding: 0 4px; min-height: 36px; font-weight: 600; }
.count-badge { display: none; }
.panel-toggle { display: none; }

/* --- panel (desktop: floating card on the left) --------------------------- */
.panel {
  position: absolute; top: calc(var(--topbar-h) + var(--gap)); left: var(--gap); bottom: var(--gap); width: var(--panel-w);
  z-index: 20; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .28s ease, opacity .28s ease;
}
.panel-head { position: relative; padding: 18px 56px 12px 20px; border-bottom: 1px solid var(--line); }
.panel-head h1 { margin: 0; font-size: 20px; letter-spacing: -0.02em; color: var(--navy); }
.panel-sub { margin: 3px 0 0; color: var(--ink-2); font-size: 13px; }
.panel-close { position: absolute; top: 12px; right: 10px; display: none; }
.sheet-handle { display: none; }
.panel-body { flex: 1; overflow: auto; overscroll-behavior: contain; padding: 8px; }
.panel-foot { padding: 10px 20px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }
.empty, .note { margin: 24px 12px; color: var(--ink-2); text-align: center; }
.note { font-size: 13px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; }

/* --- list ------------------------------------------------------------------ */
.picket-list { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px; border: 0; border-radius: var(--radius-sm);
  background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.item:hover, .item:focus-visible { background: var(--surface-2); outline: none; }
.item[aria-current="true"] { background: var(--coral-tint); }
.dot { flex: none; width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(31, 58, 86, 0.08); }
.item-main { flex: 1; min-width: 0; }
.item-name { display: block; font-weight: 650; color: var(--navy); }
.item-when { display: block; color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.item-meta { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; color: var(--ink-3); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.badge-today { background: var(--coral); color: #fff; }

/* --- detail ---------------------------------------------------------------- */
.detail { padding: 4px 12px 16px; }
.detail-name { margin: 8px 0 4px; font-size: 22px; line-height: 1.2; letter-spacing: -0.02em; color: var(--navy); }
.detail-name:focus { outline: none; }
.detail-address { margin: 0 0 10px; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.chip { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 650; color: #fff; }
.detail-when { margin: 0 0 8px; font-weight: 650; }
.detail-notes { margin: 0 0 14px; color: var(--ink-2); white-space: pre-line; }
.detail-actions { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; }
.detail-dist { color: var(--ink-2); font-size: 13px; }
.signup { border-top: 1px solid var(--line); padding-top: 16px; }
.signup h3 { margin: 0 0 10px; font-size: 16px; color: var(--navy); }
.signup-form label { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.signup-form input { display: block; width: 100%; height: 44px; margin-top: 4px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; font-size: 16px; color: var(--ink); }
.signup-form input:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: transparent; }
.signup-form input[aria-invalid="true"] { border-color: var(--coral); }
.signup-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { margin: 10px 0 0; font-weight: 600; min-height: 1.2em; }
.form-msg.ok { color: var(--teal-dark); }
.form-msg.err { color: var(--coral-dark); }
.privacy { margin: 10px 0 0; font-size: 12px; color: var(--ink-3); line-height: 1.4; }
.signup-done { padding: 14px; border-radius: var(--radius-sm); background: #e8f4f5; color: var(--teal-dark); font-weight: 600; }

/* --- map chrome ------------------------------------------------------------ */
.maplibregl-ctrl-top-right { top: calc(var(--topbar-h) + var(--gap)); right: var(--gap); }
.maplibregl-ctrl-group { border-radius: 12px; box-shadow: var(--shadow-sm); }
.maplibregl-ctrl-group button { width: 40px; height: 40px; }
.maplibregl-popup.preview { max-width: 280px; }
.maplibregl-popup.preview .maplibregl-popup-content { padding: 12px 14px; border-radius: 12px; box-shadow: var(--shadow); font-size: 13px; line-height: 1.4; }
.preview .pv-name { display: block; font-weight: 700; color: var(--navy); font-size: 14px; }
.preview .pv-address { display: block; color: var(--ink-2); margin-top: 2px; }
.preview .pv-action { display: inline-block; margin-top: 8px; padding: 2px 9px; border-radius: 999px; color: #fff; font-weight: 650; font-size: 12px; }
.preview .pv-when { display: block; margin-top: 6px; font-weight: 650; }

/* --- corner card ----------------------------------------------------------- */
.corner-card { position: absolute; right: var(--gap); bottom: 34px; z-index: 10; margin: 0; padding: 8px;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.corner-card img { display: block; width: 160px; height: 160px; }
.corner-card figcaption { max-width: 160px; margin-top: 6px; font-size: 12px; line-height: 1.3; color: var(--ink-2); text-align: center; }

/* --- phones: the panel becomes a bottom sheet over the map ------------------ */
@media (max-width: 760px) {
  :root { --topbar-h: 60px; }
  .brand-name { display: none; }
  .brand img { height: 30px; }
  .topbar { gap: 8px; padding: 0 12px; }
  .search { max-width: none; gap: 6px; }
  .search input { padding-left: 38px; padding-right: 12px; }
  .btn-ghost .txt { display: none; }
  .btn-ghost { min-width: 44px; padding: 0 12px; }
  .panel-toggle { display: inline-flex; }
  .count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px;
    border-radius: 999px; background: var(--coral); color: #fff; font-size: 12px; font-weight: 700; }
  .panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 58dvh; border-radius: 18px 18px 0 0;
    transition: transform .3s ease, height .3s ease; }
  .app.sheet-tall .panel { height: 92dvh; }
  .app.panel-closed .panel { transform: translateY(calc(100% - var(--peek))); }
  .sheet-handle { display: block; width: 40px; height: 4px; margin: 8px auto 0; border-radius: 2px; background: var(--line); }
  .panel-head { padding-top: 8px; }
  .panel-close { display: inline-flex; }
  .corner-card, .maplibregl-ctrl-top-right { display: none; }
  .signup-form input, .search input { font-size: 16px; }
}
@media (min-width: 761px) {
  .app.panel-closed .panel { transform: translateX(calc(-100% - var(--gap) * 2)); opacity: 0; pointer-events: none; }
}
@media (prefers-reduced-motion: reduce) {
  .panel, .btn { transition: none; }
}
