/* World of O Calendar – recognisable from the old cal.worldofo.com (blue background, banner, menu,
   compact table with the old icons), modernised. Phone layout below 640 px. */
:root {
  --sky: #55adff;           /* the old page background */
  --ink: #1b2430;
  --muted: #5f6b7a;
  --line: #e3e8ef;
  --link: #0b4fc4;
  --blue: #0b5bd3;
  --tint: #eef5ff;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--sky); color: var(--ink); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Verdana, sans-serif; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { border: 0; }
[hidden] { display: none !important; }

.page { max-width: 1040px; margin: 20px auto; background: #fff; border-radius: 12px; box-shadow: 0 6px 30px rgba(0, 40, 90, .25); overflow: hidden; }
.top { background: #fff; }
.banner { width: 100%; height: auto; display: block; }

.rest { display: flex; gap: 24px; padding: 16px 20px 0; align-items: flex-start; }
.maincol { flex: 1; min-width: 0; }
.rightcol { flex: none; width: 210px; }

/* control row: Filters button · events.worldofo.com switch · views; then count + chips; filter panel */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.fbtn { height: 34px; padding: 0 14px; border: 1px solid #c8d1dc; border-radius: 8px; background: #fff; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; }
.fbtn::before { content: ""; display: inline-block; width: 12px; height: 9px; margin-right: 7px; vertical-align: 0;
  background: linear-gradient(var(--ink), var(--ink)) 0 0 / 12px 1.6px no-repeat, linear-gradient(var(--ink), var(--ink)) 2px 3.7px / 8px 1.6px no-repeat, linear-gradient(var(--ink), var(--ink)) 4px 7.4px / 4px 1.6px no-repeat; }
.fbtn b { display: inline-block; min-width: 18px; height: 18px; line-height: 18px; margin-left: 4px; border-radius: 9px; background: var(--blue); color: #fff; font-size: 11px; text-align: center; }
.fbtn[aria-expanded="true"] { border-color: var(--blue); color: var(--blue); }
.more { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.seg, .views { display: inline-flex; border: 1px solid #c8d1dc; border-radius: 8px; overflow: hidden; }
.seg a, .views a { padding: 6px 11px; font-size: 13px; color: var(--ink); background: #fff; white-space: nowrap; }
.seg a + a, .views a + a { border-left: 1px solid #c8d1dc; }
.seg a:hover, .views a:hover { text-decoration: none; background: var(--tint); }
.seg a.on, .views a.on { background: var(--blue); color: #fff; }
.views { margin-left: auto; }
.nearbtn { display: inline-block; padding: 3px 10px; font-size: 13px; color: var(--link); background: #fff; border: 1px solid #c8d1dc; border-radius: 999px; white-space: nowrap; }
.nearbtn:hover { text-decoration: none; background: var(--tint); }
.nearbtn.on { background: var(--tint); border-color: var(--blue); color: var(--blue); }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 8px; }
.count { color: var(--muted); font-size: 13px; margin-right: 4px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px 3px 10px; border-radius: 999px; background: var(--tint); color: #0b3d91; font-size: 13px; }
.chip span { display: inline-block; width: 16px; height: 16px; line-height: 16px; text-align: center; border-radius: 8px; background: #c9dcfb; font-size: 10px; }
.chip:hover { text-decoration: none; background: #dce9ff; }
.chips .note { font-size: 12px; color: #b3261e; }
.listmap { height: 560px; border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 6px; background: #e8eef2; }
.legend { font-size: 12px; color: var(--ink); margin: 0 0 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.legend .li { white-space: nowrap; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #c8d1dc; margin-left: 6px; }
.dot.cal { background: #0b5bd3; } .dot.wre { background: #e2591b; } .dot.ext { background: #8a96a6; }
.mc { background: rgba(11, 91, 211, .22); border-radius: 50%; }
.mc span { position: absolute; inset: 4px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #0b5bd3; color: #fff; font: 600 12px/1 system-ui, sans-serif; }

/* filter panel: a box under the control row on wide screens, a full-screen sheet on phones */
.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; padding: 12px; margin: 0 0 12px; background: #f6f8fb; border: 1px solid var(--line); border-radius: var(--radius); }
.filters label { display: flex; flex-direction: column; gap: 3px; }
.filters label.grow { flex: 1; min-width: 160px; }
.filters label.chk { flex-direction: row; align-items: center; gap: 6px; height: 36px; font-size: 13px; }
.ftit { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.filters select, .filters input[type=date], .filters input[type=search] {
  font: inherit; font-size: 14px; height: 36px; padding: 4px 8px; border: 1px solid #c8d1dc; border-radius: 6px; background: #fff; color: var(--ink); }
.sheethead { display: none; }
.show { height: 36px; padding: 0 18px; border: 0; border-radius: 6px; background: var(--blue); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.show:hover { background: #0948a8; }
.addbtn { display: inline-block; padding: 8px 16px; border-radius: 8px; background: var(--blue); color: #fff; font-weight: 600; }
.addbtn:hover { text-decoration: none; background: #0948a8; }

/* the event list */
.evlist { width: 100%; border-collapse: collapse; }
.evlist td { padding: 7px 6px; vertical-align: middle; border-bottom: 1px solid var(--line); }
.evlist tr.mon td { background: #d6e9fd; color: #0b3d91; border-top: 3px solid var(--sky); border-bottom: 0; padding: 7px 10px; font-size: 15px; font-weight: 700; }
.evlist tr.mon + tr td { border-top: 0; }
.evlist tr.ev:hover td { background: #f7faff; }
.evlist .dt { white-space: nowrap; width: 1%; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.evlist .nm a { font-weight: 600; }
.evlist .sub { display: none; }
.evlist .co { white-space: nowrap; width: 1%; }
.evlist .pl { color: var(--muted); }
.evlist .ic { white-space: nowrap; text-align: right; width: 1%; }
.evlist .ic img, .evlist .ic a { vertical-align: middle; margin-left: 4px; }
.flag { width: 18px; height: 12px; vertical-align: -1px; margin-right: 6px; border: 1px solid #d4dae2; border-radius: 2px; }

/* rows from events.worldofo.com */
.evlist tr.ext td { color: var(--muted); background: #fbfbfc; }
.evlist tr.ext .nm a { color: #4a5f86; font-weight: 500; }
.evlist tr.ext .x { font-size: 12px; color: #8a96a6; }
.evlist .src { font-size: 11px; color: var(--muted); border: 1px solid #d4dae2; border-radius: 4px; padding: 1px 5px; white-space: nowrap; background: #fff; }
.extnote { font-size: 12px; color: var(--muted); margin: 8px 0; }

/* "With maps" view: a thumbnail column in the same compact table */
.evlist .tm { width: 1%; padding: 4px 6px; }
.evlist .tm a { position: relative; display: block; width: 104px; height: 52px; border-radius: 5px; overflow: hidden; border: 1px solid #c8d1dc; background: #f0f2f5; }
.evlist .tm img { width: 100%; height: 100%; object-fit: cover; display: block; }
.evlist .tm a span { position: absolute; left: 0; right: 0; bottom: 0; padding: 1px 4px; font-size: 10px; font-weight: 600; color: #fff; background: rgba(20, 30, 45, .55); }
.evlist .facts { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.evlist .from { font-size: 11px; color: #8a96a6; font-style: italic; white-space: nowrap; }
.evlist .nm { min-width: 230px; }
.evlist .pl { max-width: 170px; }
.seg.when a { padding: 3px 10px; }

.empty { padding: 24px 0; }
.pager { text-align: center; font-weight: 600; margin: 16px 0; }
.addline { margin: 14px 0 0; }

/* right column */
.box { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 14px; font-size: 13px; }
.box h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 8px; color: var(--muted); }
.box p { margin: 6px 0 0; }
.news ul { list-style: none; margin: 0; padding: 0; }
.news li { padding: 7px 0; border-top: 1px solid var(--line); line-height: 1.35; }
.news li:first-child { border-top: 0; padding-top: 0; }
.news .nd { display: block; color: #8a96a6; font-size: 11px; margin-bottom: 1px; }
.sponsors .addiv { margin-bottom: 10px; color: #3c4756; }
.sponsors .adlink { font-weight: 600; margin: 2px 0; }

/* event page of an events.worldofo.com event */
.races { width: 100%; border-collapse: collapse; }
.races td { padding: 6px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.races .rd { white-space: nowrap; color: var(--muted); width: 1%; }
.races .rl { white-space: nowrap; text-align: right; }
.muted { color: var(--muted); }
.actions { margin: 4px 0 12px; }
.omaps.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.omaps.grid a { margin: 0; }

/* event page */
.single { padding-bottom: 12px; }
.crumbs { margin: 0 0 8px; font-size: 13px; }
.event h1 { font-size: 26px; color: #0b3d91; margin: 0 0 4px; line-height: 1.2; }
.event h1 img { vertical-align: middle; }
.event .lead { font-size: 15px; margin: 0 0 16px; color: #3c4756; }
.event h3 { font-size: 16px; color: #0b3d91; margin: 20px 0 8px; }
.evgrid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; }
.evdetails { width: 100%; border-collapse: collapse; }
.evdetails th, .evdetails td { text-align: left; vertical-align: top; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.evdetails th { width: 170px; font-weight: 600; color: var(--muted); font-size: 13px; }
.evdetails td { overflow-wrap: anywhere; }
.gallery { display: flex; flex-wrap: wrap; gap: 10px; }
.gallery img { height: 170px; width: auto; max-width: 100%; border-radius: 6px; border: 1px solid #c8d1dc; display: block; }
.evmap { height: 280px; border-radius: var(--radius); border: 1px solid var(--line); }
.maplinks { font-size: 13px; margin: 6px 0 0; }
.omaps a { display: block; margin-bottom: 10px; color: var(--ink); }
.omaps img { width: 100%; aspect-ratio: 3 / 1; object-fit: cover; border-radius: 6px; border: 1px solid #c8d1dc; display: block; background: #f0f2f5; }
.omaps span { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.omaps b { color: var(--link); font-weight: 600; }
.small { font-size: 12px; color: var(--muted); }
.related { margin: 0; padding-left: 18px; }
.related li { margin: 3px 0; }

/* map hint + full screen */
.maphint { position: absolute; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; text-align: center;
  background: rgba(20, 30, 45, .45); color: #fff; font-size: 16px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .25s; }
.maphint.on { opacity: 1; }
.mapfs { position: fixed !important; inset: 0; z-index: 5000; width: auto !important; height: auto !important; border-radius: 0 !important; margin: 0 !important; }
.fsbtn { font-size: 16px; line-height: 30px !important; text-align: center; text-decoration: none !important; color: var(--ink) !important; }
.leaflet-popup-content { font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.leaflet-popup-content a { font-weight: 600; }

.foot { border-top: 1px solid var(--line); margin: 20px 20px 0; padding: 12px 0 16px; font-size: 12px; color: var(--muted); }

/* tablet: right column under the list */
@media (max-width: 900px) {
  .rest { flex-direction: column; }
  .rightcol { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 14px; }
  .evgrid { grid-template-columns: minmax(0, 1fr); }
}

/* phone */
@media (max-width: 640px) {
  .page { margin: 0; border-radius: 0; box-shadow: none; }
  .rest { padding: 12px 12px 0; gap: 14px; align-items: stretch; }
  .maincol { width: 100%; }
  .more { min-width: 0; }
  .more .seg { flex-wrap: wrap; }
  .bar { gap: 8px; }
  .views { margin-left: auto; }
  .seg a, .views a, .nearbtn { padding: 6px 8px; }
  .more { order: 3; flex: 1 1 100%; flex-wrap: wrap; }
  .listmap { height: 65vh; }
  .races .rl { white-space: normal; text-align: left; }
  .races td { display: block; border: 0; padding: 2px 4px; }
  .races tr { display: block; border-bottom: 1px solid var(--line); padding: 6px 0; }
  .filters { position: fixed; inset: 0; z-index: 3000; margin: 0; border: 0; border-radius: 0; background: #fff; overflow-y: auto;
    flex-direction: column; align-items: stretch; flex-wrap: nowrap; padding: 0 16px 90px; gap: 14px; }
  .filters label, .filters label.grow { width: 100%; flex: none; }
  .filters select, .filters input[type=date], .filters input[type=search] { width: 100%; height: 42px; font-size: 16px; }
  .sheethead { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: #fff; padding: 14px 0 8px; font-size: 18px; border-bottom: 1px solid var(--line); }
  .fclose { border: 0; background: none; font-size: 22px; line-height: 1; padding: 4px 8px; cursor: pointer; color: var(--ink); }
  .show { position: fixed; left: 16px; right: 16px; bottom: 16px; height: 48px; font-size: 16px; border-radius: 10px; }
  .evlist .co, .evlist .pl { display: none; }
  .evlist .nm { min-width: 0; }
  .evlist .tm a { width: 64px; height: 40px; }
  .evlist.detail .ic { white-space: normal; width: 22px; }
  .evlist.detail .ic img, .evlist.detail .ic a { display: block; margin: 0 0 3px; }
  .evlist .tm span { font-size: 9px; }
  .evlist .tm { vertical-align: top; padding-top: 8px; }
  .evlist td { padding: 8px 4px; }
  .evlist .dt { font-size: 12px; line-height: 1.3; vertical-align: top; padding-top: 10px; }
  .evlist .dt .dash { display: block; height: 0; overflow: hidden; }
  .evlist .nm { vertical-align: top; }
  .evlist .sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
  .evlist .ic { vertical-align: top; padding-top: 10px; }
  .evlist .ic img, .evlist .ic a { margin-left: 2px; }
  .evlist .ic a[title="Event website"] { display: none; }
  .event h1 { font-size: 22px; }
  .evdetails th, .evdetails td { display: block; width: auto; border: 0; padding: 0 2px; }
  .evdetails th { padding-top: 10px; font-size: 12px; }
  .evdetails tr { display: block; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
  .gallery img { height: 130px; }
  .rightcol { grid-template-columns: 1fr; }
  .foot { margin: 20px 12px 0; }
}

/* ===== event page (v2): map carousel, date block, pills, fact tiles ===== */
.carousel { position: relative; margin: 0 0 16px; }
.ctrack { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: thin; padding-bottom: 6px; }
.slide { flex: none; margin: 0; scroll-snap-align: start; position: relative; }
.slide img { height: 340px; width: auto; max-width: 80vw; object-fit: contain; display: block; border-radius: 8px; border: 1px solid #c8d1dc; background: #f4f6f8; }
.slide figcaption { position: absolute; left: 1px; right: 1px; bottom: 1px; padding: 18px 10px 7px; border-radius: 0 0 8px 8px; color: #fff; font-size: 12px; line-height: 1.3;
  background: linear-gradient(transparent, rgba(10, 20, 35, .75)); pointer-events: none; }
.slide figcaption b { display: block; font-size: 13px; }
.cprev, .cnext { position: absolute; top: 150px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); box-shadow: 0 1px 6px rgba(0,0,0,.3);
  font-size: 26px; line-height: 34px; color: var(--ink); cursor: pointer; }
.cprev { left: -8px; } .cnext { right: -8px; }
.cprev[disabled], .cnext[disabled] { opacity: 0; pointer-events: none; }

.evhead { display: flex; gap: 16px; align-items: center; margin: 4px 0 10px; }
.evhead h1 { margin: 0; }
.evhead .lead { margin: 2px 0 0; }
.dblock { flex: none; min-width: 92px; padding: 8px 10px; text-align: center; border-radius: 10px; background: var(--blue); color: #fff; }
.dblock .d { display: block; font-size: 26px; font-weight: 800; line-height: 1.1; }
.dblock .m { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; opacity: .9; }
.chips2 { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--tint); color: #0b3d91; }
.tag.wre { background: #e2591b; color: #fff; font-weight: 600; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.pill { display: inline-block; padding: 7px 14px; border-radius: 999px; border: 1px solid #c8d1dc; background: #fff; color: var(--ink); font-size: 14px; font-weight: 600; white-space: nowrap; }
.pill:hover { text-decoration: none; border-color: var(--blue); color: var(--blue); }
.pill.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.pill.primary:hover { background: #0948a8; color: #fff; }
.pill.small { padding: 3px 10px; font-size: 12px; font-weight: 600; }

.evgrid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; grid-template-areas: "top side" "text side"; gap: 6px 24px; align-items: start; }
.evtop { grid-area: top; } .evside { grid-area: side; } .evtext { grid-area: text; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin: 0 0 14px; }
.fact { background: #f6f8fb; border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; }
.fact dt { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.fact dd { margin: 2px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.box2 { border: 1px solid var(--line); border-radius: 10px; padding: 4px 14px 2px; margin: 0 0 14px; }
.box2 h3 { margin: 10px 0 0; font-size: 15px; color: #0b3d91; }
.box2 .pills { margin: 8px 0 10px; }
.box2.after { border-color: #9fd3a7; background: #f2faf3; }
.box2.after h3 { color: #1b5e20; }
.box2.live { border-color: #f3b38f; background: #fff6f0; }
.box2.live h3 { color: #b3400b; }
.card { border: 1px solid var(--line); border-radius: 10px; padding: 4px 14px 10px; }
.card h3 { font-size: 15px; color: #0b3d91; margin: 10px 0 8px; }
.maplinks { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.maplinks .pill { padding: 4px 10px; font-size: 12px; }
.evtext section h2 { font-size: 18px; color: #0b3d91; margin: 18px 0 6px; }
.evtext section p { margin: 0; max-width: 70ch; line-height: 1.6; overflow-wrap: anywhere; }
.fix { margin-top: 24px; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 6000; background: #0d131c; display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 92vw; max-height: 90vh; text-align: center; }
.lightbox img { height: 82vh; max-width: 92vw; width: auto; object-fit: contain; background: #fff; border-radius: 6px; }
.lightbox figcaption { color: #fff; font-size: 14px; margin-top: 8px; }
.lightbox figcaption a { color: #9cc4ff; margin-left: 8px; }
.lbclose, .lbprev, .lbnext { position: absolute; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 30px; width: 46px; height: 46px; border-radius: 50%; cursor: pointer; }
.lbclose { top: 14px; right: 14px; font-size: 22px; }
.lbprev { left: 14px; top: 50%; } .lbnext { right: 14px; top: 50%; }

@media (max-width: 900px) {
  .evgrid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "side" "text"; }
}
@media (max-width: 640px) {
  .slide img { height: 240px; max-width: 86vw; }
  .cprev, .cnext { display: none; }
  .evhead { gap: 12px; align-items: flex-start; }
  .dblock { min-width: 72px; padding: 6px 8px; }
  .dblock .d { font-size: 20px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .races td { display: block; border: 0; padding: 2px 0; }
  .races tr { display: block; border-bottom: 1px solid var(--line); padding: 6px 0; }
  .races .rl { text-align: left; white-space: normal; }
  .lbprev, .lbnext { top: auto; bottom: 14px; }
  .lightbox img { height: auto; max-height: 75vh; width: 92vw; }
}

/* control row: desktop vs phone parts, icon views */
.phone { display: none; }
.views a { display: inline-flex; align-items: center; gap: 5px; }
.views svg { width: 15px; height: 15px; flex: none; }
@media (max-width: 640px) {
  .wide { display: none !important; }
  .phone { display: inline-flex; }
  .chip.phone { display: inline-flex; }
  .bar { flex-wrap: wrap; gap: 6px; }
  .fbtn { padding: 0 10px; flex: none; }
  .views { margin-left: auto; flex: none; }
  .views .l { display: none; }
  .views a { padding: 7px 10px; }
  .views svg { width: 18px; height: 18px; }
  .seg.when a { padding: 7px 10px; }
  .chips { margin: 8px 0 6px; }
  /* events.worldofo.com: its own half-height row in small type */
  .bar .more { order: 3; flex: 1 1 100%; gap: 6px; font-size: 11px; flex-wrap: nowrap; }
  .bar .more .seg { border-radius: 6px; }
  .bar .more .seg a { padding: 2px 8px; font-size: 11.5px; }
}

/* events.worldofo.com switch is secondary: grey instead of blue */
.more .seg a.on { background: #6b7685; color: #fff; }
@media (max-width: 640px) {
  .chips .count { display: none; }          /* the small events.worldofo.com row replaces the count line */
  .chips:not(:has(.chip, .note)) { display: none; }
  .bar { margin-bottom: 8px; }
}

/* phone: first row as a grid so it never wraps; the events.worldofo.com row spans the full width below */
@media (max-width: 640px) {
  .bar { display: grid; grid-template-columns: auto auto auto; justify-content: space-between; align-items: center; gap: 6px; }
  .bar .phone { grid-column: 2; }
  .bar .views { grid-column: 3; margin-left: 0; }
  .bar .more { grid-column: 1 / -1; grid-row: 2; }
  .fbtn { padding: 0 9px; height: 34px; }
  .fbtn::before { margin-right: 5px; }
  .seg.when a { padding: 6px 9px; font-size: 13px; }
  .views a { padding: 6px 8px; }
  .views svg { width: 17px; height: 17px; }
}
@media (max-width: 350px) {
  .fbtn { font-size: 0; padding: 0 9px; }
  .fbtn::before { margin-right: 0; }
  .fbtn b { font-size: 11px; }
}
@media (max-width: 640px) {
  .bar .more .seg { flex-wrap: nowrap; }
}
@media (max-width: 360px) {
  .bar .more { font-size: 10px; gap: 4px; }
  .bar .more .seg a { padding: 2px 5px; font-size: 11px; }
}

/* ===== control area =====
   desktop: one line  Filters · Upcoming/Past · events.worldofo.com switch · view icons
   phone:   row 1 Filters · Upcoming/Past · view icons, row 2 the switch in small type */
.bar { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.bar .whenwrap { display: inline-flex; }
.bar .views { margin-left: auto; }
.bar .views .l { display: none; }
.bar .views a { padding: 6px 11px; }
.bar .views svg { width: 17px; height: 17px; }
.bar .more { font-size: 13px; }
.bar .more .seg { flex-wrap: nowrap; }
.bar .more .seg a { padding: 6px 10px; font-size: 13px; }
.seg.when a { padding: 6px 12px; font-size: 13px; }
.bar .count { display: none; }
.chips:not(:has(.chip, .note)) { display: none; }
.chips { margin: 0 0 10px; }
@media (max-width: 640px) {
  .bar { display: grid; grid-template-columns: auto auto auto; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
  .bar .fbtn { grid-column: 1; grid-row: 1; }
  .bar .whenwrap { grid-column: 2; grid-row: 1; }
  .bar .views { grid-column: 3; grid-row: 1; margin-left: 0; }
  .bar .more { grid-column: 1 / -1; grid-row: 2; font-size: 11px; }
  .bar .more .seg { border-radius: 6px; }
  .bar .more .seg a { padding: 2px 8px; font-size: 11.5px; }
  .seg.when a { padding: 6px 9px; }
  .bar .views a { padding: 6px 8px; }
}
@media (max-width: 360px) {
  .bar .more .seg a { padding: 2px 5px; font-size: 11px; }
}
/* desktop order and no squeezing: Filters · Upcoming/Past · events.worldofo.com · views */
.bar > * { flex: none; }
.bar .fbtn { order: 0; white-space: nowrap; }
.bar .whenwrap { order: 1; }
.bar .more { order: 2; }
.bar .views { order: 3; }
@media (max-width: 900px) and (min-width: 641px) {
  .bar { flex-wrap: wrap; }
}
@media (min-width: 641px) {
  .bar { gap: 8px; }
  .bar .more .seg a { padding: 6px 9px; }
}
/* desktop: the events.worldofo.com switch is least important – far right */
@media (min-width: 641px) {
  .bar .views { order: 2; margin-left: 0; }
  .bar .more { order: 3; margin-left: auto; }
}

/* ===== map strip in every list row (3:1 like the omaps thumbnails) ===== */
.evlist .tm { width: 1%; padding: 3px 8px; vertical-align: middle; }
.evlist .tm a, .evlist .tm .none { position: relative; display: block; width: 90px; height: 30px; border-radius: 4px; overflow: hidden; border: 1px solid #c8d1dc; background: #f0f2f5; }
.evlist .tm .none { border-style: dashed; border-color: #e3e8ef; background: none; }
.evlist .tm img { width: 100%; height: 100%; object-fit: cover; display: block; }
.evlist .tm a span { position: absolute; left: 0; bottom: 0; padding: 0 4px; font-size: 9px; line-height: 13px; font-weight: 600; color: #fff; background: rgba(20, 30, 45, .62); border-top-right-radius: 4px; }
.evlist .tm a:hover { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--blue); }
.evlist td { padding-top: 5px; padding-bottom: 5px; }

/* location pin + popup */
.pin { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-left: 3px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--blue); cursor: pointer; vertical-align: middle; }
.pin svg { width: 16px; height: 16px; }
.pin:hover, .pin.on { background: var(--tint); }
.pinpop { position: absolute; z-index: 4000; width: 300px; background: #fff; border-radius: 10px; box-shadow: 0 8px 30px rgba(0, 30, 70, .3); overflow: hidden; }
.pinpop .pmap { height: 200px; }
.pinpop .pbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; font-size: 12px; }
.pinpop .pbar b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pinpop .pclose { border: 0; background: none; font-size: 16px; cursor: pointer; color: var(--muted); }

@media (max-width: 640px) {
  .evlist .tm { padding: 8px 4px 0; vertical-align: top; }
  .evlist .tm a, .evlist .tm .none { width: 60px; height: 20px; }
  .evlist .tm .none { display: none; }
  .evlist .tm a span { font-size: 8px; line-height: 11px; padding: 0 3px; }
  .pinpop { width: calc(100vw - 24px); }
}

/* desktop: one line per event – long names and places end in … (full text on hover) */
@media (min-width: 641px) {
  .evlist { table-layout: fixed; }
  .evlist col.c-dt { width: 92px; }
  .evlist col.c-tm { width: 102px; }
  .evlist col.c-co { width: 112px; }
  .evlist col.c-pl { width: 118px; }
  .evlist col.c-ic { width: 84px; }
  .evlist .nm, .evlist .pl, .evlist .co { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: none; }
  .evlist .nm a { display: inline; }
  .evlist .nm .x { white-space: nowrap; }
  .evlist .ic { white-space: nowrap; overflow: hidden; }
}
@media (max-width: 640px) {
  .evlist col { width: auto; }
}

/* phone: no icon column – only the location pin, in light grey right after the name */
.evlist .nmpin { display: none; }
@media (max-width: 640px) {
  .evlist .ic { display: none; }
  .evlist .nmpin { display: inline; }
  .evlist .nmpin .pin { width: 20px; height: 20px; margin: 0 0 0 2px; color: #a3adba; vertical-align: -3px; }
  .evlist .tm { text-align: right; }
  .evlist .tm a { margin-left: auto; }
}
@media (max-width: 640px) {
  .evlist .tm { width: 78px; }
  .evlist .tm a { width: 72px; height: 40px; }
}

.pills.small2 { align-items: center; margin-top: 22px; font-size: 13px; }
.evtext .box2 { margin-top: 18px; }

/* ===== add / correct form ===== */
.formpage h1 { font-size: 26px; color: #0b3d91; margin: 4px 0 6px; }
.formpage .lead { color: #3c4756; margin: 0 0 16px; max-width: 70ch; }
.formpage fieldset, .formpage .formsec { border: 1px solid var(--line); border-radius: 10px; padding: 6px 16px 14px; margin: 0 0 16px; }
.formpage legend { font-weight: 700; color: #0b3d91; padding: 0 6px; font-size: 16px; }
.formpage .formsec summary { cursor: pointer; font-weight: 700; color: #0b3d91; padding: 8px 0; }
.formpage .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.formpage .fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.formpage .fld.wide { grid-column: 1 / -1; }
.formpage label { font-size: 13px; font-weight: 600; color: #3c4756; }
.formpage .req { color: #c62828; }
.formpage input[type=text], .formpage input[type=url], .formpage input[type=email], .formpage input[type=date], .formpage input[type=number], .formpage select, .formpage textarea {
  font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid #c8d1dc; border-radius: 7px; background: #fff; color: var(--ink); width: 100%; }
.formpage textarea { resize: vertical; line-height: 1.5; }
.formpage input:focus, .formpage select:focus, .formpage textarea:focus { outline: 2px solid #9cc4ff; border-color: var(--blue); }
.formpage .fld.bad input, .formpage .fld.bad select, .formpage .fld.bad textarea { border-color: #c62828; background: #fff6f6; }
.formpage small { font-size: 12px; color: var(--muted); }
.formpage .formerr { color: #c62828; font-size: 13px; }
.formpage .hint { font-size: 13px; color: var(--muted); margin: 4px 0 10px; }
.formbox.bad { background: #fff3f3; border: 1px solid #f0b4b4; color: #8e1b1b; border-radius: 8px; padding: 10px 14px; margin: 0 0 16px; }
.formpage .locsearch { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.formpage .locsearch input { flex: 1; min-width: 200px; }
.formpage .pickmap { height: 340px; border-radius: 10px; border: 1px solid var(--line); }
.formpage .imgrow { margin: 10px 0; }
.formpage .imgrow b { display: block; font-size: 14px; margin-bottom: 6px; }
.formpage .thumbs, .formpage .preview { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.formpage .keep { display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: normal; }
.formpage .keep img, .formpage .preview img { height: 90px; width: auto; max-width: 140px; object-fit: cover; border-radius: 6px; border: 1px solid #c8d1dc; }
.formpage .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.formpage .submitrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 20px 0 10px; }
.formpage .pill.big { font-size: 16px; padding: 11px 26px; cursor: pointer; }
.formpage button.pill { font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
@media (max-width: 640px) {
  .formpage .grid { grid-template-columns: 1fr; }
  .formpage fieldset, .formpage .formsec { padding: 4px 12px 12px; }
  .formpage .pickmap { height: 260px; }
  .formpage .pill.big { width: 100%; }
}

/* ===== earlier events in the area (event pages) ===== */
.evgrid { grid-template-areas: "top side" "near side" "text side"; }
.evnear { grid-area: near; min-width: 0; }
.area h2 { font-size: 18px; color: #0b3d91; margin: 18px 0 8px; }
.hist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.hist li { display: grid; grid-template-columns: 92px 40px minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.hthumb { display: block; width: 90px; height: 30px; border-radius: 4px; overflow: hidden; background: #f0f2f5; border: 1px solid #e3e8ef; }
.hthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hthumb .hdate { display: flex; height: 100%; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 700; color: #555; white-space: nowrap; }
.hthumb .hdate small { font-size: 9px; font-weight: 400; }
.hthumb:hover .hdate { text-decoration: none; }
.hyear { font-weight: 700; color: #0b3d91; font-size: 13px; }
.hmain { min-width: 0; }
.hmain a { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hsub { display: block; font-size: 12px; color: var(--muted); }
.hbtn { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.area .small { margin-top: 8px; }
@media (max-width: 900px) {
  .evgrid { grid-template-areas: "top" "side" "near" "text"; }
}
@media (max-width: 640px) {
  .hist li { grid-template-columns: 64px minmax(0, 1fr); gap: 2px 10px; }
  .hthumb { width: 64px; height: 36px; grid-row: span 2; }
  .hyear { display: none; }
  .hmain a { white-space: normal; }
  .hbtn { justify-content: flex-start; grid-column: 2; }
}

/* ===== "Show on map" (earlier events in the area, map carousel) ===== */
.hname { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.hname > a { min-width: 0; }
.onmap { flex: none; border: 0; background: none; padding: 0; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.onmap::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e65100; margin-right: 4px; vertical-align: 0; }
.onmap:hover { color: var(--blue); text-decoration: underline; }
.slide figcaption .onmap { display: block; margin-top: 3px; color: #fff; opacity: .9; pointer-events: auto; }
.slide figcaption .onmap:hover { color: #fff; opacity: 1; }
@media (max-width: 640px) {
  .hname { flex-wrap: wrap; gap: 0 8px; }
}

/* signed preview of a waiting entry (link in the digest) */
.pvbar { background: #fff3e0; border: 1px solid #ffb74d; color: #8a3a00; font-weight: 600; border-radius: 8px; padding: 10px 14px; margin: 10px 0 14px; }
