:root {
  --bg: #0f1117;
  --panel: #171b24;
  --border: #2a3140;
  --text: #eef2ff;
  --muted: #9aa6bf;
  --accent: #ff6b9d;
  --accent-2: #6b9dff;
  --chip: #222938;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.header {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #1a1224, #101828);
}
.header-inner { padding: 1rem 1.25rem; }
.header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.header h1 { margin: 0 0 .25rem; font-size: 1.35rem; }
.subtitle { margin: 0; color: var(--muted); font-size: .9rem; }

.lang-switch {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  flex: 0 0 auto;
}
.lang-btn {
  border: 1px solid var(--border);
  background: var(--chip);
  color: var(--muted);
  border-radius: 999px;
  padding: .28rem .55rem;
  font-size: .72rem;
  cursor: pointer;
  line-height: 1.2;
}
.lang-btn.active {
  border-color: var(--accent-2);
  background: rgba(107, 157, 255, .15);
  color: var(--text);
}
.lang-btn:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  min-height: calc(100vh - 84px);
}

.sidebar {
  border-right: 1px solid var(--border);
  overflow: auto;
  padding: .75rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .85rem;
  margin-bottom: .75rem;
}

.panel h2 {
  margin: 0 0 .65rem;
  font-size: .95rem;
}

.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
  border: 1px solid var(--border);
  background: var(--chip);
  color: var(--text);
  border-radius: 999px;
  padding: .35rem .7rem;
  font-size: .82rem;
  cursor: pointer;
}
.chip.active {
  border-color: var(--accent);
  background: rgba(255, 107, 157, .15);
}

.field { display: grid; gap: .25rem; margin-bottom: .65rem; }
.field span { font-size: .78rem; color: var(--muted); }
.field input:not([type="checkbox"]), .field select {
  width: 100%;
  border: 1px solid var(--border);
  background: #0f131b;
  color: var(--text);
  border-radius: 8px;
  padding: .55rem .65rem;
}
.field.checkbox {
  display: flex;
  align-items: center;
  gap: .45rem;
}
.field.checkbox input[type="checkbox"] {
  width: auto;
  padding: 0;
  flex: 0 0 auto;
}

.btn {
  border: 1px solid var(--border);
  background: var(--chip);
  color: var(--text);
  border-radius: 8px;
  padding: .55rem .85rem;
  cursor: pointer;
}
.btn.primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #ff8f6b);
  border: none;
  color: #2b0d1a;
  font-weight: 700;
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .5rem;
}
.badge {
  background: rgba(107, 157, 255, .15);
  color: var(--accent-2);
  border-radius: 999px;
  padding: .15rem .55rem;
  font-size: .75rem;
}

.event-list { display: grid; gap: .55rem; max-height: 42vh; overflow: auto; }
.event-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .65rem;
  cursor: pointer;
  background: #121722;
}
.event-card.active { border-color: var(--accent-2); }
.event-card h3 {
  margin: 0 0 .35rem;
  font-size: .92rem;
  line-height: 1.35;
}
.meta { color: var(--muted); font-size: .76rem; line-height: 1.45; }
.tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .4rem; }
.tag {
  font-size: .68rem;
  color: #c9d7ff;
  background: rgba(107, 157, 255, .12);
  border-radius: 999px;
  padding: .12rem .45rem;
}

.map-panel { min-height: 400px; }
#map { width: 100%; height: calc(100vh - 84px); min-height: 400px; }

.fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1000;
  border: none;
  border-radius: 999px;
  background: var(--accent-2);
  color: #081018;
  font-weight: 700;
  padding: .75rem 1rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}

.event-detail-link {
  display: inline-block;
  margin-top: .45rem;
  color: var(--accent-2);
  font-size: .8rem;
  text-decoration: underline;
}
.event-detail-link:focus-visible,
.event-card:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

fieldset.field {
  border: none;
  padding: 0;
  margin: 0 0 .65rem;
}
fieldset.field legend {
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: .25rem;
  padding: 0;
}

.period-dates {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-top: .45rem;
}
.period-dates input[type="date"] {
  flex: 1 1 0;
  min-width: 0;
  border: 1px solid var(--border);
  background: #0f131b;
  color: var(--text);
  border-radius: 8px;
  padding: .55rem .65rem;
}
.period-sep {
  color: var(--muted);
  font-size: .76rem;
  flex: 0 0 auto;
}

dialog {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  width: min(520px, 92vw);
  padding: 1rem;
}
dialog::backdrop { background: rgba(0,0,0,.55); }
.hint { color: var(--muted); font-size: .82rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .5rem; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  #map { height: 320px; min-height: 320px; }
}
