/* The embeddable area map, themed to match the 6th Ward site
   (6thwardstl.com): navy #032673, red #c70f2e, yellow #f3db11, gold #b78d0c,
   cream #f2f2ee. ?accent=xxxxxx still overrides the navy if it is ever
   embedded somewhere else. */

:root {
  --accent: #032673;          /* ward navy: header, selected state, outline */
  --red: #c70f2e;             /* ward red: primary buttons */
  --yellow: #f3db11;          /* ward yellow: call-to-action, flourish */
  --gold: #8f6c00;            /* ward gold #b78d0c, darkened to read on white */
  --ink: #032673;
  --muted: #4a5878;
  --line: #d9dce4;
  --bg: #ffffff;
  --soft: #f2f2ee;            /* ward cream */
  --open: #c98500;
  --done: #199e70;
  --radius: 4px;
  font-family: "Galano", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); }
button, input, select { font: inherit; color: inherit; }

.app { display: flex; height: 100%; min-height: 420px; }

/* ---------------------------------------------------------------- panel */
.panel {
  width: 340px; flex: none; display: flex; flex-direction: column;
  border-right: 1px solid var(--line); background: var(--bg); min-height: 0;
}
.ph { padding: 14px 16px 12px; background: var(--accent); color: #fff; border-bottom: 5px solid var(--yellow); display: flex; gap: 10px; align-items: flex-start; }
.ph-title { flex: 1; min-width: 0; }
.ph h1 { font-size: 17px; line-height: 1.2; margin: 0; font-weight: 900; text-transform: uppercase; letter-spacing: .02em; }
.sub { margin: 4px 0 0; font-size: 12px; color: #d6dcef; }
.sub .live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); margin-right: 5px; vertical-align: 1px; }
.sheet-toggle { display: none; }

.pbody { flex: 1; overflow-y: auto; padding: 12px 16px; min-height: 0; }

.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; }
.search input {
  width: 100%; padding: 9px 10px 9px 32px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--soft); outline: none;
}
.search input:focus { border-color: var(--accent); background: #fff; }

.row { display: flex; gap: 8px; margin-top: 10px; }
.seg { display: flex; flex: 1; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg button { flex: 1; border: 0; background: #fff; padding: 7px 4px; font-size: 13px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-checked="true"] { background: var(--accent); color: #fff; font-weight: 700; }
#days { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 6px 6px; font-size: 13px; }

.cats-head, .list-head {
  display: flex; justify-content: space-between; align-items: center;
  margin: 14px 0 6px; font-size: 12px; font-weight: 800; color: var(--gold);
  text-transform: uppercase; letter-spacing: .05em;
}
.link { border: 0; background: none; color: var(--red); cursor: pointer; font-size: 12px; font-weight: 600; padding: 2px 0; text-transform: none; letter-spacing: 0; display: inline-flex; align-items: center; gap: 4px; }
.link svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }

.cats { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line);
  background: #fff; border-radius: 999px; padding: 4px 10px 4px 7px; font-size: 13px; cursor: pointer;
}
.chip .sw { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.chip .n { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="false"] { opacity: .45; }
.chip[aria-pressed="false"] .sw { background: transparent !important; box-shadow: inset 0 0 0 2px #9aa3ad; }
.chip:focus-visible, .seg button:focus-visible, .item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.list { list-style: none; margin: 0; padding: 0; }
.item { display: flex; gap: 10px; padding: 9px 6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 6px; }
.item:hover { background: var(--soft); }
.item.sel { background: var(--soft); box-shadow: inset 4px 0 0 var(--yellow); }
.item .sw { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; }
.item .t { font-size: 14px; line-height: 1.3; font-weight: 600; }
.item .m { font-size: 12px; color: var(--muted); margin-top: 2px; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 4px; margin-left: 4px; vertical-align: 1px; }
.badge.open { background: #fdf1d8; color: #7a5200; }
.badge.closed { background: #dcf3ea; color: #0d5e42; }
.empty { color: var(--muted); font-size: 13px; padding: 12px 4px; }
.more { width: 100%; margin: 10px 0 4px; border: 0; background: var(--red); color: #fff; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 0; padding: 9px; cursor: pointer; }
.more:hover { background: var(--accent); }

.pf { border-top: 1px solid var(--line); padding: 10px 16px 12px; background: var(--soft); }
.cta { display: block; text-align: center; background: var(--yellow); color: var(--accent); text-decoration: none; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 10px; border-radius: 0 var(--radius); font-size: 14px; }
.cta:hover { background: var(--accent); color: #fff; }
.fine { margin: 6px 0 0; font-size: 11px; color: var(--muted); line-height: 1.35; }

/* ------------------------------------------------------------------ map */
.mapwrap { position: relative; flex: 1; min-width: 0; }
#map { position: absolute; inset: 0; background: #eef0f2; }
.leaflet-container { font: inherit; }
.leaflet-container .leaflet-control-attribution { font-size: 11px; }

.stepper {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 500;
  background: #fff; border-radius: 999px; box-shadow: 0 2px 10px rgba(0,0,0,.18);
  display: flex; align-items: center; gap: 4px; padding: 4px; font-size: 13px;
}
.stepper button { border: 0; background: var(--red); color: #fff; border-radius: 999px; padding: 6px 12px; cursor: pointer; font-weight: 700; }
.stepper button:hover { background: var(--accent); }
.stepper span { padding: 0 6px; color: var(--muted); font-variant-numeric: tabular-nums; }

.toast {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 600;
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; font-size: 13px; max-width: 90%;
}

.pop h3 { font-size: 14px; margin: 0 0 4px; font-weight: 800; color: var(--accent); }
.pop .addr { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.pop ul { list-style: none; margin: 0; padding: 0; max-height: 210px; overflow-y: auto; }
.pop li { padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.35; }
.pop li:first-child { border-top: 0; }
.pop .d { color: var(--muted); font-size: 12px; }
.pop a { color: var(--red); font-weight: 700; }
.pop .hidden-note { font-size: 12px; color: var(--muted); margin-top: 6px; }

.you { width: 14px; height: 14px; border-radius: 50%; background: #2a7de1; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(42,125,225,.35); }

/* ------------------------------------------------------------- narrow */
@media (max-width: 720px) {
  .app { display: block; position: relative; }
  .mapwrap { position: absolute; inset: 0; }
  .panel {
    position: absolute; left: 0; right: 0; bottom: 0; width: auto;
    border-right: 0; border-top: 1px solid var(--line); border-radius: 14px 14px 0 0;
    box-shadow: 0 -4px 16px rgba(0,0,0,.12); max-height: 100%; z-index: 1100;
  }
  .panel:not(.open) .pbody, .panel:not(.open) .pf { display: none; }
  .panel.open { top: 0; border-radius: 0; }
  .panel.open .ph { border-radius: 0; }
  .ph { padding: 10px 12px; align-items: center; border-radius: 14px 14px 0 0; }
  .ph h1 { font-size: 15px; }
  .sheet-toggle {
    display: block; flex: none; border: 0; background: var(--yellow); color: var(--accent);
    border-radius: 0 var(--radius); padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
  }
  .sheet-toggle .when-open { display: none; }
  .panel.open .sheet-toggle .when-open { display: inline; }
  .panel.open .sheet-toggle .when-closed { display: none; }
  .stepper { bottom: 74px; }
  .leaflet-bottom { bottom: 60px; }
}
