*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #f7f5f2;
  --surface:      #ffffff;
  --border:       #d6d3cc;
  --text:         #1a1917;
  --muted:        #6b6860;
  --accent:       #2d6a4f;
  --accent-light: #d8f3dc;
  --danger:       #c0392b;
  --radius:       6px;
  --shadow:       0 1px 4px rgba(0,0,0,.12), 0 0 0 0.5px rgba(0,0,0,.08);
  --mono:         'IBM Plex Mono', monospace;
  --sans:         'IBM Plex Sans', sans-serif;
  --sidebar-width: 350px;
}

html, body {
  height: 100%;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
}

/* ── Utility classes ─────────────────────────────────────────────────────── */

.hidden {
  display: none !important;
}

/* ── Map ─────────────────────────────────────────────────────────────────── */

#map {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0; /* overridden when sidebar visible via --sidebar-width */
  z-index: 0;
}

.leaflet-control-zoom { display: none; }
.leaflet-control-attribution { display: none; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */

/* Sidebar & search panel */
#left-panel {
  position: fixed;
  left: 0px;
  width: var(--sidebar-width, 350px);
  display: flex;
  flex-direction: column;
  gap: 0px;
  z-index: 150;
  overflow: scroll;
  max-height: 100%;
  max-height: calc(100vh - 38px);
}

#search-panel {
  background: var(--surface);
  border: 0.5px solid var(--border);
  padding: 10px 12px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}

#search-panel #top-search {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#search-panel #top-search:focus {
  border-color: var(--accent);
}

#search-panel #top-search-actions {
  display: flex;
  gap: 8px;
}

#search-panel #top-search-actions .action-btn {
  width: 38px;
  height: 38px;
}

#sidebar {
  position: relative;
  display: none;
  width: 100%;
  background: var(--surface);
  border: 0.5px solid var(--border);
  box-shadow: var(--shadow);
  flex-direction: column;
  flex: 1;
}

#panel-window-content {
  max-width: var(--sidebar-width, 350px);
}

#panel-window {
  position: fixed;
  left: 0px;
  width: var(--sidebar-width, 350px);
  /* display: flex; */
  /* flex-direction: column; */
  /* gap: 0px; */
  z-index: 300;
  overflow: scroll;
  max-height: 100%;
  height: 100%;
}

#panel-container {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

#close-sidebar, #panel-window-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0.5px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
}

#close-sidebar:hover {
  border-color: #999;
  color: var(--text);
}

/* Filters */
#filters {
  padding: 12px;
  border-bottom: 0.5px solid var(--border);
  flex-shrink: 0;
  display: none;
}

#type-filters {
  display: flex; gap: 8px; align-items: center; margin-bottom: 8px;
}
#type-filters label {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 0.5px solid var(--border);
  padding: 6px 8px; border-radius: 8px; color: var(--muted);
  font-size: 13px;
}
#type-filters input { width: 16px; height: 16px; }

#price-filters { display:flex; flex-direction:column; gap:8px; align-items:flex-start; margin-bottom:8px; }
#price-filters label { display:inline-flex; align-items:center; gap:8px; background:var(--surface); border:0.5px solid var(--border); padding:6px 8px; border-radius:8px; color:var(--muted); font-size:13px; }
#price-range { display:flex; align-items:center; gap:6px; margin-left:0; }
#price-range input { width:80px; padding:6px 8px; border:0.5px solid var(--border); border-radius:6px; background:var(--bg); }

#date-filters { display:flex; flex-direction:column; gap:8px; margin-bottom:8px; }
#date-filters .date-markers { display:flex; gap:8px; }
.date-marker { display:flex; flex-direction:column; gap:4px; flex:1; background:var(--surface); border:0.5px solid var(--border); border-radius:8px; padding:10px 12px; color:var(--muted); font-size:13px; }
.date-marker span { font-size:12px; color:var(--muted); }
.date-marker input[type="date"] { width:100%; border:none; outline:none; background:transparent; color:var(--text); font-family:inherit; font-size:13px; padding:8px 0 6px; cursor:pointer; }
.date-slider { position: relative; height: 42px; }
.date-slider-track { position: relative; width: 100%; height: 6px; margin: 18px 0 0; background: var(--border); border-radius: 999px; }
.date-slider-range { position: absolute; top: 0; left: 0; height: 100%; background: var(--accent); border-radius: 999px; }
.date-thumb { position: absolute; top: 50%; width: 18px; height: 18px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.2); cursor: grab; }
.date-thumb:active { cursor: grabbing; }
.date-thumb:focus { outline: none; box-shadow: 0 0 0 4px rgba(45,106,79,.2); }

#filters.open {
  display: block;
}

#filters.collapsed {
  display: none;
}

#search-results-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 8px;
  padding-right: 52px;
  border-bottom: 0.5px solid var(--border);
}

#search-results-header.active {
  display: flex;
}

#search-actions {
  display: flex;
  gap: 8px;
}

.action-btn {
  width: 38px; height: 38px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.action-btn:hover {
  border-color: #999;
  color: var(--text);
}

#search-results-header.active {
  display: flex;
}

#events-list.search-active #events-list-label {
  display: none;
}

.search-results-close {
  width: 28px; height: 28px;
  border: 0.5px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.search-results-close:hover {
  color: var(--text);
  border-color: #999;
}

.section-label {
  font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .6px;
  font-family: var(--mono); margin-bottom: 8px;
}

.cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.cat-btn {
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 6px 8px;
  font-size: 12px; font-family: var(--sans);
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: all .12s;
  line-height: 1.2;
  display: flex; align-items: center; gap: 5px;
}
.cat-btn:hover { border-color: #999; color: var(--text); }
.cat-btn.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}
.cat-icon { font-size: 13px; }

/* Events list */
#events-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

#events-list.collapsed {
  display: none;
}

#events-list-label {
  display: none;
}

.event-card {
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 7px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
  background: var(--surface);
}
.event-card:hover { border-color: #999; background: var(--bg); }
.event-card.highlighted { border-color: var(--accent); background: var(--accent-light); }

.event-date {
  display: block;
  font-size: 10px; color: var(--muted);
  font-family: var(--mono); margin-bottom: 4px;
}
.event-title {
  font-size: 13px; font-weight: 500; line-height: 1.3;
  margin-bottom: 4px; color: var(--text);
}
.event-place {
  font-size: 11px; color: var(--muted);
  display: flex; align-items: center; gap: 4px;
  margin-bottom: 5px;
}
.event-meta { display: flex; flex-wrap: wrap; gap: 4px; }

.badge {
  display: inline-block; font-size: 10px;
  padding: 2px 7px; border-radius: 20px;
  background: #eee; color: var(--muted); font-weight: 500;
}
.badge-free { background: var(--accent-light); color: var(--accent); }
.badge-cat { background: #f0eef8; color: #5a4a8a; }

.empty-state { font-size: 13px; color: var(--muted); padding: 12px 0; text-align: center; }

/* ── Top-right controls ──────────────────────────────────────────────────── */

#top-right {
  position: fixed;
  top: 12px; right: 12px;
  z-index: 100;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.map-btn {
  display: flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px; font-family: var(--sans);
  color: var(--text); cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color .12s;
  white-space: nowrap;
}
.map-btn:hover { border-color: #999; }
.map-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.map-btn.primary:hover { background: #245c43; }

/* User dropdown */
#user-menu { position: relative; }

.dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 160px;
  overflow: hidden;
}
.dropdown-item {
  display: block; width: 100%;
  padding: 9px 14px;
  font-size: 13px; font-family: var(--sans);
  color: var(--text); text-decoration: none;
  background: none; border: none; text-align: left;
  cursor: pointer; transition: background .1s;
}
.dropdown-item:hover { background: var(--bg); }
.dropdown-item.danger { color: var(--danger); }

/* ── Zoom ────────────────────────────────────────────────────────────────── */

#zoom {
  position: fixed; right: 12px; bottom: 40px; z-index: 100;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
  border-radius: var(--radius); overflow: hidden;
  border: 0.5px solid var(--border);
}
.zoom-btn {
  width: 34px; height: 34px;
  background: var(--surface); border: none;
  font-size: 18px; cursor: pointer; color: var(--text);
  transition: background .12s;
  border-bottom: 0.5px solid var(--border);
}
.zoom-btn:last-child { border-bottom: none; }
.zoom-btn:hover { background: var(--bg); }

/* Scale + attribution */
#scale {
  position: fixed; left: 296px; bottom: 20px; z-index: 100;
  font-size: 10px; color: var(--muted); font-family: var(--mono);
  background: rgba(255,255,255,.88); padding: 3px 8px;
  border-radius: 3px; border: 0.5px solid var(--border);
  display:none;
}
#attr {
  position: fixed; right: 12px; bottom: 12px; z-index: 100;
  font-size: 10px; color: var(--muted);
  background: rgba(255,255,255,.8); padding: 2px 6px; border-radius: 3px;
}
#attr a { color: var(--muted); text-decoration: none; }
#attr a:hover { text-decoration: underline; }

/* ── Auth Modal ──────────────────────────────────────────────────────────── */

#overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(26,25,23,.45);
  display: none; align-items: center; justify-content: center;
}
#overlay.open { display: flex; }

#modal-wrap { position: relative; }

#modal {
  width: 360px;
  background: var(--surface);
  border-radius: 10px;
  border: 0.5px solid var(--border);
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  overflow: hidden;
}

#modal-tabs { display: flex; border-bottom: 0.5px solid var(--border); }

.tab {
  flex: 1; padding: 14px;
  font-size: 13px; font-weight: 500; font-family: var(--sans);
  background: none; border: none; cursor: pointer; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -0.5px;
  transition: all .15s;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

#modal-body { padding: 20px; }

.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 11px; color: var(--muted);
  margin-bottom: 5px; font-family: var(--mono);
  text-transform: uppercase; letter-spacing: .3px;
}
.field input {
  width: 100%; height: 36px;
  border: 0.5px solid var(--border); border-radius: var(--radius);
  padding: 0 10px; font-size: 14px; font-family: var(--sans);
  color: var(--text); background: var(--bg);
  outline: none; transition: border-color .15s;
}
.field input:focus { border-color: var(--accent); }

.btn-full {
  width: 100%; height: 38px;
  border-radius: var(--radius); border: none;
  font-size: 14px; font-weight: 500; font-family: var(--sans);
  cursor: pointer; transition: all .15s; margin-bottom: 10px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #245c43; }
.btn-google {
  background: var(--surface); color: var(--text);
  border: 0.5px solid var(--border) !important;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-google:hover { background: var(--bg); }

.divider {
  display: flex; align-items: center; gap: 8px;
  margin: 12px 0; color: var(--muted); font-size: 12px;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 0.5px; background: var(--border);
}

.modal-close {
  position: absolute; top: -36px; right: 0;
  width: 28px; height: 28px;
  background: rgba(255,255,255,.9); border: 0.5px solid var(--border);
  border-radius: 50%; cursor: pointer; color: var(--muted);
  font-size: 14px; display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: var(--text); }

.form-err {
  font-size: 12px; color: var(--danger);
  margin-top: -8px; margin-bottom: 10px;
  min-height: 16px;
}

/* ── Page layout (не-картові сторінки) ──────────────────────────────────── */

.page-body {
  background: var(--bg);
  min-height: 100vh;
  overflow: auto;
}

.page-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--surface);
  border-bottom: 0.5px solid var(--border);
  display: flex; flex-direction: column;
}

.header-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0px 8px;
  height: 38px;
}

.header-left { display: flex; align-items: center; gap: 16px; }
.header-logo { font-weight: 700; font-size: 16px; color: var(--text); text-decoration: none; }
.header-nav { display: flex; gap: 12px; align-items: center; }
.header-right { display: flex; align-items: center; gap: 12px; }

.header-bottom { padding: 6px 20px 10px; }
.top-search-left { display: flex; align-items: center; gap: 8px; }
#top-search { height: 36px; padding: 0 12px; border: 0.5px solid var(--border); border-radius: 6px; min-width: 360px; background: var(--surface); box-shadow: var(--shadow); }
#top-search-actions { display:flex; gap:8px; }
#top-search .action-btn, #top-search-actions .action-btn { width:36px; height:36px; }

/* make header-bottom visually separate from topbar */
.header-top { background: var(--surface); }
.header-bottom { background: transparent; }

/* Sidebar visibility: hidden by default, shown when body has .sidebar-visible */
#sidebar { display: none; }
body.sidebar-visible #sidebar { display: flex; }

#scale { left: calc(12px + var(--sidebar-width, 350px) + 20px); }


.header-logo {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--text);
  font-size: 15px; font-weight: 600; letter-spacing: -.3px;
}
.header-logo svg { width: 24px; height: 24px; }

.header-nav {
  display: flex; align-items: center; gap: 12px;
}

.nav-link {
  font-size: 13px; color: var(--muted);
  text-decoration: none; background: none; border: none;
  cursor: pointer; font-family: var(--sans); padding: 4px 0;
  transition: color .12s;
}
.nav-link:hover { color: var(--text); }
.btn-reset { background: none; border: none; cursor: pointer; }

.nav-user {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--text);
}
.nav-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  object-fit: cover; border: 1px solid var(--border);
}

.page-main {
  max-width: 1000px; margin: 0 auto;
  padding: 15px;
}

/* ── Event form ──────────────────────────────────────────────────────────── */

.form-page {}

.form-header { margin-bottom: 28px; }
.form-title { font-size: 22px; font-weight: 600; margin-bottom: 6px; }
.form-subtitle { font-size: 14px; color: var(--muted); }

.event-form {}

.form-section {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); margin-bottom: 16px;
  font-family: var(--mono);
}

.field {
  display: flex; flex-direction: column; gap: 5px;
  margin-bottom: 14px;
}
.field:last-child { margin-bottom: 0; }
.field-full { width: 100%; }

.field-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin-bottom: 14px;
}

.field label {
  font-size: 12px; color: var(--muted);
  font-family: var(--mono); text-transform: uppercase;
  letter-spacing: .3px;
}
.required { color: var(--danger); }

.field input,
.field select,
.field textarea {
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0 10px; height: 36px;
  font-size: 14px; font-family: var(--sans);
  color: var(--text); background: var(--bg);
  outline: none; transition: border-color .15s;
  width: 100%;
}
.field textarea {
  height: auto; padding: 8px 10px;
  resize: vertical; line-height: 1.5;
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--accent); }
.field input.field-invalid { border-color: var(--danger); }
.field input.field-success { border-color: var(--accent); background-color: var(--accent-light); }

.field-err { font-size: 11px; color: var(--danger); min-height: 14px; }
.field-hint { font-size: 11px; color: var(--muted); }

.checkbox-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; cursor: pointer; color: var(--text);
}
.checkbox-label input[type="checkbox"] {
  width: 16px; height: 16px; cursor: pointer;
  accent-color: var(--accent);
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.radio-label:hover {
  border-color: var(--accent);
  background: var(--bg);
}

.radio-label input[type="radio"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
  margin: 0;
}

.radio-label input[type="radio"]:focus-visible {
  outline: 2px solid rgba(45, 106, 79, 0.25);
  outline-offset: 2px;
}

.input-with-btn {
  display: flex; gap: 8px;
}
.input-with-btn input { flex: 1; }

/* Мінімапа */
.location-map-wrap {
  margin-top: 12px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
#location-map, #calendar-map { height: 220px; }
.map-hint { font-size: 11px; color: var(--muted); padding: 6px 10px; background: var(--bg); }

/* Image preview */
.image-preview {
  margin-top: 8px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  max-height: 200px;
}
.image-preview img {
  width: 100%; height: 200px;
  object-fit: cover; display: block;
}

/* Form footer */
.form-footer {
  margin-top: 8px;
}
.form-notice {
  font-size: 13px; color: var(--muted);
  margin-bottom: 16px; line-height: 1.5;
}
.form-notice a { color: var(--accent); }
.form-err { font-size: 13px; color: var(--danger); margin-bottom: 12px; min-height: 18px; }

.form-actions {
  display: flex; align-items: center;
  justify-content: flex-end; gap: 10px;
}

.btn-primary {
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius);
  padding: 5px;
  font-size: 14px; font-weight: 500; font-family: var(--sans);
  cursor: pointer; transition: background .15s;
}
.btn-primary:hover:not(:disabled) { background: #245c43; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary.btn-large { height: 42px; padding: 0 28px; font-size: 15px; }

.btn-secondary {
  background: var(--surface); color: var(--text);
  border: 0.5px solid var(--border); border-radius: var(--radius);
  padding: 0 16px; height: 36px;
  font-size: 13px; font-family: var(--sans);
  cursor: pointer; transition: border-color .12s;
  text-decoration: none; display: inline-flex; align-items: center;
}
.btn-secondary:hover { border-color: #999; }

#add-event-button {
	color: white;
	background: #5da13e;
	padding: 5px;
	border-radius: 8px;
}

.tab-nav {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.tab-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 10px;
  border: 0.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  transition: border-color .15s, background .15s;
}

.tab-link.active {
  border-color: var(--accent);
  background: rgba(45, 106, 79, 0.08);
}

.tab-panel {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 22px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.view-toggle {
  display: flex;
  gap: 8px;
}

.tab-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 0.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
}

.tab-pill.active {
  background: rgba(45, 106, 79, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

.calendar-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
}

.calendar-tag,
.calendar-info {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--bg);
  border: 0.5px solid var(--border);
  font-size: 13px;
  color: var(--text);
}

.calendar-events-empty {
  padding: 28px 18px;
  border: 0.5px dashed var(--border);
  border-radius: 12px;
  text-align: center;
  color: var(--muted);
}

.calendar-events-empty p {
  margin: 0 0 10px;
}

.form-section input[disabled],
.form-section textarea[disabled] {
  opacity: 0.85;
  background: var(--bg);
}

.form-section textarea {
  min-height: 120px;
}

.event-menu-container {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
}

.event-menu-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  min-width: 240px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  z-index: 1000;
  display: none;
}

.event-menu-dropdown.active {
  display: block;
}

.event-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 0.5px solid var(--border);
  transition: background .12s;
  cursor: pointer;
  font-size: 14px;
}

.event-menu-item:last-child {
  border-bottom: none;
}

.event-menu-item:hover {
  background: var(--bg);
}

.event-menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(45, 106, 79, 0.1);
  color: var(--accent);
  font-size: 13px;
  flex-shrink: 0;
}

/* Event page */
.page-main .event-page {
  display: flex;
  flex-wrap: wrap;
  margin: 0 auto;
}

  .event-page {
    max-width: 100%;
  }

  .event-summary {
    grid-template-columns: 1fr;
  }

  .event-description-block,
  .event-map-block,
  .event-secondary {
    margin-top: 0;
  }

.event-main,
.event-secondary {
  background: var(--surface);
  border: 0.5px solid var(--border);
  padding: 24px;
}

.event-main {
      flex: 1 1 350px; /* grow, shrink, basis */
}

.event-secondary {
      flex: 1 1 200px; /* grow, shrink, basis */
}

#panel-window .event-secondary {
      margin-bottom: 200px;
}

.event-header {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 28px;
}

.event-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.event-heading {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.05;
  max-width: 100%;
  overflow-wrap: break-word;
}

.event-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text);
  color: gray;
  text-decoration: none;
}

.icon-btn:hover {
  color: black;
}

.event-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.event-pill {
  font-size: 13px;
  color: var(--muted);
}

.event-summary {
  display: grid;
  gap: 18px;
  align-items: start;
  margin-bottom: 28px;
}

.event-summary-card,
.event-price-card {
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.event-summary-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.event-summary-item:last-child {
  margin-bottom: 0;
}

.event-summary-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--accent);
  border: 0.5px solid var(--border);
  flex-shrink: 0;
}

.event-summary-icon i {
  font-size: 14px;
}

.event-summary-label,
.event-price-label {
  text-transform: uppercase;
  letter-spacing: .4px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  font-family: var(--mono);
}

.event-summary-value,
.event-price-value {
  font-size: 16px;
  color: var(--text);
  line-height: 1.5;
}

.event-price-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: space-between;
}

.event-ticket-btn {
  align-self: flex-start;
}

.event-description-block {
  margin-bottom: 28px;
}

.section-heading {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .2px;
  margin-bottom: 14px;
}

.event-description-text {
  line-height: 1.75;
  color: var(--text);
}

.event-map-block {
  margin-bottom: 0;
}

.event-map-placeholder {
  height: 240px;
  border-radius: 16px;
  border: 0.5px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--bg);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-size: 14px;
}

.event-secondary-item {
  margin-bottom: 16px;
}

.event-secondary-item:last-child { margin-bottom: 0; }

.event-secondary-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  font-family: var(--mono);
  margin-bottom: 10px;
}

.event-secondary-value {
  font-size: 15px;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 8px;
}

.event-secondary-text {
  line-height: 1.6;
  color: var(--muted);
}

.event-creator-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.event-creator-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.event-creator-avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.event-creator-info {
  display: flex;
  flex-direction: column;
}

.event-creator-name {
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
}

.event-creator-anonymous {
  color: var(--muted);
  font-size: 14px;
}

.event-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.event-pill i {
  font-size: 13px;
  color: var(--accent);
}

/* Calendar show page */
.calendar-page { max-width: 980px; margin: 0 auto; padding: 28px; }
.calendar-sidebar { position: sticky; top: 88px; }
.events-list { display:flex; flex-direction:column; gap:10px; }
.calendar-sidebar .btn-primary { padding: 8px 12px; height:36px; }

@media (max-width: 900px) {
  .calendar-page { padding: 18px; flex-direction:column; }
  .calendar-sidebar { width:100%; position:static; }
}

/* keep calendar title links visually like plain text */
.event-title a { color: inherit; text-decoration: none; }
.event-title a:hover { text-decoration: underline; }

/* clickable card overlay */
/* overlay removed — cards are not fully clickable */

a {
	text-decoration: none;
}
