:root {
  --bg: #f3f0e8;
  --ink: #1c1915;
  --muted: #6d655c;
  --line: #ddd6c8;
  --paper: #fffcf7;
  --green: #1d6b43;
  --green-soft: #e5f2ea;
  --amber: #8a5a12;
  --amber-soft: #f8efdc;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 12px; letter-spacing: 0.04em; }
h1 { margin: 0; font-size: 22px; font-weight: 650; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  cursor: pointer;
}
.filters button[aria-selected="true"],
.sat[aria-selected="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.sat {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  cursor: pointer;
  margin-left: 8px;
  height: fit-content;
}
main { flex: 1; min-height: 0; display: grid; grid-template-columns: 280px minmax(0, 1fr) 360px; }
.rail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--paper);
  border-right: 1px solid var(--line);
}
.search { padding: 10px 12px 0; }
.rail .filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.rail .filters .chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 4px 10px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.rail .filters .chip[aria-selected="true"] {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.rail .filters .chip.rec[aria-selected="true"] {
  background: #8a5a00;
  border-color: #8a5a00;
}
.rail .filters .chip.full[aria-selected="true"] {
  background: #c62828;
  border-color: #c62828;
}
.search input {
  width: 100%;
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
.list, .detail { overflow: auto; background: var(--paper); }
.list { flex: 1; border-right: 0; }
.empty-list { margin: 16px; color: var(--muted); font-size: 14px; }
.detail { border-left: 1px solid var(--line); }
.detail .hero {
  width: 100%;
  height: 230px;
  object-fit: cover;
  display: block;
  background: #e7e3da;
}
.detail .empty {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: #e7e3da;
  font-size: 14px;
}
.detail .row { display: flex; gap: 6px; padding: 8px 10px 0; overflow-x: auto; }
.detail .row button { padding: 0; border: 2px solid transparent; background: none; cursor: pointer; flex: none; }
.detail .row button.on { border-color: #1c1915; }
.detail .row img { width: 72px; height: 48px; object-fit: cover; display: block; }
.pitch-list { list-style: none; margin: 8px 16px 12px; padding: 0; }
.pitch-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.pitch-list b { font-weight: 650; }
.detail p { margin: 4px 16px; font-size: 14px; line-height: 1.5; }
.detail .actions { margin: 12px 16px 20px; padding: 0; background: transparent; }
.card {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 14px 16px;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.card.unavailable { background: #f6f4ef; }
.card.unavailable h2 { color: #8a847a; }
.tag.rec { background: #e5f6eb; color: #157a3a; }
.tag.off { background: #eceae4; color: #6d675f; }
.edit-form { padding: 4px 0 20px; }
.edit-form h2 { margin: 16px 16px 14px; font-size: 18px; }
.field { display: block; margin: 0 16px 12px; }
.field span, .field-label, .pitch-pair span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input, .field textarea, .pitch-edit input {
  width: 100%;
  font: inherit;
  font-size: 14px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
.field textarea { min-height: 108px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .pitch-edit input:focus {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
  border-color: var(--ink);
}
.field-label { margin: 16px 16px 8px; }
.pitch-edit { list-style: none; margin: 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pitch-edit li {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 10px;
  background: #f6f3ec;
  border-radius: 12px;
}
.pitch-main { display: flex; align-items: flex-end; gap: 8px; }
.pitch-pair { flex: 1; min-width: 0; }
.pitch-pair span { margin-bottom: 4px; }
.pitch-del {
  border: 0;
  background: transparent;
  color: #8d3b32;
  font: inherit;
  font-size: 13px;
  padding: 9px 2px;
  cursor: pointer;
  flex: none;
}
.add-pitch {
  display: block;
  width: calc(100% - 32px);
  margin: 8px 16px 14px;
  border: 1px dashed var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.flag-fields { display: flex; flex-direction: column; gap: 8px; margin: 0 16px 14px; }
.flag-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: #f6f3ec;
  border-radius: 12px;
}
.flag-block input[type="text"] {
  width: 100%;
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
.flag-block input[type="text"]:focus {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
  border-color: var(--ink);
}
.flag-line { display: flex; gap: 8px; align-items: baseline; margin: 8px 16px; }
.flag-line span:last-child { font-size: 14px; line-height: 1.45; }
.flag-note { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.check {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
}
.check input { width: 15px; height: 15px; margin: 0; }
.tiny, .primary { font: inherit; font-size: 13px; border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.tiny { border: 1px solid var(--line); background: #fff; margin: 0; }
.primary { background: #1c1915; color: #fff; border: 0; }
.switch, .upload {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.switch.on { background: #8a5a00; color: #fff; border-color: #8a5a00; }
.switch.danger.on { background: #8d3b32; border-color: #8d3b32; }
.upload input { display: none; }
.save-msg { min-height: 1.2em; margin: 0 16px 4px; color: var(--muted); font-size: 13px; }
.star-wrap { background: transparent; border: 0; }
.star { display: block; width: 28px; height: 28px; overflow: visible; }
.star path, .legend-star path {
  fill: #e11d2e;
  stroke: #fff;
  stroke-width: 1.6;
  stroke-linejoin: round;
  paint-order: stroke fill;
}
.card h2 { margin: 0 0 6px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot.hollow { border: 2px solid #5c6b7a; box-sizing: border-box; }
.meta { color: var(--muted); font-size: 13px; line-height: 1.45; }
.tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.tag {
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
}
.tag.full { background: #fde8e6; color: #c62828; }
.tag.warn { background: var(--amber-soft); color: var(--amber); }
.bubble-wrap { background: transparent; border: 0; }
.bubble {
  display: block;
  border-radius: 50%;
  border: 3px solid #fff;
  box-sizing: border-box;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.bubble.on { box-shadow: 0 0 0 3px #1c1915; }
.bubble.hollow { background: #fff; border-color: #1c1915; }
.stage { position: relative; min-height: 0; }
.pane-toggle {
  position: absolute;
  top: 12px;
  z-index: 600;
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.96);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.pane-toggle.left { left: 54px; }
.pane-toggle.right { right: 12px; }
main.hide-rail { grid-template-columns: minmax(0, 1fr) 360px; }
main.hide-detail { grid-template-columns: 280px minmax(0, 1fr); }
main.hide-rail.hide-detail { grid-template-columns: minmax(0, 1fr); }
main.hide-rail .rail,
main.hide-detail .detail { display: none; }
#map { position: absolute; inset: 0; }
.legend {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  max-width: 280px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
}
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); }
.legend-star svg { width: 14px; height: 14px; display: block; overflow: visible; }
.photos { display: none; }
.card .more { margin-top: 8px; font-size: 13px; line-height: 1.45; }
.card .more p { margin: 3px 0; }
.leaflet-tooltip.venue-tip {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  color: #fff;
  font-weight: 650;
}
.leaflet-tooltip.venue-tip span {
  display: block;
  padding: 3px 8px;
  border-radius: 4px;
}
.leaflet-tooltip.venue-tip::before { display: none; }
.leaflet-tooltip.station-tip {
  background: #1c1915;
  color: #fff;
  border: 0;
  border-radius: 4px;
  box-shadow: none;
}
.leaflet-tooltip.station-tip::before { display: none; }
.actions { display: flex; gap: 8px; padding: 0 16px 12px; background: var(--green-soft); flex-wrap: wrap; align-items: center; }
.actions .tiny { margin-left: 0; }
.add-venue {
  display: block;
  width: calc(100% - 24px);
  margin: 8px 12px 0;
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.add-venue[hidden] { display: none; }
.hint { margin: 0 16px 8px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.edit-form .actions a,
.detail .actions a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border: 1px solid var(--ink);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  background: #fff;
}
.leaflet-container { font-family: inherit; background: #e7eef3; }
@media (max-width: 960px) {
  main,
  main.hide-rail,
  main.hide-detail,
  main.hide-rail.hide-detail { grid-template-columns: 1fr; }
  main { grid-template-rows: 280px minmax(240px, 1fr) auto; }
  main.hide-rail { grid-template-rows: minmax(240px, 1fr) auto; }
  main.hide-detail { grid-template-rows: 280px minmax(240px, 1fr); }
  main.hide-rail.hide-detail { grid-template-rows: minmax(0, 1fr); }
  .rail, .detail { border: 0; border-bottom: 1px solid var(--line); }
}
