/* CSCNL Engage — same look as the CSCNL Board Portal, styled after cscnl.ca (Urbanist, deep navy, bright blue, warm paper, accent dots). */
@font-face { font-family: 'Urbanist'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/urbanist-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Urbanist'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/urbanist-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Urbanist'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/urbanist-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Urbanist'; font-style: normal; font-weight: 800; font-display: swap; src: url('fonts/urbanist-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Urbanist'; font-style: normal; font-weight: 900; font-display: swap; src: url('fonts/urbanist-latin-900-normal.woff2') format('woff2'); }
:root {
  --navy: #0C2436;
  --navy-deep: #071A28;
  --navy-hero: #0F2E4A;
  --blue: #1779BA;
  --blue-dark: #115f94;
  --royal: #1D57A5;
  --magenta: #BA3C8B;
  --yellow: #FFBF3F;
  --orange: #FB914A;
  --teal: #00A7B5;
  --paper: #FAF9F7;
  --white: #fff;
  --ink: #0C2436;
  --ink-2: #44596a;
  --line: #e6e2dc;
  --line-2: #cfc9c0;
  --danger: #b42318;
  --success: #1c7a4a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(12, 36, 54, .05), 0 6px 20px rgba(12, 36, 54, .06);
  --shadow-hover: 0 2px 4px rgba(12, 36, 54, .06), 0 14px 32px rgba(12, 36, 54, .12);
  --font: 'Urbanist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --texture: repeating-linear-gradient(135deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 16px);
}
html { font-size: 19px; }
html.large-text { font-size: 22px; }
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--font); font-weight: 500; line-height: 1.55;
  color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; outline: none; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-dark); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.15; font-weight: 800; margin: 0 0 .5em; letter-spacing: -.01em; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 820px; }
.section { padding: 40px 24px 56px; }
.muted { color: var(--ink-2); }
.small { font-size: .84rem; }
.nowrap { white-space: nowrap; }
.empty { color: var(--ink-2); font-size: 1.05rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--yellow); color: var(--navy); padding: 10px 16px; border-radius: 8px; font-weight: 800; z-index: 10; }
.skip-link:focus { left: 8px; }
.icon { width: 1.15em; height: 1.15em; flex: none; }

/* ---------- Top bar + header ---------- */
.topbar { background: var(--navy-deep); color: rgba(255, 255, 255, .72); font-size: .74rem; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; min-height: 38px; gap: 12px; }
.topbar-org { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-size {
  display: inline-flex; align-items: baseline; gap: 2px; background: none; border: 1px solid rgba(255, 255, 255, .28);
  color: #fff; border-radius: 999px; padding: 3px 12px; font: inherit; font-weight: 700; cursor: pointer; flex: none;
}
.text-size:hover { background: rgba(255, 255, 255, .1); }
.text-size .ts-small { font-size: .8em; }
.text-size .ts-big { font-size: 1.15em; margin-right: 6px; }
.text-size[aria-pressed="true"] { background: var(--yellow); color: var(--navy); border-color: var(--yellow); }

.site-header { background: var(--navy); color: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 92px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 18px; color: #fff; text-decoration: none; }
.brand-logo { height: 56px; width: auto; display: block; }
.brand-word { font-size: 2rem; font-weight: 800; color: #fff; }
.brand-label { border-left: 2px solid rgba(255, 255, 255, .25); padding-left: 18px; font-weight: 800; font-size: 1.15rem; }
.header-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav-link { color: #fff; text-decoration: none; font-weight: 700; padding: 8px 14px; border-radius: 8px; display: inline-flex; gap: 8px; align-items: center; }
.nav-link:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav-link.is-active { box-shadow: inset 0 -3px 0 var(--yellow); border-radius: 0; }
.nav-user { color: rgba(255, 255, 255, .78); padding: 0 10px 0 14px; border-left: 1px solid rgba(255, 255, 255, .2); margin-left: 6px; }
.inline-form { display: inline; margin: 0; }

/* ---------- Hero ---------- */
.hero {
  background: var(--texture), linear-gradient(120deg, var(--navy-hero) 0%, #123b5e 60%, #164a72 100%);
  color: #fff; padding: 44px 0 40px;
}
.hero h1 { font-size: 2.3rem; margin: 0 0 .25em; }
.hero .lead { color: rgba(255, 255, 255, .86); font-size: 1.12rem; margin: 0; max-width: 60ch; }
.hero-row { display: flex; align-items: center; gap: 22px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; text-decoration: none; margin-bottom: 18px; opacity: .9; }
.back-link:hover { color: #fff; opacity: 1; text-decoration: underline; }
.back-link.dark { color: var(--blue); margin: 0; }
.dots { display: flex; gap: 7px; margin-top: 22px; }
.dots span { width: 11px; height: 11px; border-radius: 50%; background: var(--magenta); }
.dots span:nth-child(2) { background: var(--yellow); }
.dots span:nth-child(3) { background: var(--orange); }
.dots span:nth-child(4) { background: var(--teal); }

/* ---------- Colour swatches ---------- */
.swatch { width: 62px; height: 62px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; flex: none; }
.swatch .icon { width: 28px; height: 28px; }
.swatch-lg { width: 76px; height: 76px; }
.swatch-lg .icon { width: 34px; height: 34px; }
.c-blue { background: var(--blue); color: #fff; }
.c-royal { background: var(--royal); color: #fff; }
.c-teal { background: #008c98; color: #fff; }
.c-magenta { background: var(--magenta); color: #fff; }
.c-orange { background: #e8762c; color: #fff; }
.c-yellow { background: var(--yellow); color: var(--navy); }
.c-navy { background: var(--navy); color: #fff; }

/* ---------- Section titles (lowercase, like cscnl.ca) ---------- */
.section-title { font-size: 1.7rem; text-transform: lowercase; margin: 44px 0 20px; display: flex; align-items: center; gap: 14px; }
.section-title::after { content: ""; flex: 1; height: 2px; background: var(--line); }
.search + .section-title { margin-top: 36px; }

/* ---------- Search ---------- */
.search { position: relative; display: flex; gap: 10px; max-width: 760px; }
.search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--ink-2); display: flex; }
.search input[type=search] {
  flex: 1; min-width: 0; height: 60px; padding: 0 18px 0 52px; font: inherit; font-size: 1.05rem;
  border: 2px solid var(--line-2); border-radius: 10px; background: #fff; color: var(--ink);
}
.search input[type=search]:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 4px rgba(23, 121, 186, .2); }
.search .btn { height: 60px; }

/* ---------- Category tiles ---------- */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 20px; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; height: 100%; padding: 26px 26px 24px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.tile:hover { color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--blue); }
.tile-body { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.tile-title { font-size: 1.3rem; font-weight: 800; line-height: 1.2; }
.tile-desc { color: var(--ink-2); font-size: .9rem; line-height: 1.4; }
.tile-meta { margin-top: 6px; font-size: .84rem; font-weight: 700; color: var(--blue); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tile-arrow { position: absolute; top: 26px; right: 24px; color: var(--line-2); transition: color .15s, transform .15s; }
.tile:hover .tile-arrow { color: var(--blue); transform: translateX(3px); }

.pill { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .03em; padding: 3px 10px; border-radius: 999px; background: var(--paper); color: var(--ink-2); border: 1px solid var(--line); vertical-align: middle; }
.pill-new { background: var(--yellow); color: var(--navy); border-color: var(--yellow); text-transform: uppercase; }
.pill-admin { background: #e9f3fa; color: var(--blue-dark); border-color: #cfe4f3; }

/* ---------- Document list ---------- */
.doc-list { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 10px; }
.doc {
  display: flex; align-items: center; gap: 18px; padding: 16px 20px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
}
.doc:hover { border-color: var(--line-2); }
.doc-type {
  width: 50px; height: 58px; border-radius: 6px 14px 6px 6px; display: grid; place-items: center; flex: none;
  font-size: .72rem; font-weight: 900; letter-spacing: .04em;
}
.doc-type.sm { width: 38px; height: 26px; border-radius: 5px; font-size: .62rem; display: inline-grid; vertical-align: middle; margin-right: 8px; }
.doc-main { flex: 1; min-width: 0; }
.doc-title { font-weight: 700; font-size: 1.06rem; color: var(--ink); text-decoration: none; margin-right: 10px; }
.doc-title:hover { color: var(--blue); text-decoration: underline; }
.doc-meta { color: var(--ink-2); font-size: .86rem; margin-top: 2px; }
.doc-meta .sep { margin: 0 8px; color: var(--line-2); }
.doc-open { flex: none; }
.year-heading { font-size: 1.1rem; color: var(--ink-2); margin: 32px 0 14px; display: flex; align-items: center; gap: 14px; }
.year-heading:first-child { margin-top: 0; }
.year-heading::after { content: ""; flex: 1; height: 2px; background: var(--line); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: .66em 1.25em; border-radius: 8px; border: 2px solid transparent;
  font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line-2); }
.btn-secondary:hover { border-color: var(--blue); color: var(--blue); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .7); }
.btn-outline-light:hover { background: #fff; color: var(--navy); }
.btn-danger { background: #fff; color: var(--danger); border-color: #f0c4bf; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-ms { background: #fff; color: #2f2f2f; border-color: #8c8c8c; }
.btn-ms:hover { background: #f3f3f3; color: #2f2f2f; }
.ms-logo { width: 21px; height: 21px; }
.btn-sm { font-size: .84rem; padding: .45em .85em; }
.btn-lg { font-size: 1.08rem; padding: .85em 1.5em; }
.btn-block { width: 100%; }

/* ---------- Cards, forms, alerts ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; margin-bottom: 24px; }
.card-title { font-size: 1.35rem; display: flex; align-items: center; gap: 10px; }
.card-title .count { font-size: .8rem; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; color: var(--ink-2); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head .card-title { margin: 0; }
.center-card { text-align: center; }
.center-card .swatch { margin-bottom: 16px; }

.field { margin-bottom: 18px; }
.field label, .field > .label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.optional { font-weight: 500; color: var(--ink-2); }
input[type=text], input[type=email], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: #fff;
  border: 2px solid var(--line-2); border-radius: 8px; padding: .62em .85em; min-height: 52px;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 4px rgba(23, 121, 186, .2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-grid.three { grid-template-columns: 1.2fr 1.4fr 1fr; }
.span-2 { grid-column: span 2; }
.check { display: flex; align-items: center; gap: 10px; margin: 2px 0 20px; font-weight: 600; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--blue); }
.filter-form select { min-width: 220px; min-height: 44px; padding: .4em .8em; }

.alert { padding: 14px 18px; border-radius: 8px; border-left: 5px solid; margin-bottom: 16px; font-weight: 600; }
.alert-success { background: #e7f5ed; border-color: var(--success); color: #0f4d2e; }
.alert-error { background: #fdecea; border-color: var(--danger); color: #7a1a12; }
.alert-info { background: #e8f2fa; border-color: var(--blue); color: #0d4670; }
.flash-stack { padding-top: 24px; margin-bottom: -16px; }

/* ---------- Upload dropzone ---------- */
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  border: 2px dashed var(--line-2); border-radius: var(--radius); background: var(--paper); padding: 34px 20px; margin-bottom: 22px;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-over, .dropzone:focus-within { border-color: var(--blue); background: #eef6fc; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dz-icon { width: 58px; height: 58px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; margin-bottom: 6px; }
.dz-icon .icon { width: 26px; height: 26px; }
.dz-text { font-size: 1.08rem; }
.dz-text strong { color: var(--blue); }
.dz-hint { font-size: .8rem; color: var(--ink-2); }
.dz-files { font-weight: 700; color: var(--ink); font-size: .9rem; }
.dz-files:not(:empty) { margin-top: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; }

/* ---------- Admin ---------- */
.admin-bar { background: #fff; border-bottom: 1px solid var(--line); }
.admin-tabs { display: flex; gap: 4px; overflow-x: auto; }
.admin-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 18px 18px 15px; font-weight: 700; color: var(--ink-2); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.admin-tabs a:hover { color: var(--ink); }
.admin-tabs a.is-active { color: var(--navy); border-bottom-color: var(--blue); }
.table-wrap { overflow-x: auto; margin: 0 -8px; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); padding: 10px 8px; border-bottom: 2px solid var(--line); }
table.data td { padding: 14px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data td a { font-weight: 700; }
table.data .actions { text-align: right; white-space: nowrap; }
table.data .actions .btn, table.data .actions form { margin: 2px 0 2px 4px; }
tr.is-inactive td { opacity: .6; }
.status { font-weight: 700; font-size: .84rem; }
.status::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; }
.status.ok::before { background: var(--success); }
.status.off::before { background: var(--line-2); }
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }

/* ---------- Sign-in pages ---------- */
body.bare { background: var(--texture), linear-gradient(140deg, var(--navy-hero), #164a72); }
body.bare .site-footer { background: transparent; border-top: 1px solid rgba(255, 255, 255, .1); }
.login-shell {
  max-width: 1020px; margin: 48px auto; display: grid; grid-template-columns: 1fr 1fr;
  background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .3);
}
.login-shell.single { grid-template-columns: 1fr; max-width: 600px; }
.login-intro { background: var(--texture), var(--navy); color: #fff; padding: 52px 48px; display: flex; flex-direction: column; justify-content: center; }
.login-intro .brand-logo { height: 64px; align-self: flex-start; margin-bottom: 36px; }
.login-intro h1 { font-size: 2.4rem; text-transform: lowercase; margin: 0; }
.login-intro p { color: rgba(255, 255, 255, .85); margin: 22px 0 0; font-size: 1.05rem; }
.login-panel { padding: 52px 48px; }
.login-panel h2, .login-panel .card-title { font-size: 1.8rem; justify-content: center; }
.login-panel h2 { justify-content: flex-start; }
.login-form { margin: 0; }
.login-form .muted { margin: 14px 0 0; text-align: center; }
.or { display: flex; align-items: center; gap: 14px; color: var(--ink-2); margin: 24px 0; font-weight: 700; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-help { margin: 32px 0 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink-2); display: flex; align-items: center; gap: 10px; font-size: .92rem; }
.login-help a { font-weight: 700; }
.sent-state .swatch { margin-bottom: 18px; }
.steps { padding-left: 1.3em; margin: 0 0 18px; }
.steps li { margin-bottom: 6px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: rgba(255, 255, 255, .8); margin-top: 24px; font-size: .9rem; }
.footer-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; padding-top: 40px; padding-bottom: 28px; }
.footer-brand .brand-logo { height: 46px; margin-bottom: 12px; }
.footer-brand p { margin: 0; }
.footer-help h2 { color: #fff; font-size: 1.15rem; text-transform: lowercase; }
.footer-help p { margin: 0 0 12px; }
.footer-contact { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.footer-contact a { color: #fff; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.footer-contact a:hover { color: var(--yellow); }
.footer-base { border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 16px; padding-bottom: 20px; font-size: .78rem; color: rgba(255, 255, 255, .6); }


/* ---------- Small screens ---------- */
@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; margin: 24px 16px; }
  .login-intro, .login-panel { padding: 36px 28px; }
  .login-intro h1 { font-size: 1.9rem; }
}
@media (max-width: 680px) {
  html { font-size: 18px; }
  html.large-text { font-size: 21px; }
  .wrap { padding: 0 16px; }
  .section { padding: 28px 16px 44px; }
  .topbar-org { display: none; }
  .topbar-inner { justify-content: flex-end; }
  .header-inner { min-height: 0; padding-top: 14px; padding-bottom: 14px; }
  .brand-logo { height: 44px; }
  .brand-label { font-size: 1rem; padding-left: 14px; }
  .nav-user { display: none; }
  .hero { padding: 32px 0 30px; }
  .hero h1 { font-size: 1.8rem; }
  .hero-row { gap: 14px; }
  .swatch-lg { width: 60px; height: 60px; }
  .tiles { grid-template-columns: 1fr; }
  .tile { flex-direction: row; align-items: center; padding: 20px 18px; gap: 16px; }
  .tile-arrow { position: static; }
  .hero-row { flex-direction: column; align-items: flex-start; }
  .swatch { width: 52px; height: 52px; }
  .doc { flex-wrap: wrap; padding: 14px 16px; gap: 14px; }
  .doc-type { width: 42px; height: 50px; }
  .doc-main { flex-basis: calc(100% - 60px); }
  .doc-open { width: 100%; }
  .search .btn { padding: 0 16px; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .card { padding: 20px; }
  .footer-inner { grid-template-columns: 1fr; }
  table.data .actions { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* =====================================================================
   Engage additions: events, regions, calendar, map comparison
   ===================================================================== */
.center { text-align: center; }
.btn-accent { background: var(--yellow); color: var(--navy); }
.btn-accent:hover { background: #ffd06e; color: var(--navy); }
.nav-add { margin-left: 8px; }
.hero-text { flex: 1; min-width: 0; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero .btn-secondary { border-color: #fff; }
.pill-warn { background: #fff4e5; color: #8a4b08; border-color: #f7d9b0; text-transform: none; letter-spacing: 0; }
.field-error { display: flex; gap: 8px; align-items: center; color: var(--danger); font-weight: 700; font-size: .86rem; margin: 6px 0 0; }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.hint { color: var(--ink-2); font-size: .82rem; margin: 6px 0 0; }
input[type=time], input[type=url] {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: #fff;
  border: 2px solid var(--line-2); border-radius: 8px; padding: .62em .85em; min-height: 52px;
}
textarea { min-height: 140px; resize: vertical; }
.form-grid.four { grid-template-columns: repeat(4, 1fr); }
.form-section { font-size: 1.05rem; text-transform: lowercase; color: var(--ink-2); margin: 10px 0 14px; display: flex; gap: 12px; align-items: center; }
.form-section::after { content: ""; flex: 1; height: 2px; background: var(--line); }
details.advanced { border: 2px solid var(--line); border-radius: 10px; padding: 0 18px; margin: 0 0 22px; }
details.advanced summary { cursor: pointer; font-weight: 700; padding: 14px 0; }
details.advanced[open] { padding-bottom: 6px; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-top: 8px; }

/* ---------- Regions ---------- */
.region-chip { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 700; color: var(--ink-2); vertical-align: middle; margin-right: 8px; }
.region-chip.lg { font-size: .95rem; color: var(--ink); }
.region-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--rc, var(--ink-2)); flex: none; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--rc, var(--ink-2)); }
.hero .region-chip { color: #fff; }
.hero .region-dot { box-shadow: 0 0 0 2px var(--navy-hero), 0 0 0 3px #fff; }

/* ---------- Filter bar ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.filter-bar .field { margin: 0; flex: 1 1 160px; }
.filter-bar .field.grow { flex: 2 1 240px; }
.filter-bar input, .filter-bar select { min-height: 46px; padding: .45em .75em; }
.filter-bar .btn { min-height: 46px; }
.presets { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 0; }
.presets a { font-size: .84rem; font-weight: 700; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--line-2); color: var(--ink); text-decoration: none; background: #fff; }
.presets a:hover { border-color: var(--blue); color: var(--blue); }
.presets a.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.result-note { color: var(--ink-2); margin: 18px 0 0; font-weight: 600; }

/* ---------- Event list ---------- */
.event-list { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 10px; }
.event { display: flex; align-items: center; gap: 18px; padding: 14px 18px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.event:hover { border-color: var(--line-2); }
.date-badge { width: 62px; flex: none; display: flex; flex-direction: column; align-items: center; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); line-height: 1.1; }
.db-month { background: var(--navy); color: #fff; width: 100%; text-align: center; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: 4px 0 3px; }
.db-day { font-size: 1.5rem; font-weight: 900; padding-top: 4px; }
.db-dow { font-size: .68rem; font-weight: 700; color: var(--ink-2); padding-bottom: 5px; text-transform: uppercase; }
.event-main { flex: 1; min-width: 0; }
.event-title { font-weight: 800; font-size: 1.08rem; color: var(--ink); text-decoration: none; margin-right: 10px; }
.event-title:hover { color: var(--blue); text-decoration: underline; }
.event-meta { color: var(--ink-2); font-size: .86rem; margin-top: 3px; display: flex; flex-wrap: wrap; align-items: center; }
.event-meta .icon { width: 1em; height: 1em; margin-right: 4px; }
.event-meta .sep { margin: 0 8px; color: var(--line-2); }
.event-open { flex: none; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }

/* ---------- Event detail ---------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.facts li { display: flex; gap: 14px; align-items: flex-start; }
.facts .swatch { width: 44px; height: 44px; }
.facts .swatch .icon { width: 20px; height: 20px; }
.fact-label { display: block; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.fact-value { font-weight: 700; }
.description { white-space: pre-line; }
.mini-map { height: 320px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #e8eef2; }
.map-note { font-size: .82rem; color: var(--ink-2); margin: 10px 0 0; }
.overlap-list { list-style: none; padding: 0; margin: 0; }
.overlap-list li { padding: 10px 0; border-top: 1px solid var(--line); }
.overlap-list li:first-child { border-top: 0; }
.action-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 28px 0 14px; }
.cal-head h2 { margin: 0; font-size: 1.7rem; text-transform: lowercase; }
.cal-nav { display: flex; gap: 8px; }
.cal { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cal th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); padding: 10px 8px; border-bottom: 2px solid var(--line); text-align: left; background: var(--paper); }
.cal td { vertical-align: top; height: 128px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal td:last-child { border-right: 0; }
.cal tr:last-child td { border-bottom: 0; }
.cal td.is-other { background: #fbfaf8; }
.cal td.is-other .cal-num { color: var(--line-2); }
.cal-num { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 50%; font-weight: 800; font-size: .86rem; text-decoration: none; color: var(--ink); }
a.cal-num:hover { background: var(--paper); color: var(--blue); }
.cal td.is-today .cal-num { background: var(--blue); color: #fff; }
.cal-dowm { display: none; }
.cal-events { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 3px; }
.cal-chip { display: block; font-size: .72rem; font-weight: 700; line-height: 1.25; padding: 3px 6px; border-radius: 5px; background: var(--rc, var(--blue)); color: var(--ri, #fff); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip:hover { color: var(--ri, #fff); filter: brightness(1.1); text-decoration: underline; }
.cal-chip .t { font-weight: 900; margin-right: 4px; }
.cal-chip.cont { border-radius: 0 5px 5px 0; opacity: .85; }
.cal-more { font-size: .74rem; font-weight: 800; color: var(--blue); text-decoration: none; padding-left: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 16px 0 0; }

/* ---------- Map & compare ---------- */
.compare { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; margin-top: 24px; align-items: start; }
.map-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
#map { height: 620px; background: #dfe8ee; position: relative; }
.map-fallback { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--ink-2); }
.map-fallback .card { max-width: 440px; margin: 0; }
.map-legend { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px; border-top: 1px solid var(--line); }
.legend-btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: .8rem; font-weight: 700; padding: 6px 12px 6px 10px; border-radius: 999px; border: 2px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.legend-btn .n { color: var(--ink-2); font-weight: 800; }
.legend-btn:hover { border-color: var(--rc); }
.legend-btn[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.side-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; max-height: 720px; }
.side-head { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.side-head h2 { font-size: 1.15rem; margin: 0; }
.side-head p { margin: 4px 0 0; font-size: .84rem; color: var(--ink-2); }
.side-list { overflow-y: auto; padding: 6px 0; flex: 1; }
.side-day { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); padding: 12px 18px 6px; position: sticky; top: 0; background: #fff; }
.side-ev { display: flex; gap: 10px; width: 100%; text-align: left; font: inherit; background: none; border: 0; border-left: 4px solid var(--rc, var(--blue)); padding: 8px 14px; cursor: pointer; color: var(--ink); }
.side-ev:hover, .side-ev.is-active { background: #eef6fc; }
.side-ev-title { font-weight: 800; font-size: .92rem; display: block; }
.side-ev-meta { font-size: .78rem; color: var(--ink-2); display: block; }
.side-ev .pill { margin-left: 4px; }
.side-empty { padding: 18px; color: var(--ink-2); }
.pill-overlap { background: #fdecea; color: #8a1f15; border-color: #f4c7c1; text-transform: none; letter-spacing: 0; }
.filter-note { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #fff8e6; border-bottom: 1px solid #f5e1ad; padding: 8px 18px; font-size: .84rem; font-weight: 700; }
.filter-note[hidden] { display: none; }
.link-btn { background: none; border: 0; color: var(--blue); font: inherit; font-weight: 800; cursor: pointer; text-decoration: underline; padding: 0; }

.matrix-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px 4px; }
table.matrix { border-collapse: separate; border-spacing: 3px; font-size: .78rem; min-width: 100%; }
table.matrix th { font-weight: 800; color: var(--ink-2); padding: 4px 6px; white-space: nowrap; }
table.matrix thead th { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; text-align: center; vertical-align: bottom; }
table.matrix thead th .d { display: block; font-size: .9rem; color: var(--ink); letter-spacing: 0; }
table.matrix thead th.wkend { color: var(--magenta); }
table.matrix tbody th { text-align: left; font-size: .8rem; color: var(--ink); max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
table.matrix tbody th .region-chip { margin: 0; font-size: .8rem; color: var(--ink); }
table.matrix td { text-align: center; min-width: 34px; height: 32px; border-radius: 6px; background: #f3f1ed; font-weight: 800; }
table.matrix td button { width: 100%; height: 100%; min-height: 32px; border: 0; border-radius: 6px; font: inherit; font-weight: 900; cursor: pointer; background: transparent; color: inherit; }
table.matrix td.has { background: var(--rc); color: var(--ri); }
table.matrix td.has.l1 { opacity: .55; } table.matrix td.has.l2 { opacity: .8; }
table.matrix td.clash button { box-shadow: inset 0 0 0 3px var(--danger); }
table.matrix td.is-selected button { outline: 3px solid var(--yellow); outline-offset: 1px; }
table.matrix tfoot th, table.matrix tfoot td { background: none; color: var(--ink-2); font-weight: 900; }
.matrix-key { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .8rem; color: var(--ink-2); margin-top: 10px; }
.key-clash { display: inline-block; width: 16px; height: 16px; border-radius: 4px; box-shadow: inset 0 0 0 3px var(--danger); vertical-align: -3px; margin-right: 4px; }

/* Azure Maps popup content */
.pop { font-family: var(--font); color: var(--ink); max-width: 280px; padding: 14px 16px 12px; font-size: 14px; line-height: 1.4; }
.pop h3 { font-size: 15px; margin: 0 0 4px; }
.pop h3 a { color: var(--ink); }
.pop p { margin: 0 0 8px; color: var(--ink-2); font-size: 13px; }
.pop .pop-place { font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.pop ul { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow-y: auto; }
.pop li + li { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }

/* ---------- Admin: import ---------- */
.import-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.import-steps div { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; font-size: .9rem; }
.import-steps strong { display: block; font-size: 1rem; }
.col-list { columns: 3 220px; font-size: .86rem; padding-left: 1.1em; }
.col-list code, code { font-size: .86em; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
tr.row-error td { background: #fff6f5; }
.row-msg { color: var(--danger); font-weight: 700; font-size: .82rem; }
.row-ok { color: var(--success); font-weight: 700; font-size: .82rem; }
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px 18px; min-width: 150px; }
.stat b { display: block; font-size: 1.6rem; font-weight: 900; line-height: 1.1; }
.stat span { font-size: .8rem; font-weight: 700; color: var(--ink-2); }

@media (max-width: 1080px) {
  .compare { grid-template-columns: 1fr; }
  .side-card { max-height: 520px; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .form-grid.four { grid-template-columns: 1fr 1fr; }
  .import-steps { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .nav-link { padding: 6px 8px; }
  .nav-add { margin-left: 0; }
  .form-grid.four { grid-template-columns: 1fr; }
  #map { height: 440px; }
  .event { flex-wrap: wrap; gap: 12px; padding: 12px 14px; }
  .event-main { flex-basis: calc(100% - 80px); }
  .event-open { width: 100%; }
  /* Calendar becomes an agenda: only days with events, stacked. */
  .cal, .cal tbody, .cal tr, .cal td { display: block; width: 100%; height: auto; }
  .cal thead { display: none; }
  .cal td { border-right: 0; padding: 10px 12px; }
  .cal td.is-empty, .cal td.is-other { display: none; }
  .cal-dowm { display: inline; font-weight: 800; color: var(--ink-2); margin-left: 6px; font-size: .84rem; }
  .cal-chip { white-space: normal; font-size: .84rem; padding: 6px 8px; }
  .hero-actions { width: 100%; }
}
.mt { margin-top: 20px; }
.cal td { overflow: hidden; }
.cal-events { grid-template-columns: minmax(0, 1fr); }
.cal-events li { min-width: 0; }
input[type=month] { width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: #fff; border: 2px solid var(--line-2); border-radius: 8px; padding: .45em .75em; min-height: 46px; }
.legend .region-chip { text-decoration: none; }
.legend .region-chip:hover { color: var(--blue); text-decoration: underline; }
.wrap.form-wrap { max-width: 1040px; }
