:root {
  --bg: #f6f5f3; --card: #ffffff; --ink: #17152b; --ink-2: #3b3850; --muted: #77748a; --line: #e9e6e1; --line-2: #f0eeea;
  --brand: #3b2f8f; --brand-2: #5a4bd1; --brand-soft: #efedfb; --brand-ink: #ffffff;
  --accent: #ff5a3c; --accent-2: #ff7a4d; --accent-soft: #fff1ec;
  --ok: #1f8a4c; --warn: #b26a00; --bad: #c0392b;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(23, 21, 43, .05), 0 4px 16px rgba(23, 21, 43, .06);
  --shadow-lg: 0 10px 30px rgba(23, 21, 43, .12);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 900px; margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.top { background: linear-gradient(120deg, #2a2070 0%, var(--brand) 45%, #5b3fb8 100%); color: var(--brand-ink); position: relative; }
.top .wrap { display: flex; align-items: center; gap: 10px; padding-top: 12px; padding-bottom: 12px; }
.logo { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 800; font-size: 18px; letter-spacing: -.01em; flex: 1; min-width: 0; }
.logo img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.logo span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top select { background: rgba(255,255,255,.14); color: inherit; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; padding: 6px 10px; cursor: pointer; }
.top select option { color: var(--ink); }
.top .btn-ghost { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28); color: #fff; padding: 6px 12px; font-size: 13px; }
.top .btn-ghost:hover { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.45); }
.tagline { margin: 0 auto; padding: 0 16px 14px; max-width: 900px; font-size: 14px; opacity: .85; }

/* Home: big title */
.home-hero { max-width: 1320px; margin: 0 auto; padding: 18px 24px 26px; }
.home-hero h1 { margin: 0; font-size: clamp(24px, 3.4vw, 38px); line-height: 1.15; letter-spacing: -.02em; font-weight: 800; }
.home-hero p { margin: 6px 0 0; opacity: .85; font-size: 15px; }

/* ---------- Buttons, chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 9px 15px; cursor: pointer; text-decoration: none; font-weight: 600; font-size: 14px; transition: border-color .15s, background .15s, box-shadow .15s, transform .1s; }
.btn:hover { border-color: #cfcbe8; box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn-main { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%); border-color: transparent; color: #fff; }
.btn-main:hover { border-color: transparent; box-shadow: 0 6px 18px rgba(255, 90, 60, .35); }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-now { width: 100%; font-size: 17px; padding: 14px; margin: 6px 0 10px; box-shadow: var(--shadow); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 13px; cursor: pointer; font-size: 13.5px; font-weight: 600; white-space: nowrap; color: var(--ink-2); transition: all .15s; }
.chip:hover { border-color: #cfcbe8; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Home layout: filters, list + sticky map ---------- */
.toolbar { max-width: 1320px; margin: -18px auto 0; padding: 0 24px; position: relative; z-index: 2; }
.toolbar-card { background: var(--card); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 14px; display: grid; gap: 12px; }
.toolbar-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.field { display: flex; flex-direction: column; justify-content: center; gap: 1px; border: 1px solid var(--line); border-radius: 14px; padding: 6px 12px; min-width: 140px; flex: 1 1 150px; background: #fff; transition: border-color .15s; }
.field:focus-within { border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--brand-soft); }
.field span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.field { cursor: pointer; }
.field input { border: 0; padding: 0; outline: none; background: transparent; font-weight: 600; font-size: 15px; min-width: 0; cursor: pointer; }
.toolbar .btn { padding: 10px 16px; }
.toolbar .btn-now-inline { flex: 1 1 220px; font-size: 15px; }
.layout { max-width: 1320px; margin: 0 auto; padding: 18px 24px 90px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.map-col { order: -1; min-width: 0; }
.layout > section, .list li { min-width: 0; }
#map { height: 42vh; min-height: 260px; border-radius: var(--radius); box-shadow: var(--shadow); z-index: 0; background: #e8e6e1; }
#map .leaflet-tile-pane { filter: saturate(.85) contrast(.98); }
@media (min-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: start; }
  .map-col { order: 0; position: sticky; top: 16px; }
  #map { height: calc(100vh - 32px); max-height: 860px; }
}
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 2px 6px; }
.list-head h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.count { color: var(--muted); font-size: 13px; font-weight: 600; }

/* Day groups + cards */
.day { margin: 16px 0 8px; display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 14px; color: var(--ink-2); text-transform: capitalize; }
.day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.day .tag { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 2px 8px; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.card { display: flex; gap: 14px; align-items: stretch; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; text-decoration: none; color: inherit;
  border: 1px solid transparent; transition: border-color .15s, box-shadow .15s, transform .15s; }
.card:hover, .card.hl { border-color: #d9d5f2; box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.datebox { flex: none; width: 58px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; background: var(--c, var(--brand)); text-align: center; line-height: 1.05; padding: 6px 0; }
.datebox b { font-size: 22px; font-weight: 800; }
.datebox small { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; opacity: .92; }
.card-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.kicker { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--c, var(--brand)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card h3 { overflow-wrap: anywhere; margin: 0; font-size: 16px; line-height: 1.3; letter-spacing: -.005em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.card .meta span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.card .meta .place { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 100%; min-width: 0; }
.thumb { flex: none; width: 96px; border-radius: 12px; object-fit: cover; background: var(--line-2); }
.free { font-size: 11px; font-weight: 800; color: var(--ok); background: #e8f6ee; border-radius: 6px; padding: 1px 6px; }

/* Old list items (My events) */
.item { display: flex; gap: 12px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; text-decoration: none; color: inherit; border: 1px solid transparent; }
a.item:hover { border-color: #d9d5f2; }
.item img, .item .ph { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; flex: none; background: var(--brand-soft); display: grid; place-items: center; font-size: 30px; }
.item h3 { margin: 0 0 2px; font-size: 16px; line-height: 1.3; }
.item .meta { font-size: 13px; color: var(--muted); }
.item .when { font-size: 13px; font-weight: 700; color: var(--accent); }
.live { display: inline-block; background: var(--accent); color: #fff; border-radius: 6px; font-size: 10.5px; font-weight: 800; padding: 1px 6px; margin-right: 6px; letter-spacing: .05em; vertical-align: 1px; }
.empty { color: var(--muted); text-align: center; padding: 34px 16px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.notice { background: var(--accent-soft); border: 1px solid #ffd9cc; border-radius: var(--radius); padding: 10px 14px; margin: 8px 0; }
.fab { position: fixed; right: 18px; bottom: 18px; z-index: 1000; padding: 13px 20px; font-size: 15px; box-shadow: 0 8px 24px rgba(255, 90, 60, .4); }

/* Footer */
.foot { border-top: 1px solid var(--line); background: #fff; }
.foot .in { max-width: 1320px; margin: 0 auto; padding: 22px 24px 90px; display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; }
.foot a { color: var(--ink-2); text-decoration: none; font-weight: 600; }
.foot a:hover { color: var(--brand); }

/* ---------- Event page ---------- */
.hero { width: 100%; max-height: 420px; object-fit: cover; border-radius: 20px; display: block; margin-top: 14px; box-shadow: var(--shadow); }
.hero-ph { height: 160px; border-radius: 20px; background: linear-gradient(135deg, var(--c, var(--brand)) 0%, #17152b 140%); display: grid; place-items: center; font-size: 64px; margin-top: 14px; box-shadow: var(--shadow); }
.ev { max-width: 760px; }
.ev h1 { margin: 14px 0 6px; font-size: 30px; line-height: 1.18; letter-spacing: -.02em; }
.ev .cat { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--c, var(--brand)); margin-top: 16px; }
.ev .time { font-size: 18px; font-weight: 700; color: var(--accent); margin: 8px 0 2px; }
.ev .addr { color: var(--muted); margin: 2px 0 10px; }
.ev .desc { white-space: pre-line; font-size: 16px; color: var(--ink-2); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.tips { display: grid; gap: 10px; margin: 16px 0; }
.tip { background: var(--card); border-left: 4px solid var(--brand); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow); }
.tip.avoid { border-left-color: var(--bad); }
.tip b { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }
.mini-map { height: 240px; border-radius: var(--radius); margin: 14px 0; z-index: 0; box-shadow: var(--shadow); }
.small { font-size: 13px; color: var(--muted); }
.linkbtn { background: none; border: 0; color: var(--brand); padding: 0; cursor: pointer; text-decoration: underline; font-size: 13px; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 14px; margin: 14px 0 60px; }
.form label { display: grid; gap: 5px; font-weight: 700; font-size: 14px; }
.form input, .form select, .form textarea { padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-weight: 400; width: 100%; transition: border-color .15s, box-shadow .15s; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--brand-soft); }
.form textarea { min-height: 110px; resize: vertical; }
.form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .pick-map { height: 300px; border-radius: var(--radius); z-index: 0; }
.form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 12px; background: #fff; }
.form legend { font-weight: 800; padding: 0 6px; }
.hp { position: absolute; left: -9999px; }
.msg { padding: 11px 14px; border-radius: 12px; }
.msg.ok { background: #e8f6ee; color: var(--ok); }
.msg.err { background: #fdecea; color: var(--bad); }
.status { font-size: 12px; font-weight: 800; border-radius: 6px; padding: 2px 8px; }
.status.pending { background: #fff4e0; color: var(--warn); }
.status.approved { background: #e8f6ee; color: var(--ok); }
.status.rejected { background: #fdecea; color: var(--bad); }

/* ---------- Map pins ---------- */
.pin { font-size: 17px; line-height: 32px; text-align: center; width: 36px; height: 36px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--c, var(--brand)); box-shadow: 0 3px 8px rgba(0,0,0,.28); border: 2px solid #fff; transition: transform .15s; }
.pin > i { display: inline-block; transform: rotate(45deg); font-style: normal; }
.pin.hl { transform: rotate(-45deg) scale(1.3); z-index: 1000; }
.pin.live { animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,90,60,.6); } 100% { box-shadow: 0 0 0 14px rgba(255,90,60,0); } }
.me-dot { width: 16px; height: 16px; border-radius: 50%; background: #2b7bff; border: 3px solid #fff; box-shadow: 0 0 0 2px #2b7bff, 0 0 0 10px rgba(43,123,255,.15); }
.leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: var(--shadow-lg); }
.leaflet-popup-content { margin: 12px 14px; font: 13px/1.45 var(--font); }
.leaflet-popup-content b { font-size: 14px; }

@media (max-width: 640px) {
  .home-hero { padding: 12px 16px 26px; }
  .toolbar, .layout { padding-left: 16px; padding-right: 16px; }
  .toolbar-card { padding: 12px; border-radius: 18px; }
  .field { flex: 1 1 120px; min-width: 0; }
  .thumb { width: 72px; }
  .datebox { width: 52px; }
  .form .row2 { grid-template-columns: 1fr; }
  .ev h1 { font-size: 24px; }
  .top .btn-ghost .lbl { display: none; }
}

/* Landmarks on the map */
.sight { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 1px solid #d8d4ce; display: grid; place-items: center; font-size: 13px; box-shadow: 0 1px 4px rgba(0,0,0,.18); opacity: .92; }
.leaflet-tooltip.sight-label { background: rgba(255,255,255,.92); border: 0; box-shadow: 0 1px 4px rgba(0,0,0,.15); border-radius: 8px; padding: 2px 7px; font: 700 11.5px/1.3 var(--font); color: var(--ink-2); display: none; }
.leaflet-tooltip.sight-label::before { display: none; }
.sight-names .leaflet-tooltip.sight-label { display: block; }
.map-toggle { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; font: 700 12.5px var(--font); cursor: pointer; box-shadow: var(--shadow); color: var(--muted); }
.map-toggle.on { color: var(--ink); border-color: #cfcbe8; }

/* Quick filters */
.chip.quick { border-style: dashed; }
.chip.quick.on { background: var(--accent); border-color: var(--accent); border-style: solid; color: #fff; }

.top .btn-ghost.on { background: #fff; color: var(--brand); }

/* Partner offer */
.partner { display: grid; gap: 4px; position: relative; text-decoration: none; color: #fff; margin: 0 0 12px; padding: 14px 16px; border-radius: var(--radius);
  background: linear-gradient(120deg, #0b7285 0%, #1098ad 55%, #15aabf 100%); box-shadow: var(--shadow); }
.partner b { font-size: 16px; }
.partner span { font-size: 14px; opacity: .95; }
.partner .go { font-weight: 800; opacity: 1; margin-top: 2px; }
.partner .tag { position: absolute; top: 10px; right: 12px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; background: rgba(255,255,255,.22); border-radius: 999px; padding: 1px 8px; }

/* Category, quick-filter and city buttons: on wider screens they wrap onto more lines so every label is readable;
   on phones they scroll sideways, without the fading edge that hid the last one */
.chips { -webkit-mask-image: none; mask-image: none; padding-right: 8px; }
@media (min-width: 641px) {
  .chips { flex-wrap: wrap; overflow: visible; }
}
.field select { border: 0; padding: 0; outline: none; background: transparent; font-weight: 600; font-size: 15px; min-width: 0; cursor: pointer; width: 100%; }
