:root {
  --paper: #0b0a24;
  --surface: #15133a;
  --surface-2: #1c1a4a;
  --surface-3: #232060;
  --ink: #eeedff;
  --muted: #a4a2d4;
  --line: #2a2766;
  --brand: #7c6cff;
  --brand-strong: #b0a6ff;
  --brand-soft: rgba(124, 108, 255, 0.18);
  --grad: linear-gradient(135deg, #8b7bff 0%, #5b4ef0 55%, #4a3fd6 100%);
  --date-grad: linear-gradient(160deg, #5a49e0 0%, #3a2fb0 60%, #2a2390 100%);
  --amber: #ffb054;
  --amber-soft: rgba(255, 166, 64, 0.16);
  --green: #3ddc97;
  --green-soft: rgba(61, 220, 151, 0.14);
  --rose: #ff6f8e;
  --rose-soft: rgba(255, 111, 142, 0.15);
  --blue: #5aa9ff;
  --blue-soft: rgba(90, 169, 255, 0.15);
  --violet: #c08bff;
  --violet-soft: rgba(192, 139, 255, 0.16);
  --nav-bg: #0e0c2c;
  --nav-ink: #eeedff;
  --nav-muted: #a4a2d4;
  --nav-active: linear-gradient(135deg, #6f60f5, #4e43d8);
  --focus: #b0a6ff;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px rgba(5, 4, 20, 0.35);
  --glow: 0 0 0 1px rgba(124, 108, 255, 0.55), 0 0 22px rgba(124, 108, 255, 0.25);
  --head: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --body: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  color: var(--ink); font: 15px/1.55 var(--body); min-height: 100vh;
  background:
    radial-gradient(900px 500px at 10% 110%, rgba(109, 77, 255, 0.28), transparent 60%),
    radial-gradient(700px 420px at 95% -10%, rgba(80, 70, 230, 0.16), transparent 60%),
    var(--paper);
  background-attachment: fixed;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--head); line-height: 1.2; margin: 0; }
h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ti { font-size: 18px; line-height: 1; }

/* Layout */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.nav {
  padding: 22px 14px; display: flex; flex-direction: column; gap: 26px; position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(420px 320px at 0% 100%, rgba(124, 92, 255, 0.35), transparent 70%),
    linear-gradient(180deg, #110f33, var(--nav-bg));
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--nav-ink); padding: 0 8px; }
.brand .ti { font-size: 26px; color: var(--brand-strong); }
.brand span { font: 800 18px/1.1 var(--head); display: flex; flex-direction: column; gap: 3px; }
.brand small { font: 500 12px var(--body); color: var(--nav-muted); }
.nav nav { display: flex; flex-direction: column; gap: 4px; }
.nav nav a { text-decoration: none; padding: 10px 12px; border-radius: 12px; display: flex; justify-content: space-between; align-items: center; color: var(--nav-muted); font-weight: 600; font-size: 14px; }
.nav nav a > span:first-child { display: inline-flex; align-items: center; gap: 12px; }
.nav nav .short { display: none; }
.nav nav .more-tab { display: none; }
#more-sheet { display: none; }
.nav nav a:hover { color: var(--nav-ink); background: rgba(255, 255, 255, 0.05); }
.nav nav a.active { color: #fff; background: var(--nav-active); box-shadow: 0 6px 18px rgba(92, 78, 240, 0.35); }
.count { font-size: 12px; font-weight: 700; min-width: 22px; text-align: center; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); color: #fff; }
.count:empty { display: none; }
.count.warn { background: #ff9d2e; color: #2a1600; }
.nav-foot { margin-top: auto; display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--nav-muted); padding: 0 10px; text-decoration: none; }
.nav-foot span { text-decoration: underline; text-underline-offset: 3px; }
.nav-foot-group { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.nav-foot-group .nav-foot { margin-top: 0; }
main { padding: 30px 36px 64px; max-width: 1220px; width: 100%; }
main:focus { outline: none; }
body.public .shell { grid-template-columns: 1fr; }
body.public .nav { display: none; }
body.public main { margin: 0 auto; max-width: 720px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 70ch; font-size: 14px; }
.section { margin-top: 34px; }
.section > h2 { margin-bottom: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Controls */
button, .btn { font: 600 14px var(--body); border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); padding: 8px 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
button:hover, .btn:hover { border-color: var(--brand); color: #fff; }
button.primary { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(92, 78, 240, 0.35); }
button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--rose); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
input, select, textarea { font: 14px var(--body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; width: 100%; }
input::placeholder, textarea::placeholder { color: #7d7bb0; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { min-height: 84px; resize: vertical; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-size: 13px; }
label.check input { width: auto; accent-color: var(--brand); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.filters input[type=search] { flex: 1 1 240px; }
.filters select { width: auto; }

/* Event cards */
.month { font: 700 15px var(--head); color: var(--ink); margin: 26px 0 12px; }
.opp {
  width: 100%; text-align: left; display: grid; grid-template-columns: 92px 1fr auto; gap: 18px; align-items: center;
  padding: 12px 14px 12px 12px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent), var(--surface); box-shadow: var(--shadow); color: var(--ink);
}
.opp:hover { border-color: rgba(124, 108, 255, 0.7); box-shadow: var(--glow); color: var(--ink); }
.lead { display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--date-grad); color: #fff; border-radius: 12px; padding: 10px 6px; min-height: 86px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15); }
.lead .num { font: 800 30px/1 var(--head); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.lead .mon { font: 800 12px/1.2 var(--head); letter-spacing: 0.08em; margin-top: 3px; }
.lead .unit { font-size: 11px; margin-top: 4px; opacity: 0.8; text-align: center; }
.lead.now { background: linear-gradient(160deg, #1fa874, #0f7350); }
.lead.now .num { font-size: 18px; }
.opp h3 { margin-bottom: 3px; font-size: 15px; }
.opp .where { color: var(--muted); font-size: 13px; }
.opp .facts { margin-top: 4px; font-size: 13px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tag { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-strong); border: 1px solid rgba(124, 108, 255, 0.25); }
.tag.sponsor { background: linear-gradient(135deg, #ff9d2e, #ff7a1a); color: #2a1300; border-color: transparent; }
.tag.plain { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
.side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.side-row { display: flex; align-items: center; gap: 10px; }
.kebab { color: var(--muted); font-size: 18px; }
.stage { font-size: 11px; font-weight: 700; padding: 3px 11px; border-radius: 999px; background: var(--grad); color: #fff; white-space: nowrap; }
.stage-shortlisted { background: var(--violet-soft); color: var(--violet); }
.stage-contacted { background: var(--amber-soft); color: var(--amber); }
.stage-confirmed { background: var(--green-soft); color: var(--green); }
.stage-done, .stage-skipped { background: var(--surface-2); color: var(--muted); }
.src { font-size: 12px; color: var(--muted); }
.src.verified { color: var(--green); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 700; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: rgba(124, 108, 255, 0.08); }
td.url { word-break: break-all; max-width: 380px; }
.name-cell { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.avatar { width: 30px; height: 30px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.av-0 { background: var(--brand-soft); color: var(--brand-strong); }
.av-1 { background: var(--green-soft); color: var(--green); }
.av-2 { background: var(--rose-soft); color: var(--rose); }
.av-3 { background: var(--amber-soft); color: var(--amber); }
.av-4 { background: var(--blue-soft); color: var(--blue); }
.status { font-size: 12px; font-weight: 700; padding: 3px 11px; border-radius: 8px; display: inline-block; white-space: nowrap; }
.status.active, .status.done, .status.finished { background: var(--green-soft); color: var(--green); border: 1px solid rgba(61, 220, 151, 0.3); }
.status.broken, .status.failed, .status.blocked { background: var(--rose-soft); color: var(--rose); border: 1px solid rgba(255, 111, 142, 0.3); }
.status.pending, .status.running { background: var(--amber-soft); color: var(--amber); border: 1px solid rgba(255, 166, 64, 0.3); }

/* Colleges filters */
.college-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.college-filters .search-row { grid-column: 1 / -1; display: flex; gap: 10px; }
.filter-toggle { display: none; flex: none; }
.filter-toggle .count:empty { display: none; }
.college-filters select { width: 100%; }
.filter-summary { display: flex; align-items: center; gap: 12px; margin: 10px 2px 12px; font-size: 13px; color: var(--muted); }
.filter-summary strong { color: var(--ink); }
.link-btn { background: transparent; border: 0; padding: 2px 4px; color: var(--brand-strong); font-size: 13px; }
.link-btn:hover { color: #fff; }
.org-actions { display: flex; align-items: center; gap: 10px; white-space: nowrap; }

/* College page */
.facts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 24px; margin-top: 16px; }
.facts-grid div span { display: block; font-size: 12px; color: var(--muted); }
.add-source { display: grid; grid-template-columns: 1fr 170px auto; gap: 8px; margin-top: 12px; }

/* Pages and runs */
.run-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.run-card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.run-card h3 { font-size: 14px; }
.run-card p { color: var(--muted); font-size: 12.5px; flex: 1; }
.run-card button { background: var(--brand-soft); border-color: rgba(124, 108, 255, 0.35); color: #fff; }
.run-card button.primary { background: var(--grad); border-color: transparent; }
.summary-line { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 8px; }
.summary-line div { border-radius: 16px; padding: 16px 18px; border: 1px solid var(--line); background: var(--surface); }
.summary-line div strong { display: block; font: 800 30px/1.1 var(--head); }
.summary-line div span { font-size: 12px; color: var(--muted); }
.summary-line div:nth-child(1) { background: linear-gradient(140deg, rgba(124, 108, 255, 0.32), rgba(124, 108, 255, 0.08)); border-color: rgba(124, 108, 255, 0.45); }
.summary-line div:nth-child(2) { background: linear-gradient(140deg, rgba(90, 169, 255, 0.28), rgba(90, 169, 255, 0.06)); border-color: rgba(90, 169, 255, 0.4); }
.summary-line div:nth-child(3) { background: linear-gradient(140deg, rgba(61, 220, 151, 0.24), rgba(61, 220, 151, 0.05)); border-color: rgba(61, 220, 151, 0.35); }
.summary-line div:nth-child(4) { background: linear-gradient(140deg, rgba(255, 111, 142, 0.26), rgba(255, 111, 142, 0.05)); border-color: rgba(255, 111, 142, 0.38); }
details pre { white-space: pre-wrap; font-size: 12px; background: var(--paper); padding: 10px; border-radius: 10px; max-height: 320px; overflow: auto; margin: 8px 0 0; }
details summary { cursor: pointer; color: var(--brand-strong); font-weight: 600; }
.notice { border: 1px solid rgba(255, 166, 64, 0.35); background: var(--amber-soft); color: var(--ink); border-radius: 12px; padding: 12px 14px; margin-bottom: 18px; font-size: 14px; }

/* Dialog */
dialog { border: 1px solid var(--line); border-radius: 18px; padding: 0; width: min(760px, 94vw); background: var(--surface); color: var(--ink); max-height: 90vh; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); }
dialog::backdrop { background: rgba(6, 5, 20, 0.7); backdrop-filter: blur(2px); }
.dlg-head { padding: 20px 24px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; }
.dlg-head p { color: var(--muted); margin-top: 4px; font-size: 14px; }
.dlg-body { padding: 18px 24px; overflow-y: auto; max-height: calc(90vh - 150px); }
.dlg-foot { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.grid2 .full { grid-column: 1 / -1; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font: 700 15px var(--head); margin-bottom: 10px; padding: 0; }
.review-note { background: var(--amber-soft); color: var(--amber); padding: 8px 12px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }
.icon-btn { border: 0; background: transparent; font-size: 22px; line-height: 1; padding: 4px 8px; color: var(--muted); }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 16px; margin-top: 16px; background: var(--surface); }
.empty strong { display: block; color: var(--ink); font-family: var(--head); font-size: 17px; margin-bottom: 4px; }
.error-text { color: var(--rose); font-size: 13px; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--surface-3); border: 1px solid var(--line); color: #fff; padding: 10px 18px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; box-shadow: var(--shadow); }
#toast.show { opacity: 1; }

/* Fest calendar: cards */
.opp.static { cursor: default; }
.opp.static:hover { border-color: var(--line); box-shadow: var(--shadow); }
.lead.fest-lead { background: var(--amber-soft); color: var(--amber); box-shadow: inset 0 0 0 1px rgba(255, 166, 64, 0.3); }
.lead.fest-lead.later { background: var(--brand-soft); color: var(--brand-strong); box-shadow: inset 0 0 0 1px rgba(124, 108, 255, 0.3); }
.lead .num.month { font: 800 24px/1 var(--head); color: inherit; margin: 0; }
.tag.conf-likely { background: var(--green-soft); color: var(--green); border-color: rgba(61, 220, 151, 0.3); }
.tag.conf-possible { background: var(--amber-soft); color: var(--amber); border-color: rgba(255, 166, 64, 0.3); }
.tag.conf-announced { background: var(--brand-soft); color: var(--brand-strong); }
.tag.conf-rough-guess { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
.stage.contact-now { background: linear-gradient(135deg, #ffb054, #ff8a1f); color: #2a1300; }
.opp .side .icon-btn { margin-top: 6px; font-size: 13px; color: var(--brand-strong); }

/* Events page */
.ev-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.ev-toolbar .seg button { display: inline-flex; align-items: center; gap: 6px; }
.ev-toolbar .seg .ti { font-size: 16px; }
.due-banner { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; margin-bottom: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(255, 166, 64, 0.4); background: linear-gradient(135deg, rgba(255, 166, 64, 0.2), rgba(255, 166, 64, 0.06)); color: var(--ink); font-weight: 500; }
.due-banner:hover { border-color: var(--amber); color: var(--ink); }
.due-banner .ti { color: var(--amber); font-size: 20px; flex: none; }
.due-banner span { flex: 1; }
.opp.expected { border-style: dashed; border-color: rgba(164, 162, 212, 0.35); background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent), rgba(21, 19, 58, 0.7); }
.tag.expected-tag { display: inline-flex; align-items: center; gap: 4px; background: rgba(255, 255, 255, 0.06); color: var(--ink); border-color: rgba(255, 255, 255, 0.14); }
.tag.expected-tag .ti { font-size: 12px; color: var(--amber); }

/* Fest calendar: month grid */
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav h2 { min-width: 150px; text-align: center; font-size: 20px; }
.cal-nav button { padding: 6px 10px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 9px; color: var(--muted); }
.seg button.on { background: var(--grad); color: #fff; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.cal-dow { background: var(--surface-2); padding: 9px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.cal-day { background: var(--surface); min-height: 112px; padding: 7px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; border: 0; border-radius: 0; text-align: left; align-items: stretch; font: inherit; color: var(--ink); min-width: 0; }
.cal-day:hover { background: #1a1846; border-color: transparent; color: var(--ink); }
.cal-day.other { background: #110f30; color: #6f6da0; }
.cal-day.selected { box-shadow: inset 0 0 0 2px var(--brand), inset 0 0 18px rgba(124, 108, 255, 0.25); }
.cal-date { font-size: 12px; font-weight: 700; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; }
.cal-day.today .cal-date { background: var(--grad); color: #fff; }
.chips { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.chip { display: block; font-size: 11px; font-weight: 600; line-height: 1.35; padding: 2px 7px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 1px solid transparent; min-width: 0; }
.chip.event { background: var(--grad); color: #fff; }
.chip.fest { background: transparent; color: var(--muted); border-style: dashed; border-color: #6f6da0; }
.chip.fest.likely { color: var(--green); border-color: var(--green); background: var(--green-soft); }
.chip.fest.possible { color: var(--amber); border-color: var(--amber); background: var(--amber-soft); }
.chip.contact { background: rgba(255, 166, 64, 0.08); color: var(--amber); border-color: var(--amber); }
.chip.more { color: var(--brand-strong); padding: 0 7px; font-weight: 700; }
.cal-legend { display: flex; gap: 16px; flex-wrap: wrap; margin: 12px 2px 0; font-size: 12px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend .chip { width: 10px; height: 10px; padding: 0; border-radius: 50%; }
.cal-panel { margin-top: 20px; }
.cal-panel > h2 { margin-bottom: 4px; }
.cal-panel .month { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 14px 0 10px; }

/* Map */
.map-box { position: relative; height: min(66vh, 640px); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); background: #0d1a14; }
.map-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.map-chip { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 600; }
.map-chip .short { display: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.map-summary { position: absolute; z-index: 500; top: 14px; right: 14px; background: rgba(21, 19, 58, 0.88); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow); pointer-events: none; }
.map-summary strong { display: block; font: 800 15px var(--head); }
.map-summary span { font-size: 12px; color: var(--muted); }
.pin { filter: drop-shadow(0 0 6px rgba(124, 108, 255, 0.9)); }
.pin-call { filter: drop-shadow(0 0 7px rgba(255, 166, 64, 0.95)); }
.pin-expected { filter: drop-shadow(0 0 7px rgba(61, 220, 151, 0.9)); }
.pin-none { filter: drop-shadow(0 0 4px rgba(164, 162, 212, 0.6)); }
.pin-pop h3 { font-size: 15px; margin-bottom: 2px; }
.pin-pop p { margin: 6px 0 0; font-size: 13px; line-height: 1.45; }
.pin-pop .btn { padding: 6px 11px; font-size: 13px; }
.pop-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pop-actions .btn.primary { background: var(--grad); color: #fff; border-color: transparent; }
.leaflet-container { font: inherit; background: #0d1a14; }
.map-box .leaflet-popup-content-wrapper, .map-box .leaflet-popup-tip { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); }
.map-box .leaflet-popup-content-wrapper { border-radius: 14px; }
.map-box .leaflet-popup-content { margin: 14px 16px; font: inherit; }
.map-box .leaflet-container a.btn, .map-box .pin-pop a.btn { color: var(--ink); }
.map-box .pin-pop a.btn.primary { color: #fff; }
.map-box .leaflet-popup-close-button { color: var(--muted); }
.leaflet-bar a { background: var(--surface); color: var(--ink); border-color: var(--line); }
.leaflet-control-attribution { background: rgba(14, 12, 44, 0.8) !important; color: var(--muted); }
.leaflet-control-attribution a { color: var(--brand-strong); }
.leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.8) contrast(0.95) saturate(0.9); }

@media (max-width: 760px) {
  /* Slim top header + bottom tab bar, like a phone app */
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav { position: sticky; top: 0; z-index: 900; height: auto; flex-direction: row; align-items: center; justify-content: space-between; padding: 10px 16px; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); background: #0e0c2c; }  /* no blur here: it would trap the fixed tab bar inside the header */
  .brand .ti { font-size: 22px; }
  .brand span { font-size: 16px; }
  .brand small { display: none; }
  .nav nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: rgba(14, 12, 44, 0.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
  .nav nav a { position: relative; flex-direction: column; justify-content: center; padding: 6px 2px; border-radius: 10px; font-size: 10px; font-weight: 700; gap: 0; }
  .nav nav a > span:first-child { flex-direction: column; gap: 3px; }
  .nav nav a .ti { font-size: 22px; }
  .nav nav .long { display: none; }
  .nav nav .short { display: block; }
  .nav nav a.active { background: transparent; box-shadow: none; color: var(--brand-strong); }
  .nav nav a.active .ti { filter: drop-shadow(0 0 6px rgba(124, 108, 255, 0.8)); }
  .nav nav .count { position: absolute; top: 2px; left: 50%; margin-left: 5px; font-size: 10px; min-width: 17px; padding: 0 5px; line-height: 16px; }
  .nav-foot-group { display: none; }
  .nav nav .in-more { display: none; }
  .nav nav .more-tab { display: flex; }
  /* The More sheet slides up from the bottom */
  #more-sheet[open] { display: flex; flex-direction: column; gap: 4px; width: 100vw; max-width: 100vw; margin: auto 0 0; padding: 8px 12px calc(16px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; }
  .sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 10px; }
  #more-sheet a { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 15px; }
  #more-sheet a:hover, #more-sheet a.active { background: var(--brand-soft); }
  #more-sheet a .ti { font-size: 22px; color: var(--brand-strong); width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; flex: none; }
  #more-sheet a > span:not(.count) { display: flex; flex-direction: column; flex: 1; }
  #more-sheet small { font-weight: 500; font-size: 12px; color: var(--muted); }
  #more-sheet .count { position: static; margin: 0; font-size: 12px; line-height: 20px; min-width: 24px; }
  main { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  h1 { font-size: 24px; }
  .page-head { margin-bottom: 14px; }
  .page-head p { font-size: 13px; }

  /* Event cards */
  .opp { grid-template-columns: 72px 1fr; padding: 10px; gap: 12px; }
  .opp .side { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; }
  .kebab { display: none; }
  .lead { min-height: 76px; padding: 8px 4px; }
  .lead .num { font-size: 26px; }
  .lead .unit { white-space: nowrap; font-size: 10px; }
  .opp h3 { font-size: 14px; }

  /* Filters: two neat columns */
  .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .filters input[type=search] { grid-column: 1 / -1; }
  .filters select { width: 100%; }
  .filters label.check { grid-column: 1 / -1; }
  .college-filters { grid-template-columns: 1fr 1fr; }
  .filter-toggle { display: inline-flex; }
  .college-filters.collapsed select { display: none; }
  .ev-toolbar .seg { flex: 1 1 100%; }
  .ev-toolbar .seg button { flex: 1; justify-content: center; }

  .grid2 { grid-template-columns: 1fr; }
  .add-source { grid-template-columns: 1fr; }
  .facts-grid { grid-template-columns: 1fr 1fr; gap: 12px 16px; }
  .summary-line { grid-template-columns: 1fr 1fr; gap: 10px; }
  .summary-line div { padding: 12px 14px; }
  .summary-line div strong { font-size: 24px; }

  /* Tables become cards */
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack thead { display: none; }
  table.stack tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.stack tr:last-child { border-bottom: 0; }
  table.stack td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; }
  table.stack td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; text-align: left; flex: none; }
  table.stack td[data-label=""]::before { display: none; }
  table.stack td:first-child { text-align: left; padding-bottom: 6px; }
  table.stack td:first-child::before { display: none; }
  table.stack td.url { max-width: none; }
  table.stack td select { max-width: 60%; }
  tr.click:hover td { background: transparent; }

  /* Calendar */
  .cal-toolbar { gap: 10px; }
  .cal-nav h2 { min-width: 0; font-size: 17px; }
  .cal-dow { padding: 6px 2px; text-align: center; font-size: 10px; }
  .cal-day { min-height: 56px; padding: 4px; align-items: center; }
  .chips { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 3px; }
  .chip, .cal-legend .chip { width: 9px; height: 9px; padding: 0; border-radius: 50%; font-size: 0; border: 0; }
  .chip.fest { background: #8a88bd; }
  .chip.fest.likely { background: var(--green); }
  .chip.fest.possible { background: var(--amber); }
  .chip.contact { background: transparent; box-shadow: inset 0 0 0 2px var(--amber); }
  .chip.more { display: none; }
  .cal-legend { gap: 8px 14px; }

  /* Map */
  .map-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .map-chip { padding: 7px 10px; font-size: 12px; border-radius: 10px; white-space: nowrap; }
  .map-chip .long { display: none; }
  .map-chip .short { display: inline; }
  .map-box { height: 62vh; }
  .map-summary { top: auto; bottom: 30px; right: 10px; }

  /* Event dialog as a bottom sheet */
  dialog { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 18px 18px 0 0; overflow: hidden; }
  /* Header and buttons stay put; only the middle scrolls, so Save is always visible */
  dialog > form { display: flex; flex-direction: column; max-height: 92dvh; }
  .dlg-head, .dlg-body, .dlg-foot { padding-left: 16px; padding-right: 16px; }
  .dlg-head { flex: none; }
  .dlg-body { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; }
  .dlg-foot { flex: none; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .dlg-foot button { flex: 1 1 auto; justify-content: center; }
  #toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }
