:root {
  /* TMCSS 視覺色彩規範 V3 — 天映澄心 · 蔚藍致遠 */
  --navy-950: #00264d;
  --navy-900: #003366; /* 深邃藍 Academic Navy */
  --navy-800: #10508f;
  --ink: #1b2b3a;
  --muted: #5b6f7e;
  --line: #e3e8ee;
  --surface: #ffffff;
  --canvas: #f0f2f5; /* 暖灰 Warm Gray */
  --sky: #5dadec; /* 澄空藍 Vivid Sky Blue */
  --sky-soft: #eaf4fd;
  --cerulean: #0871a8; /* 蔚藍 Cerulean — 深化以提高文字對比度 */
  --cerulean-soft: #e5f3fb;
  --accent: #0a659f; /* 蔚藍 Cerulean Accent — 白字對比度達 AA */
  --accent-dark: #074f7e;
  --accent-soft: #e8f4fc;
  --crest-red: #ff0000; /* 校徽標準色 */
  --purple: #0a659f;
  --purple-soft: #e8f4fc;
  --yellow: #ffc72c; /* 金黃 Golden Yellow */
  --yellow-soft: #fff6db;
  --red: #e31837; /* 正紅 Scarlet Red */
  --red-soft: #fdeef0;
  --shadow: 0 14px 36px rgba(22, 44, 67, 0.08);
  font-family: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scrollbar-gutter: stable; }
body { margin: 0; background: var(--canvas); }
body.modal-open { overflow: hidden; }
button, input, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; transform: none !important; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { position: sticky; top: 0; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; width: 258px; flex: 0 0 258px; background: var(--navy-950); color: #d8e4ec; display: flex; flex-direction: column; padding: 28px 16px 18px; }
.brand-lockup { display: flex; align-items: center; gap: 12px; padding: 0 12px 34px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: #fff; background: var(--crest-red); border-radius: 11px; font-weight: 800; font-size: 13px; letter-spacing: 0; box-shadow: inset 0 -2px rgba(0,0,0,.12); }
.school-crest { position: relative; overflow: hidden; }
.school-crest > span { position: relative; z-index: 0; }
.school-crest > img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.brand-name { color: #fff; font-size: 15px; font-weight: 400; letter-spacing: 0; }
.brand-name strong { font-weight: 800; }
.brand-subtitle { color: #8095a9; font-size: 10px; text-transform: uppercase; letter-spacing: 0; margin-top: 3px; }
.nav-section-label { color: #71879c; font-size: 11px; letter-spacing: 0; padding: 0 14px 9px; }
.side-nav { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 12px; height: 44px; width: 100%; padding: 0 13px; border-radius: 9px; color: #aebdca; background: transparent; text-align: left; font-size: 13px; transition: .2s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-item.active { color: #fff; background: #0d4578; box-shadow: inset 3px 0 var(--sky); }
.nav-icon { width: 19px; text-align: center; opacity: .9; font-size: 17px; }
.nav-count { margin-left: auto; color: #fff; background: var(--accent); border-radius: 999px; min-width: 21px; height: 21px; display: grid; place-items: center; font-size: 11px; }
.sidebar-spacer { flex: 1; min-height: 50px; }
.sidebar-help { width: 100%; flex: 0 0 auto; text-align: left; display: flex; gap: 10px; align-items: flex-start; padding: 13px 12px; border: 1px solid rgba(255,255,255,.09); border-radius: 10px; background: rgba(255,255,255,.035); margin-bottom: 15px; }
.help-icon { width: 21px; height: 21px; flex: 0 0 21px; border: 1px solid #698297; border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: #b4c5d2; }
.sidebar-help strong { display: block; font-size: 11px; color: #d9e4eb; margin-bottom: 3px; }
.sidebar-help p { margin: 0; color: #8299ab; font-size: 10px; }
.sidebar-user { padding: 14px 5px 0; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 9px; }
.user-copy { min-width: 0; flex: 1; }
.user-copy strong, .user-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { color: #edf5f8; font-size: 12px; font-weight: 600; }
.user-copy span { color: #7890a2; font-size: 10px; margin-top: 3px; }

.main-content { flex: 1; min-width: 0; }
.topbar { height: 76px; padding: 0 42px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.78); backdrop-filter: blur(8px); }
.breadcrumbs { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #91a0ac; }
.breadcrumbs strong { color: var(--ink); font-size: 13px; font-weight: 600; }
.crumb-separator { color: #c2ccd4; }
.topbar-actions { display: flex; align-items: center; gap: 17px; }
.icon-button { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: transparent; color: #667786; position: relative; font-size: 18px; }
.icon-button:hover { background: #edf3f5; color: var(--navy-900); }
.icon-button.ghost { color: #8ca0b1; font-size: 19px; }
.notification-button { color: #667786; }
.notification-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notification-dot { position: absolute; width: 6px; height: 6px; border: 1px solid var(--surface); background: var(--red); border-radius: 50%; top: 6px; right: 6px; }
.topbar-user { display: flex; align-items: center; gap: 8px; background: transparent; color: var(--ink); padding: 3px; }
.topbar-user-name { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.chevron { color: #9ba9b5; font-size: 13px; margin-left: 1px; }
.avatar { flex: 0 0 31px; width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center; font-size: 10px; font-weight: 700; letter-spacing: 0; }
.avatar-ink { background: #1b5d95; color: #d8e9f8; }
.avatar-sun { background: #f8dda4; color: #704f1e; }
.mobile-menu, .mobile-nav, .mobile-copy, .admin-quick-actions { display: none; }

.page-root { max-width: 1440px; margin: 0 auto; padding: 36px 42px 54px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; }
.eyebrow { color: var(--cerulean); text-transform: uppercase; letter-spacing: 0; font-size: 10px; font-weight: 700; margin-bottom: 7px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 26px; line-height: 1.25; letter-spacing: 0; margin-bottom: 7px; color: var(--navy-950); }
.page-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.primary-button, .secondary-button, .text-button, .danger-button { border-radius: 8px; font-size: 12px; font-weight: 600; display: inline-flex; justify-content: center; align-items: center; gap: 7px; transition: .2s ease; }
.primary-button { background: var(--accent); color: #fff; padding: 11px 17px; box-shadow: 0 7px 18px rgba(14,127,201,.24); }
.primary-button:hover { background: var(--navy-900); transform: translateY(-1px); }
.secondary-button { background: #fff; color: var(--navy-900); border: 1px solid var(--line); padding: 10px 15px; }
.secondary-button:hover { border-color: #b9cbd5; background: #fbfcfd; }
.text-button { color: var(--accent); background: transparent; padding: 5px 0; }
.text-button:hover { color: var(--navy-900); }
.danger-button { color: var(--red); background: var(--red-soft); padding: 9px 13px; }

.welcome-band { background: var(--navy-900); color: #fff; border-radius: 12px; padding: 24px 28px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; overflow: hidden; position: relative; }
.welcome-band::after { content: ""; position: absolute; width: 260px; height: 260px; border: 1px solid rgba(93,173,236,.28); border-radius: 50%; right: 30px; top: -160px; box-shadow: 0 0 0 28px rgba(93,173,236,.06), 0 0 0 56px rgba(93,173,236,.035); }
.welcome-band h2 { margin: 0 0 7px; font-size: 19px; letter-spacing: 0; position: relative; z-index: 1; }
.welcome-band p { margin: 0; font-size: 12px; color: #aac7e5; position: relative; z-index: 1; }
.welcome-meta { text-align: right; position: relative; z-index: 1; }
.welcome-meta span { font-size: 10px; color: #85a9cf; display: block; margin-bottom: 4px; }
.welcome-meta strong { color: #fff; font-size: 22px; }
.school-identity { display: flex; align-items: center; gap: 28px; margin: 0 0 24px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; }
.school-banner { position: relative; flex: 1 1 560px; max-width: 620px; min-height: 72px; overflow: hidden; background: transparent; }
.school-banner img { position: relative; z-index: 1; display: block; width: 100%; height: 72px; object-fit: contain; object-position: left center; background: transparent; }
.banner-fallback { position: absolute; inset: 0; display: flex; align-items: center; gap: 14px; padding: 0 16px; background: transparent; color: var(--navy-950); }
.banner-fallback strong { font-size: 20px; }
.banner-fallback span { color: #718493; font-size: 11px; }
.identity-stats { flex: 1 1 360px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-left: 1px solid var(--line); }
.identity-stats div { min-width: 0; padding: 6px 18px; }
.identity-stats strong, .identity-stats span { display: block; }
.identity-stats strong { color: var(--navy-950); font-size: 20px; line-height: 1; margin-bottom: 7px; }
.identity-stats span { color: #82919e; font-size: 10px; line-height: 1.4; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; }
.search-row, .filter-controls { display: contents; }
.mobile-filter-button { display: none; }
.search-box { min-width: 0; flex: 1; max-width: 340px; position: relative; }
.search-box span { position: absolute; left: 13px; top: 10px; color: #96a6b2; font-size: 15px; }
.search-box input { width: 100%; height: 39px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 0 13px 0 35px; color: var(--ink); outline: none; font-size: 12px; }
.search-box input:focus { border-color: #93c4e6; box-shadow: 0 0 0 3px rgba(14,127,201,.12); }
.toolbar > .custom-select, .filter-controls > .custom-select { width: 158px; flex: 0 0 158px; }
.filter-spacer { flex: 1; }
.category-tabs { display: flex; gap: 8px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 2px; }
.category-tab { flex: 0 0 auto; border: 1px solid var(--line); color: #738392; background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 11px; }
.category-tab.active { color: var(--accent); background: #fff; border-color: rgba(14,127,201,.3); font-weight: 700; box-shadow: inset 0 -2px var(--accent); }

.section-header { display: flex; justify-content: space-between; align-items: center; margin: 26px 0 15px; }
.section-header h2 { margin: 0; font-size: 15px; color: var(--navy-950); }
.section-header span { color: #94a2ad; font-size: 11px; }
.event-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.event-card { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; overflow: hidden; cursor: pointer; transition: .22s ease; display: flex; flex-direction: column; min-width: 0; }
.event-card:hover { transform: translateY(-3px); border-color: #c9dadd; box-shadow: var(--shadow); }
.event-image { height: 145px; position: relative; overflow: hidden; isolation: isolate; background: #e8edf0; }
.event-image img { display: block; }
.event-image-backdrop { position: absolute; z-index: 0; inset: -14px; width: calc(100% + 28px); height: calc(100% + 28px); object-fit: cover; filter: blur(14px); opacity: .28; transform: scale(1.06); }
.event-image-main { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; }
.image-overlay { position: absolute; z-index: 2; inset: 0; background: linear-gradient(180deg, rgba(12,33,51,0), rgba(12,33,51,.13)); pointer-events: none; }
.event-category { position: absolute; z-index: 3; left: 12px; top: 11px; background: rgba(255,255,255,.93); border-radius: 999px; padding: 6px 10px; color: var(--accent); font-size: 11px; font-weight: 700; box-shadow: 0 4px 12px rgba(16,36,58,.1); }
.tone-purple .event-category { color: var(--purple); background: rgba(240,248,254,.95); }
.tone-gold .event-category { color: #95631a; background: rgba(255,247,224,.95); }
.tone-teal .event-category { color: #0b6ba3; background: rgba(234,244,253,.95); }
.event-status { position: absolute; z-index: 3; right: 12px; top: 11px; border-radius: 999px; padding: 6px 10px; font-size: 11px; font-weight: 700; }
.status-open { color: #0b6ba3; background: #e4f2fb; }
.status-soon { color: #8d6621; background: #fff2d2; }
.status-full { color: #a04b4b; background: #ffedeb; }
.event-body { min-width: 0; padding: 15px 15px 14px; display: flex; flex-direction: column; flex: 1; }
.event-body h3 { margin-bottom: 7px; font-size: 17px; line-height: 1.45; color: var(--navy-950); }
.event-description { color: #586b7c; font-size: 11px; line-height: 1.65; min-height: 36px; margin-bottom: 14px; }
.event-details { display: grid; gap: 7px; border-top: 1px solid #edf1f3; padding-top: 12px; margin-top: auto; }
.detail-line { display: flex; align-items: flex-start; gap: 7px; color: #586f7d; font-size: 10px; }
.detail-line strong { color: #506676; font-weight: 600; }
.detail-icon { flex: 0 0 14px; color: var(--cerulean); width: 14px; text-align: center; }
.card-footer { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; border-top: 1px solid #edf1f3; margin-top: 13px; padding-top: 12px; }
.site-credit { max-width: 1440px; margin: 0 auto; padding: 0 42px 28px; color: #657785; font-size: 11px; line-height: 1.7; text-align: center; }
.site-credit-main { padding-top: 20px; border-top: 1px solid #d3dfe8; }
.site-credit-owner { margin: 0 0 4px; font: inherit; }
.site-credit-design { margin: 0; }
.site-credit-design > span { display: inline-block; }
.site-credit-design strong { color: inherit; font-weight: inherit; }
.site-credit-contact { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 28px; margin-top: 4px; padding: 2px 8px; border-radius: 4px; color: var(--navy-900); font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.site-credit-contact svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.site-credit-contact:hover { color: var(--cerulean); }
.site-credit-contact:focus-visible { outline: 2px solid var(--cerulean); outline-offset: 4px; }
.site-credit-legal { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 4px; }
.capacity-bar { display: flex; align-items: center; gap: 7px; color: #607482; font-size: 10px; }
.booking-open { color: var(--cerulean); font-weight: 600; }
.capacity-track { height: 4px; width: 52px; background: #e8eef0; border-radius: 10px; overflow: hidden; }
.capacity-fill { height: 100%; border-radius: 10px; background: var(--cerulean); }
.capacity-fill.warn { background: var(--yellow); }

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 25px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 17px 18px; }
.stat-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.stat-label { color: #586b7c; font-size: 11px; }
.stat-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; background: var(--cerulean-soft); color: var(--cerulean); font-size: 14px; }
.stat-card:nth-child(2) .stat-icon { background: var(--purple-soft); color: var(--purple); }
.stat-card:nth-child(3) .stat-icon { background: var(--yellow-soft); color: #b27922; }
.stat-card:nth-child(4) .stat-icon { background: #fcecea; color: var(--red); }
.stat-value { display: flex; align-items: baseline; gap: 7px; }
.stat-value strong { font-size: 25px; color: var(--navy-950); line-height: 1; }
.stat-value span { color: var(--cerulean); font-size: 10px; }
.stat-note { color: #627786; font-size: 10px; margin-top: 7px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(300px, 1fr); gap: 16px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 19px; min-width: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 19px; }
.panel-heading h2 { margin: 0; font-size: 14px; color: var(--navy-950); }
.panel-heading span { color: #95a3ad; font-size: 10px; }
.bar-chart { height: 190px; display: flex; align-items: end; gap: 18px; padding: 10px 7px 0; border-bottom: 1px solid var(--line); position: relative; }
.bar-chart::before, .bar-chart::after { content: ""; position: absolute; left: 0; right: 0; border-top: 1px dashed #edf1f3; }
.bar-chart::before { top: 32%; }.bar-chart::after { top: 66%; }
.bar-item { flex: 1; height: 100%; display: flex; align-items: center; justify-content: end; flex-direction: column; gap: 7px; position: relative; z-index: 1; }
.bar-column { width: min(30px, 70%); min-height: 7px; border-radius: 6px 6px 0 0; background: #a5cfef; }
.bar-item:nth-child(2n) .bar-column { background: #4a9fdc; }.bar-item:last-child .bar-column { background: var(--navy-900); }
.bar-label { color: #94a1ab; font-size: 10px; }
.bar-count { color: #526979; font-size: 10px; line-height: 1; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 580px; }
.data-table th { color: #94a1ac; font-size: 10px; font-weight: 500; text-align: left; border-bottom: 1px solid var(--line); padding: 0 10px 11px; white-space: nowrap; }
.data-table td { border-bottom: 1px solid #f0f3f5; padding: 13px 10px; font-size: 11px; color: #566b7a; white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }.data-table td:first-child { color: var(--navy-950); font-weight: 600; }
.mini-status { display: inline-flex; padding: 4px 7px; border-radius: 4px; font-size: 10px; }.mini-status.approved { color: #0b6ba3; background: #e4f2fb; }.mini-status.pending { color: #966e28; background: #fff5df; }.mini-status.cancelled { color: #9c4b4b; background: #ffedeb; }
.admin-section { margin-top: 16px; }
.table-actions { display: flex; align-items: center; gap: 7px; }
.danger-text { color: var(--red); }
.table-muted { color: #a0adb5; font-size: 10px; }
.inline-empty { padding: 18px 8px; color: #95a3ad; font-size: 11px; text-align: center; }
.school-list { display: grid; gap: 13px; }.school-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }.school-name { color: #637583; font-size: 11px; }.school-count { color: var(--navy-950); font-size: 11px; font-weight: 700; }.school-progress { grid-column: 1 / -1; height: 5px; background: #edf2f3; border-radius: 20px; overflow: hidden; }.school-progress span { display: block; height: 100%; background: var(--cerulean); border-radius: 20px; }

.admin-heading { margin-bottom: 20px; }
.admin-tabs { display: flex; align-items: center; gap: 4px; margin: 0 0 24px; padding: 4px; width: max-content; max-width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #eef2f4; overflow-x: auto; }
.admin-tab { flex: 0 0 auto; min-height: 36px; padding: 0 15px; border-radius: 6px; background: transparent; color: #70808d; font-size: 11px; font-weight: 600; }
.admin-tab.active { background: #fff; color: var(--navy-950); box-shadow: 0 1px 4px rgba(16,36,58,.1); }
.admin-quick-actions-visible { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.admin-quick-actions-visible button { min-height: 70px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--navy-900); display: flex; align-items: center; gap: 10px; text-align: left; }
.admin-quick-actions-visible button:hover { border-color: #b3d4ea; }
.admin-quick-actions-visible span { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 7px; background: var(--cerulean-soft); color: var(--cerulean); font-size: 16px; }
.admin-quick-actions-visible strong { font-size: 11px; }
.review-workspace { min-width: 0; }
.review-toolbar { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; background: #fff; }
.review-search { max-width: none; }
.review-action:focus-visible { outline: 2px solid var(--cerulean); outline-offset: 2px; }
.review-toolbar > .custom-select { width: 138px; flex: 0 0 138px; }
.review-toolbar > .review-event-select { width: 230px; flex-basis: 230px; }
.review-summary { display: flex; justify-content: space-between; gap: 12px; padding: 0 16px 12px; border-inline: 1px solid var(--line); background: #fff; color: #8b9aa5; font-size: 10px; }
.review-summary strong { color: var(--navy-950); }
.review-table-wrap { padding: 0 6px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; background: #fff; }
.application-table { min-width: 860px; table-layout: fixed; }
.application-table th:first-child { width: 29%; }
.application-table th:nth-child(2) { width: 16%; }
.application-table th:nth-child(3) { width: 15%; }
.application-table th:nth-child(4) { width: 13%; }
.application-table th:nth-child(5) { width: 10%; }
.application-table th:nth-child(6) { width: 17%; }
.application-table td { vertical-align: middle; }
.review-event { display: grid; gap: 4px; max-width: 280px; }
.review-event-heading { min-width: 0; }
.review-event strong { display: block; overflow: hidden; text-overflow: ellipsis; }
.review-event small, .review-email { display: block; max-width: 280px; overflow: hidden; color: #94a2ad; font-size: 9px; font-weight: 400; text-overflow: ellipsis; }
.review-field-value { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mobile-review-status { display: none; }
.review-title-button { display: block; min-width: 0; max-width: 100%; padding: 0; background: transparent; text-align: left; color: inherit; }
.review-title-button:hover strong, .review-title-button:focus-visible strong { color: var(--cerulean); text-decoration: underline; }
.review-detail-list { display: grid; grid-template-columns: repeat(2, 1fr); margin: 0; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.review-detail-list div { min-width: 0; padding: 13px; border-bottom: 1px solid var(--line); }
.review-detail-list dt { color: #93a1aa; font-size: 9px; }
.review-detail-list dd { margin: 5px 0 0; color: #506675; font-size: 11px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-detail-footer { justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 9px; }
.review-detail-footer .table-actions { flex-wrap: wrap; }
.review-action { min-width: 58px; min-height: 32px; padding: 0 10px; border-radius: 6px; font-size: 10px; font-weight: 700; }
.review-action-confirm { color: #fff; background: var(--cerulean); }
.review-action-confirm:hover { background: #006fa6; }
.review-action-reject, .review-action-cancel { color: var(--red); background: var(--red-soft); }
.review-action-reject:hover, .review-action-cancel:hover { background: #fde4e2; }
.mobile-field-label { display: none; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding-top: 15px; color: #718493; font-size: 10px; }
.page-button { width: 38px; height: 36px; padding: 0; font-size: 15px; }
.school-list-full { max-height: 440px; overflow: auto; padding-right: 5px; }

.custom-select { position: relative; min-width: 0; }
.custom-select-trigger { width: 100%; height: 39px; padding: 0 11px 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #7f8e99; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; font-size: 12px; }
.custom-select-trigger-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-select-trigger.has-value { color: #506675; }
.custom-select.open .custom-select-trigger, .custom-select-trigger:focus-visible { outline: none; border-color: #93c4e6; box-shadow: 0 0 0 3px rgba(14,127,201,.1); }
.custom-select-chevron { color: #8fa0aa; font-size: 14px; transition: transform .18s ease; }
.custom-select.open .custom-select-chevron { transform: rotate(180deg); }
.custom-select-menu { position: absolute; z-index: 20; top: calc(100% + 5px); left: 0; right: 0; display: none; max-height: 230px; overflow-y: auto; padding: 5px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 14px 32px rgba(16,36,58,.16); }
.custom-select.open .custom-select-menu { display: grid; }
.custom-select-search { position: sticky; top: -5px; z-index: 1; display: block; margin: -5px -5px 4px; padding: 7px; background: #fff; }
.custom-select-search span { position: absolute; left: 18px; top: 17px; color: #94a4af; }
.custom-select-search input { width: 100%; height: 36px; padding: 0 10px 0 31px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); outline: none; font: inherit; font-size: 11px; }
.custom-select-search input:focus { border-color: #7fbfe4; box-shadow: 0 0 0 3px rgba(0,136,204,.12); }
.custom-select-options { display: grid; }
.custom-option { width: 100%; min-height: 36px; padding: 7px 9px; border-radius: 5px; background: transparent; color: #526979; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; font-size: 11px; }
.custom-option > span:first-child { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.custom-option-count { flex: 0 0 auto; min-width: 22px; padding: 2px 6px; border-radius: 999px; background: #eef3f4; color: #7c8d99; text-align: center; font-size: 9px; }
.custom-option:hover, .custom-option.selected { background: var(--accent-soft); color: var(--accent); }
.custom-option.selected .custom-option-count { background: #d9ecf9; color: var(--accent); }
.custom-select-empty { padding: 14px 8px; color: #94a2ad; text-align: center; font-size: 10px; }

.mine-grid { display: grid; gap: 13px; }.application-card { display: grid; grid-template-columns: 110px 1fr auto; gap: 15px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px; }.application-thumb { width: 110px; height: 75px; border-radius: 7px; overflow: hidden; background: #dae6f2; }.application-thumb img { width: 100%; height: 100%; object-fit: cover; }.application-info h3 { margin: 0 0 7px; color: var(--navy-950); font-size: 13px; }.application-info p { margin: 0; color: #5b6f7e; font-size: 10px; line-height: 1.7; }.application-side { text-align: right; }.application-side small { display: block; color: #627786; font-size: 10px; margin-top: 7px; }
.cancel-application { margin-top: 7px; }
.empty-state { padding: 52px 20px; text-align: center; color: #5b6f7e; background: #fff; border: 1px dashed #d5e0e4; border-radius: 10px; }.empty-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--cerulean-soft); color: var(--cerulean); margin: 0 auto 13px; font-size: 20px; }.empty-state h3 { color: var(--navy-950); font-size: 14px; margin-bottom: 7px; }.empty-state p { font-size: 11px; margin-bottom: 17px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 26, 40, .48); z-index: 10; display: grid; place-items: center; padding: 20px; animation: fade-in .18s ease; }.modal { overscroll-behavior: contain; width: min(720px, 100%); max-height: min(800px, calc(100vh - 40px)); overflow: auto; background: #fff; border-radius: 13px; box-shadow: 0 22px 80px rgba(4, 22, 38, .28); animation: rise-in .2s ease; }.modal.small { width: min(430px, 100%); }.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 23px 25px 17px; border-bottom: 1px solid var(--line); }.modal-header h2 { margin: 0 0 6px; color: var(--navy-950); font-size: 18px; }.modal-header p { margin: 0; color: #5b6f7e; font-size: 11px; }.modal-close { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 7px; background: #f2f5f6; color: #71818d; font-size: 18px; }.modal-body { padding: 22px 25px 25px; }.modal-event-hero { height: 190px; border-radius: 9px; overflow: hidden; background: #dbe7f3; margin: -4px 0 19px; }.modal-event-hero img { width: 100%; height: 100%; object-fit: cover; }.modal-event-meta { display: flex; flex-wrap: wrap; gap: 9px 17px; margin: 0 0 17px; }.modal-event-meta span { color: #53697a; font-size: 11px; }.modal-event-meta b { color: var(--cerulean); font-weight: 600; margin-right: 4px; }.modal-copy { color: #53697a; font-size: 12px; line-height: 1.85; margin-bottom: 19px; }.modal-callout { display: flex; gap: 10px; align-items: flex-start; color: #53697a; background: #f2f8fd; border: 1px solid #dcecf8; padding: 12px 13px; border-radius: 8px; font-size: 11px; line-height: 1.6; margin-bottom: 19px; }.modal-callout strong { display: block; color: var(--cerulean); font-size: 11px; }.modal-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 0 25px 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }.form-field { display: grid; min-width: 0; gap: 7px; }.form-field.full { grid-column: 1 / -1; }.form-field label { color: #536b7b; font-size: 11px; font-weight: 600; }.form-field label em { color: var(--red); font-style: normal; margin-left: 3px; }.form-field input, .form-field textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); padding: 10px 11px; outline: none; background: #fff; font-size: 12px; }.form-field textarea { min-height: 84px; resize: vertical; }.form-field input:focus, .form-field textarea:focus { border-color: #93c4e6; box-shadow: 0 0 0 3px rgba(14,127,201,.1); }.form-hint { color: #627786; font-size: 10px; margin-top: -2px; }
.modal-lock-note { display: grid; gap: 4px; margin-top: -9px; padding: 11px 13px; border-left: 3px solid var(--yellow); background: var(--yellow-soft); color: #82652f; font-size: 10px; }
.modal-lock-note strong { color: #684c19; font-size: 11px; }
.verification-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.verification-row .secondary-button { min-width: 112px; padding-inline: 11px; }
.phone-input { display: flex; align-items: center; gap: 10px; }
.phone-input > span { flex: none; color: #38576d; font-size: 14px; font-weight: 600; }
.phone-input input { min-width: 0; flex: 1; }
.captcha-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 10px; align-items: center; }
.captcha-row input { min-width: 0; }
.captcha-row img { width: 160px; height: 52px; border: 1px solid var(--line); border-radius: 7px; }
.captcha-caption { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.captcha-caption .text-button { flex: none; min-height: 36px; }
@media (max-width: 360px) {
  .captcha-row { grid-template-columns: minmax(0, 1fr) 132px; }
  .captcha-row img { width: 132px; height: auto; }
}
.auth-close { position: absolute; top: 17px; right: 17px; }
.auth-back { margin-top: 17px; }
.auth-migration { margin-top: 18px; display: grid; gap: 5px; }
.auth-migration > span { color: #627786; }
.forgot-password { justify-self: end; padding-block: 5px; }
.auth-modal { position: relative; padding: 29px 31px 31px; }.auth-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 23px; }.auth-brand .brand-mark { width: 32px; height: 32px; border-radius: 9px; font-size: 11px; }.auth-brand strong { color: var(--navy-950); font-size: 13px; }.auth-modal h2 { color: var(--navy-950); margin-bottom: 7px; font-size: 22px; }.auth-modal > p { color: #5b6f7e; font-size: 11px; line-height: 1.6; margin-bottom: 21px; }.auth-form { display: grid; gap: 14px; }.auth-form .primary-button { width: 100%; height: 42px; margin-top: 4px; }.auth-separator { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: #627786; font-size: 10px; }.auth-separator::before, .auth-separator::after { content: ""; flex: 1; border-top: 1px solid var(--line); }.auth-footnote { text-align: center; color: #627786; font-size: 10px; }.auth-footnote button { color: var(--accent); background: none; padding: 0; font-weight: 600; }
.notification-list { display: grid; gap: 1px; }
.notification-item { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: start; padding: 13px 0; border-bottom: 1px solid var(--line); }
.notification-item:last-child { border-bottom: 0; }
.notification-item strong { color: var(--navy-950); font-size: 12px; }
.notification-item p { margin: 5px 0 4px; color: #53697a; font-size: 11px; line-height: 1.55; }
.notification-item small, .notification-read-label { color: #627786; font-size: 9px; }
.notification-item.read { opacity: .68; }
.toast { position: fixed; bottom: 27px; left: 50%; transform: translate(-50%, 20px); background: var(--navy-950); color: #fff; padding: 11px 16px; border-radius: 8px; font-size: 11px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; z-index: 20; transition: .25s ease; }.toast.show { opacity: 1; transform: translate(-50%, 0); }
.page-back { margin-bottom: 14px; }
.event-detail-page { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.event-detail-hero { position: relative; height: 310px; overflow: hidden; isolation: isolate; background: #e8edf0; }
.event-detail-hero .event-image-backdrop { position: absolute; }
.event-detail-hero .event-image-main { position: relative; width: 100%; height: 100%; object-fit: contain; }
.event-detail-content { padding: 28px; }
.event-detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.event-detail-heading h1 { margin: 9px 0; color: var(--navy-950); font-size: 25px; }
.event-detail-heading p { max-width: 700px; color: #53697a; font-size: 12px; line-height: 1.8; }
.event-category-inline { color: var(--accent); font-size: 11px; font-weight: 700; margin-right: 8px; }
.event-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 24px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--line); }
.event-detail-grid div { display: grid; gap: 5px; padding: 14px; background: #fff; }
.event-detail-grid strong { color: var(--accent); font-size: 11px; }
.event-detail-grid span { color: #586f7d; font-size: 11px; }
.event-detail-grid a { color: var(--cerulean); }
.event-detail-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.event-related-section { margin-top: 30px; padding-top: 27px; border-top: 1px solid var(--line); }
.related-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.related-heading .eyebrow { margin-bottom: 4px; }
.related-heading h2 { margin: 0; color: var(--navy-950); font-size: 18px; }
.related-heading > span { color: #627786; font-size: 10px; }
.event-gallery { display: grid; grid-template-columns: 1.45fr 1fr 1fr; grid-auto-rows: 145px; gap: 8px; }
.event-gallery.single { grid-template-columns: 1fr; grid-auto-rows: 330px; }
.gallery-photo { position: relative; min-width: 0; margin: 0; overflow: hidden; border-radius: 9px; background: #e8edf5; cursor: zoom-in; }
.gallery-photo:focus-visible { outline: 3px solid var(--cerulean); outline-offset: 2px; }
.gallery-photo.featured:not(:only-child) { grid-row: span 2; }
.gallery-photo img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .25s ease; }
.gallery-photo:hover img { transform: scale(1.025); }
.gallery-photo figcaption { position: absolute; inset: auto 0 0; padding: 28px 12px 10px; color: #fff; background: linear-gradient(transparent, rgba(10,27,42,.78)); font-size: 10px; line-height: 1.45; }
body.lightbox-open { overflow: hidden; }
.photo-lightbox { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 26px min(8vw, 96px); background: rgba(5, 17, 28, .93); backdrop-filter: blur(7px); animation: fade-in .18s ease; }
.lightbox-stage { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; margin: 0; max-width: 100%; max-height: 100%; }
.lightbox-stage img { max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; border-radius: 10px; box-shadow: 0 30px 90px rgba(0, 0, 0, .48); background: rgba(255,255,255,.04); animation: rise-in .2s ease; transition: opacity .16s ease; }
.lightbox-stage.is-loading img { opacity: 0; }
.lightbox-stage.is-loading::before { content: ""; position: absolute; top: calc(50% - 32px); width: 36px; height: 36px; border-radius: 50%; border: 3px solid rgba(255,255,255,.22); border-top-color: #fff; animation: loading-spin .8s linear infinite; }
.lightbox-stage.load-failed img { display: none; }
.lightbox-stage.load-failed::before { content: "▧ 相片無法載入"; color: #a9bfd2; font-size: 13px; padding: 40px 20px; }
.lightbox-stage figcaption { display: flex; align-items: center; justify-content: center; gap: 10px; max-width: min(760px, 100%); color: #dce8f3; font-size: 12px; line-height: 1.6; text-align: center; }
.lightbox-counter { flex: 0 0 auto; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.15); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .4px; }
.lightbox-caption[hidden] { display: none; }
.lightbox-close { position: absolute; z-index: 1; top: max(16px, env(safe-area-inset-top)); right: 18px; width: 42px; height: 42px; border-radius: 10px; border: 1px solid rgba(255,255,255,.3); background: rgba(8, 22, 36, .58); color: #fff; font-size: 20px; transition: background .16s ease; }
.lightbox-close:hover { background: rgba(8, 22, 36, .82); }
.lightbox-nav { position: absolute; z-index: 1; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.3); background: rgba(8, 22, 36, .58); color: #fff; font-size: 26px; line-height: 1; padding-bottom: 3px; transition: background .16s ease; }
.lightbox-nav:hover { background: rgba(8, 22, 36, .82); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-close:focus-visible, .lightbox-nav:focus-visible { outline: 3px solid #8ec8f8; outline-offset: 2px; }
.media-report-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.media-report-card { display: grid; min-height: 126px; padding: 15px; border: 1px solid var(--line); border-radius: 9px; color: inherit; background: #fff; text-decoration: none; transition: .18s ease; }
.media-report-card:hover { border-color: #a9cfec; box-shadow: 0 9px 24px rgba(22,44,67,.07); transform: translateY(-1px); }
.report-publisher { color: var(--cerulean); font-size: 9px; font-weight: 700; letter-spacing: .03em; }
.media-report-card strong { align-self: center; color: var(--navy-950); font-size: 12px; line-height: 1.55; }
.media-report-card > div:last-child { display: flex; justify-content: space-between; gap: 12px; color: #91a0aa; font-size: 9px; }
.media-report-card > div:last-child span { color: var(--cerulean); font-weight: 600; }
.related-empty { display: grid; place-items: center; min-height: 116px; margin-top: 18px; padding: 18px; border: 1px dashed #cfdbdf; border-radius: 9px; color: #8b9ba5; text-align: center; background: #fafcfc; }
.related-empty > span { color: var(--cerulean); font-size: 20px; }
.related-empty strong { margin-top: 5px; color: #607785; font-size: 11px; }
.related-empty p { margin: 3px 0 0; font-size: 9px; }

.event-editor-modal { width: min(1280px, calc(100vw - 40px)); height: min(880px, calc(100vh - 40px)); max-height: none; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
.editor-workspace { display: grid; grid-template-columns: minmax(480px, .92fr) minmax(430px, 1.08fr); min-height: 0; }
.editor-form-pane { min-width: 0; padding: 22px 25px 30px; overflow-y: auto; }
.editor-preview-pane { min-width: 0; overflow-y: auto; border-left: 1px solid var(--line); background: #eef3f4; }
.preview-toolbar { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; height: 47px; padding: 0 18px; border-bottom: 1px solid #dce5e7; background: rgba(247,250,250,.95); backdrop-filter: blur(8px); }
.preview-toolbar strong { color: var(--navy-950); font-size: 11px; }
.preview-toolbar small { color: #91a0aa; font-size: 9px; }
.live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--cerulean); box-shadow: 0 0 0 3px rgba(0,136,204,.14); }
#event-live-preview { padding: 20px; }
.preview-event-page { overflow: hidden; border: 1px solid #dbe4e6; border-radius: 11px; background: #fff; box-shadow: 0 14px 35px rgba(22,44,67,.07); }
.preview-cover { height: 220px; display: grid; place-items: center; color: #8da0aa; background: #dce8f3; font-size: 11px; }
.preview-cover img { width: 100%; height: 100%; object-fit: cover; }
.preview-event-content { padding: 20px; }
.preview-event-content h1 { margin: 7px 0 9px; font-size: 20px; }
.preview-event-content > p { color: #70818d; font-size: 10px; line-height: 1.7; }
.preview-facts { display: grid; gap: 7px; margin: 16px 0; padding: 13px; border-radius: 8px; color: #687d89; background: #f5f8f8; font-size: 9px; }
.preview-event-content .event-gallery { grid-auto-rows: 92px; }
.preview-event-content .event-gallery.single { grid-auto-rows: 190px; }
.preview-event-content .media-report-list { grid-template-columns: 1fr; }
.content-editor-section { margin-top: 4px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfc; }
.content-editor-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 13px; }
.content-editor-heading strong, .content-editor-heading span { display: block; }
.content-editor-heading strong { color: var(--navy-950); font-size: 12px; }
.content-editor-heading span { margin-top: 3px; color: #94a2ab; font-size: 9px; line-height: 1.5; }
.content-editor-heading .secondary-button { flex: 0 0 auto; }
.upload-button { cursor: pointer; }
.asset-list, .report-editor-list { display: grid; gap: 8px; }
.asset-list + .asset-list { margin-top: 8px; }
.asset-row { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) 28px; gap: 9px; align-items: center; padding: 7px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.asset-row img { width: 64px; height: 50px; object-fit: cover; border-radius: 6px; background: #e7eeee; }
.asset-row input, .report-editor-row input { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); font-size: 11px; outline: none; }
.asset-row input:focus, .report-editor-row input:focus { border-color: #7fbfe4; box-shadow: 0 0 0 3px rgba(0,136,204,.1); }
.asset-remove { width: 28px; height: 28px; border-radius: 7px; color: #9b6464; background: var(--red-soft); font-size: 17px; }
.report-editor-row { position: relative; display: grid; gap: 7px; padding: 11px 45px 11px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.report-editor-row > div { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.report-editor-row > .asset-remove { position: absolute; top: 11px; right: 9px; }
.editor-empty { padding: 19px; border: 1px dashed #d4dfe2; border-radius: 8px; color: #98a5ae; text-align: center; font-size: 10px; background: #fff; }
.participant-form { margin: 20px 0; padding: 17px; border: 1px solid var(--line); border-radius: 9px; }
.participant-form legend { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 0 5px; color: var(--navy-950); font-size: 12px; font-weight: 700; }
.contact-form { padding-bottom: 3px; }
.contact-form h3 { margin-bottom: 14px; color: var(--navy-950); font-size: 13px; }
.add-participant { width: 100%; }
.submission-rule { display: block; margin-top: 14px; line-height: 1.6; }
.checkbox-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.checkbox-options label { display: flex; align-items: center; gap: 9px; min-height: 43px; padding: 9px 11px; border: 1px solid #e3eaed; border-radius: 7px; background: #fff; color: #536b7b; cursor: pointer; }
.checkbox-options label:has(input:checked) { border-color: #7fbfe4; background: var(--cerulean-soft); color: #0b6ba3; }
.checkbox-options input { min-width: 18px; width: 18px; height: 18px; padding: 0; flex: 0 0 auto; accent-color: var(--cerulean); }
.checkbox-options.invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(227,24,55,.08); }

/* User account, family registration, and resilient network states */
.sidebar-help { color: inherit; text-decoration: none; transition: background .18s ease, border-color .18s ease; }
.sidebar-help:hover { border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.065); }
.sidebar-user.account-trigger { width: 100%; color: inherit; background: transparent; text-align: left; }
.sidebar-user.account-trigger:hover .user-copy strong { color: #fff; }
.event-card:focus-visible { outline: 3px solid rgba(10,101,159,.3); outline-offset: 3px; border-color: var(--accent); }
.network-banner { position: sticky; z-index: 7; top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 12px 42px 0; padding: 11px 14px; border: 1px solid #f0c6cc; border-radius: 9px; color: #8e2f3f; background: #fff4f5; box-shadow: 0 8px 22px rgba(77,30,38,.08); font-size: 12px; }
.network-banner .text-button { flex: 0 0 auto; color: #8e2f3f; text-decoration: underline; }
.loading-state { min-height: 320px; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--muted); text-align: center; }
.loading-state h2 { margin: 0; color: var(--navy-950); font-size: 18px; }
.loading-state p { margin: 0; font-size: 12px; }
.loading-spinner { width: 34px; height: 34px; border: 3px solid #dceaf3; border-top-color: var(--accent); border-radius: 50%; animation: loading-spin .8s linear infinite; }
.connection-empty { max-width: 620px; margin: 36px auto; }

.validation-summary { display: flex; gap: 12px; margin-bottom: 20px; padding: 14px 15px; border: 1px solid #efb9c1; border-radius: 10px; color: #7f3040; background: #fff3f5; }
.validation-summary[hidden] { display: none; }
.summary-icon, .confirm-icon { width: 25px; height: 25px; flex: 0 0 25px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--red); font-size: 13px; font-weight: 800; }
.validation-summary h3 { margin: 0 0 3px; color: #7f3040; font-size: 13px; }
.validation-summary p { margin: 0 0 7px; font-size: 11px; }
.validation-summary ul { display: grid; gap: 3px; margin: 0; padding-left: 17px; }
.validation-summary li::marker { color: var(--red); }
.validation-summary button { padding: 0; color: #8f3142; background: transparent; text-align: left; font-size: 11px; text-decoration: underline; }
.field-error { margin: 3px 0 0; color: #b01832; font-size: 10px; line-height: 1.45; }
.field-error:empty { display: none; }
.account-feedback { font-size: 13px; line-height: 1.6; }
.application-field.invalid input:not([type="checkbox"]),
.application-field.invalid textarea,
.application-field.invalid .custom-select-trigger,
.application-field.invalid .checkbox-options { border-color: var(--red); box-shadow: 0 0 0 3px rgba(227,24,55,.08); }
.application-field.invalid > label { color: #a3152e; }

.form-section { padding: 18px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.form-section + .form-section { margin-top: 16px; }
.section-heading { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 17px; }
.section-heading h3 { margin: 0 0 3px; color: var(--navy-950); font-size: 14px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.section-number { width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: var(--navy-900); font-size: 11px; font-weight: 800; }
.contact-form { padding-bottom: 18px; }
.participants-section { margin-top: 16px; }
.participant-form { margin: 0 0 13px; background: #fbfcfd; }
.participant-form:last-child { margin-bottom: 0; }
.participant-form legend { margin-bottom: 4px; }
.add-participant { width: 100%; margin-top: 12px; border-style: dashed; }
.registration-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; padding: 12px 14px; border-radius: 9px; color: #536b7b; background: var(--accent-soft); font-size: 11px; line-height: 1.65; }
.registration-note > span { width: 20px; height: 20px; flex: 0 0 20px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--accent); font-size: 11px; font-weight: 700; }
.registration-note p { margin: 0; }
.registration-note strong { color: var(--navy-900); }
.application-modal { width: min(820px, 100%); }
.application-modal .modal-body { background: #f7f9fb; }
input[readonly] { color: #667985; background: #f2f5f7; cursor: not-allowed; }

.application-group-card { align-items: stretch; padding: 14px; }
.application-group-card .application-thumb { align-self: start; }
.group-participants { display: grid; gap: 6px; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid #edf1f3; list-style: none; }
.group-participants li { display: grid; grid-template-columns: minmax(100px, 1fr) auto auto; align-items: center; gap: 8px; min-width: 0; }
.group-participants .text-button { min-width: 0; overflow: hidden; justify-content: flex-start; text-overflow: ellipsis; white-space: nowrap; }
.group-participants small { color: #70828f; font-size: 9px; white-space: nowrap; }
.application-side { min-width: 170px; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 7px; }
.application-side strong { color: var(--navy-950); font-size: 12px; }
.application-side small { margin: 0; }
.application-side .primary-button { margin-top: 4px; }
.group-readonly-list { display: grid; gap: 9px; }
.group-readonly-list article { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.group-readonly-list article > div { min-width: 0; }
.group-readonly-list strong, .group-readonly-list span { display: block; }
.group-readonly-list strong { margin-bottom: 3px; color: var(--navy-950); font-size: 12px; }
.group-readonly-list div span { color: var(--muted); font-size: 9px; }

.account-modal { width: min(760px, 100%); }
.account-settings { display: grid; gap: 16px; background: #f7f9fb; }
.account-section { padding: 18px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.account-section > .primary-button, .account-section > .secondary-button { margin-top: 15px; }
.account-actions { align-items: center; padding-top: 16px; border-top: 1px solid var(--line); }
.account-actions #logout-account { margin-right: auto; }
.demo-login-hint { margin: 12px 0 0 !important; color: #788b98 !important; text-align: center; font-size: 10px !important; }

.confirm-backdrop { position: fixed; z-index: 40; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(5,19,31,.66); animation: fade-in .16s ease; }
.confirm-dialog { width: min(390px, 100%); padding: 25px; border-radius: 14px; background: #fff; box-shadow: 0 24px 80px rgba(4,22,38,.34); text-align: center; animation: rise-in .18s ease; }
.confirm-dialog .confirm-icon { margin: 0 auto 13px; }
.confirm-dialog h2 { margin: 0 0 7px; color: var(--navy-950); font-size: 18px; }
.confirm-dialog p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 20px; }
.confirm-actions button { min-height: 42px; }

@keyframes loading-spin { to { transform: rotate(360deg); } }
.submission-success, .application-detail-page { max-width: 820px; margin: 24px auto; padding: 32px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.submission-success { text-align: center; }
.success-mark { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 15px; border-radius: 50%; background: var(--cerulean-soft); color: var(--cerulean); font-size: 28px; }
.submission-success h1 { margin: 6px 0 8px; color: var(--navy-950); }
.submission-success > p { max-width: 600px; margin: 0 auto 22px; color: #53697a; font-size: 12px; line-height: 1.7; }
.success-list { display: grid; gap: 8px; text-align: left; }
.success-list article { display: grid; grid-template-columns: 1fr auto; gap: 5px 16px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.success-list strong { color: var(--navy-950); font-size: 12px; }
.success-list span, .success-list time, .success-list code { color: #5b6f7e; font-size: 10px; }
.success-list .mini-status { grid-row: 1 / 3; grid-column: 2; align-self: center; }
.success-actions { display: flex; justify-content: center; gap: 9px; margin-top: 22px; }
.application-detail-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.application-detail-heading h1 { margin-top: 7px; color: var(--navy-950); font-size: 21px; }
.application-detail-page dl { display: grid; grid-template-columns: repeat(2, 1fr); margin: 0; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.application-detail-page dl div { padding: 13px; border-bottom: 1px solid var(--line); }
.application-detail-page dt { color: #93a1aa; font-size: 9px; }
.application-detail-page dd { margin: 5px 0 0; color: #506675; font-size: 11px; overflow-wrap: anywhere; }
.revision-list { display: grid; gap: 8px; }
.revision-list article { display: flex; justify-content: space-between; gap: 16px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; }
.revision-list strong, .revision-list span { display: block; }
.revision-list strong { color: var(--navy-950); font-size: 11px; }
.revision-list span, .revision-list time { color: #8b9aa4; font-size: 9px; }
.participation-summary > strong { display: block; margin-top: 20px; color: var(--navy-950); font-size: 38px; }
.participation-summary > p { color: #7b8c97; font-size: 11px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } } @keyframes rise-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }

.modal-header > div, .event-detail-heading > div, .notification-item > div { min-width: 0; }
.event-body h3, .event-detail-heading h1, .event-detail-grid span, .modal-header h2, .application-info { overflow-wrap: anywhere; }
.event-card-link { flex: 0 0 auto; color: var(--accent); font-size: 13px; font-weight: 600; }
.modal.event-editor-modal::before { display: none; }
.event-editor-modal > .modal-header, .event-editor-modal > .modal-footer { position: static; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.help-content { display: grid; gap: 24px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.help-content h3 { margin-bottom: 10px; color: var(--navy-950); font-size: 17px; }
.help-content p { margin-bottom: 14px; }
.help-start ol { margin: 0 0 18px; padding-left: 22px; }
.help-start li + li { margin-top: 8px; }
.help-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.help-faq { border-block: 1px solid var(--line); }
.help-faq details + details { border-top: 1px solid var(--line); }
.help-faq summary { padding: 14px 4px; color: var(--navy-900); font-weight: 600; cursor: pointer; }
.help-faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.help-faq p { padding: 0 4px; }
.help-contact { padding: 18px; border: 1px solid #cfe4f4; border-radius: 12px; background: var(--accent-soft); }
.help-contact a { color: var(--navy-900); }
.help-contact .secondary-button { min-height: 44px; text-decoration: none; }
.help-contact label { display: block; margin-bottom: 6px; }
.help-email { display: flex; flex-wrap: wrap; gap: 8px; }
.help-email input { flex: 1 1 220px; min-width: 0; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; font-size: 16px; cursor: text; }
#help-copy-status { margin-block: 8px 14px; }

@media (min-width: 721px) {
  .main-content {
    background:
      radial-gradient(circle at 8% 0%, rgba(93,173,236,.34) 0, rgba(93,173,236,.14) 15%, transparent 34%),
      radial-gradient(circle at 58% -8%, rgba(0,136,204,.26) 0, rgba(93,173,236,.12) 18%, transparent 40%),
      radial-gradient(circle at 102% 18%, rgba(93,173,236,.28) 0, rgba(93,173,236,.11) 18%, transparent 36%),
      radial-gradient(circle at 0% 34%, rgba(14,127,201,.15) 0, rgba(14,127,201,.07) 17%, transparent 34%),
      linear-gradient(180deg, #f4f9fe 0, var(--canvas) 580px);
    background-repeat: no-repeat;
    background-size: 100% 580px;
  }
  .topbar { border-bottom-color: rgba(255,255,255,.68); background: rgba(255,255,255,.58); box-shadow: 0 1px 0 rgba(16,36,58,.035); backdrop-filter: blur(18px) saturate(1.15); }
  .page-root { position: relative; }
  .school-identity { padding: 14px 20px; border: 1px solid rgba(255,255,255,.75); border-radius: 20px; background: rgba(255,255,255,.7); box-shadow: 0 12px 38px rgba(16,42,67,.07); backdrop-filter: blur(16px) saturate(1.12); }
  .identity-stats { border-left-color: rgba(14,127,201,.14); }
  .identity-stats strong { color: var(--accent); }
  .search-box input, .custom-select-trigger, .toolbar .secondary-button { border-color: rgba(255,255,255,.88); background: rgba(255,255,255,.88); box-shadow: 0 7px 22px rgba(16,42,67,.06); backdrop-filter: blur(10px); }
  .category-tab { border-color: rgba(111,128,141,.13); background: rgba(255,255,255,.78); box-shadow: 0 4px 14px rgba(16,42,67,.04); backdrop-filter: blur(9px); }
  .category-tab.active { background: rgba(255,255,255,.94); }

  /* Desktop readability pass: keep the existing layout while making user-facing copy easier to scan. */
  .brand-subtitle { color: #93a8bb; font-size: 12px; }
  .nav-section-label { color: #8fa5b8; font-size: 12px; }
  .sidebar-help strong { font-size: 13px; }
  .sidebar-help p { color: #9cb0c1; font-size: 12px; line-height: 1.5; }
  .user-copy strong { font-size: 13px; }
  .user-copy span { color: #91a8ba; font-size: 12px; }

  .breadcrumbs { color: #637787; font-size: 13px; }
  .topbar-user-name { font-size: 13px; }
  .eyebrow { font-size: 12px; }
  .page-heading p { font-size: 14px; line-height: 1.55; }
  .primary-button, .secondary-button, .text-button, .danger-button { font-size: 14px; line-height: 1.4; }

  .welcome-band p { color: #c5dbed; font-size: 14px; line-height: 1.55; }
  .welcome-meta span { color: #a7c4dd; font-size: 12px; }
  .banner-fallback span { color: #5b6f7e; font-size: 13px; }
  .identity-stats span { color: #5b6f7e; font-size: 13px; line-height: 1.45; }

  .search-box input { font-size: 14px; }
  .category-tab { color: #5b6f7e; font-size: 13px; }
  .section-header h2 { font-size: 18px; }
  .section-header span { color: #627786; font-size: 13px; }
  .event-category, .event-status { font-size: 12px; }
  .event-description { color: #586b7c; font-size: 14px; line-height: 1.6; }
  .detail-line { color: #586f7d; font-size: 13px; line-height: 1.5; }
  .detail-line strong { color: #435d6e; }
  .capacity-bar { color: #607482; font-size: 12px; }

  .stat-label { color: #586b7c; font-size: 13px; }
  .stat-value span { font-size: 12px; }
  .stat-note { color: #627786; font-size: 12px; line-height: 1.5; }
  .panel-heading span { color: #627786; font-size: 12px; }

  .custom-select-trigger { color: #607482; font-size: 14px; }
  .custom-select-search input { font-size: 13px; }
  .custom-option { font-size: 13px; }
  .custom-option-count { color: #627786; font-size: 11px; }
  .custom-select-empty { color: #627786; font-size: 13px; }

  .application-info h3 { font-size: 16px; }
  .application-info p { color: #5b6f7e; font-size: 13px; line-height: 1.6; }
  .application-side small { color: #627786; font-size: 12px; }
  .empty-state { color: #5b6f7e; }
  .empty-state h3 { font-size: 17px; }
  .empty-state p { font-size: 14px; line-height: 1.55; }

  .modal-header p { color: #5b6f7e; font-size: 14px; line-height: 1.5; }
  .modal-event-meta span { color: #53697a; font-size: 13px; }
  .modal-copy { color: #53697a; font-size: 14px; line-height: 1.75; }
  .modal-callout { color: #53697a; font-size: 13px; line-height: 1.65; }
  .modal-callout strong { font-size: 13px; }
  .form-field label { font-size: 14px; }
  .form-field input, .form-field textarea { font-size: 15px; }
  .form-hint { color: #627786; font-size: 13px; line-height: 1.5; }
  .modal-lock-note { font-size: 13px; line-height: 1.5; }
  .modal-lock-note strong { font-size: 13px; }

  .auth-brand strong { font-size: 15px; }
  .auth-modal > p { color: #5b6f7e; font-size: 14px; }
  .auth-separator, .auth-footnote { color: #627786; font-size: 13px; }
  .notification-item strong { font-size: 14px; }
  .notification-item p { color: #53697a; font-size: 13px; }
  .notification-item small, .notification-read-label { color: #627786; font-size: 12px; }
  .toast { font-size: 13px; }

  .event-detail-heading p { color: #53697a; font-size: 15px; line-height: 1.7; }
  .event-category-inline { font-size: 13px; }
  .event-detail-grid strong { font-size: 13px; }
  .event-detail-grid span { font-size: 14px; line-height: 1.5; }
  .related-heading > span { color: #627786; font-size: 12px; }
  .gallery-photo figcaption { font-size: 12px; }
  .report-publisher { font-size: 11px; }
  .media-report-card strong { font-size: 14px; }
  .media-report-card > div:last-child { color: #627786; font-size: 12px; }
  .related-empty strong { font-size: 14px; }
  .related-empty p { font-size: 12px; }

  .participant-form legend { font-size: 14px; }
  .contact-form h3 { font-size: 15px; }
  .submission-success > p { color: #53697a; font-size: 14px; }
  .success-list strong { font-size: 14px; }
  .success-list span, .success-list time, .success-list code { color: #5b6f7e; font-size: 12px; }
  .application-detail-page dt { color: #627786; font-size: 12px; }
  .application-detail-page dd { font-size: 14px; }
  .review-detail-list { grid-template-columns: 1fr; }
  .review-detail-list dt { color: #627786; font-size: 12px; }
  .review-detail-list dd { font-size: 14px; }
  .review-detail-footer .table-actions { width: 100%; }
  .revision-list strong { font-size: 13px; }
  .revision-list span, .revision-list time { color: #627786; font-size: 12px; }
  .participation-summary > p { color: #5b6f7e; font-size: 13px; }
}

@media (max-width: 1100px) { .sidebar { width: 220px; flex-basis: 220px; }.topbar { padding: 0 28px; }.page-root { padding: 30px 28px 45px; }.site-credit { padding-inline: 28px; }.event-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.dashboard-grid { grid-template-columns: 1fr; }.editor-workspace { grid-template-columns: minmax(420px, 1fr) minmax(360px, .85fr); } }
@media (max-width: 900px), (max-height: 500px) and (max-width: 900px) {
  body { background: #f0f2f5; font-size: 16px; }
  .sidebar { display: none; }
  .app-shell { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .main-content {
    width: 100%;
    background:
      radial-gradient(circle at 8% 2%, rgba(93,173,236,.52) 0, rgba(93,173,236,.26) 13%, transparent 33%),
      radial-gradient(circle at 62% -5%, rgba(0,136,204,.44) 0, rgba(93,173,236,.22) 17%, transparent 38%),
      radial-gradient(circle at 103% 20%, rgba(93,173,236,.48) 0, rgba(93,173,236,.22) 17%, transparent 35%),
      radial-gradient(circle at -3% 30%, rgba(14,127,201,.26) 0, rgba(14,127,201,.12) 15%, transparent 32%),
      linear-gradient(180deg, #f2f8fe 0, #f0f2f5 470px);
    background-repeat: no-repeat;
    background-size: 100% 470px;
  }
  .topbar { position: sticky; top: 0; z-index: 6; height: 58px; display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 0 16px; border-bottom: 0; background: rgba(255,255,255,.56); box-shadow: none; backdrop-filter: blur(18px) saturate(1.2); }
  .breadcrumbs { grid-column: 1; min-width: 0; justify-self: start; }
  .breadcrumbs span, .topbar-user .chevron { display: none; }
  .topbar-user-name { display: block; max-width: 5em; font-size: 14px; }
  .breadcrumbs strong { font-size: 16px; color: var(--navy-950); }
  .topbar-actions { grid-column: 2; justify-self: end; gap: 3px; }
  .notification-button { width: 44px; height: 44px; background: rgba(255,255,255,.52); }
  .topbar-user { min-width: 44px; min-height: 44px; justify-content: center; }
  .topbar-user .avatar { flex-basis: 32px; width: 32px; height: 32px; box-shadow: 0 5px 16px rgba(16,42,67,.12); }
  .page-root { display: flex; flex-direction: column; padding: 6px 16px 34px; }
  .site-credit { padding: 0 16px 24px; }
  .site-credit-legal > span:first-child { max-width: 310px; }
  .network-banner { top: 62px; margin: 8px 12px 4px; padding: 10px 12px; border-radius: 12px; font-size: 13px; }
  .page-heading { display: block; margin-bottom: 14px; }
  .page-heading h1 { font-size: 30px; line-height: 1.18; margin-bottom: 7px; letter-spacing: -.02em; }
  .page-heading p { max-width: 355px; font-size: 14px; line-height: 1.55; }
  .page-heading > .secondary-button, .desktop-admin-action, .eyebrow, .desktop-copy { display: none; }
  .mobile-copy { display: inline; }
  .welcome-band { min-height: 102px; padding: 18px; margin-bottom: 17px; border-radius: 10px; }
  .welcome-band::after { width: 180px; height: 180px; top: -120px; right: -30px; }
  .welcome-band h2 { font-size: 18px; margin-bottom: 6px; }
  .welcome-band p { max-width: 280px; font-size: 11px; line-height: 1.6; }
  .welcome-meta { display: none; }
  .school-identity { display: block; margin: 8px 0 18px; padding: 8px 12px 0; border: 1px solid rgba(255,255,255,.72); border-radius: 20px; background: rgba(255,255,255,.7); box-shadow: 0 10px 34px rgba(16,42,67,.07); backdrop-filter: blur(16px) saturate(1.15); }
  .school-banner { width: 100%; max-width: 470px; min-height: 42px; }
  .school-banner img { height: 42px; }
  .banner-fallback { padding: 0; }
  .banner-fallback strong { font-size: 17px; }
  .identity-stats { margin-top: 5px; border-top: 1px solid rgba(14,127,201,.14); border-left: 0; }
  .identity-stats div { padding: 7px 5px 8px; text-align: center; }
  .identity-stats div + div { border-left: 1px solid var(--line); }
  .identity-stats strong { color: var(--accent); font-size: 18px; margin-bottom: 3px; }
  .identity-stats span { font-size: 11px; }
  .toolbar { display: block; margin-bottom: 12px; }
  .search-row { display: flex; gap: 8px; }
  .search-box { display: block; min-width: 0; max-width: none; flex: 1 1 auto; }
  .search-box input { height: 48px; padding-left: 40px; border-color: rgba(255,255,255,.88); border-radius: 16px; background: rgba(255,255,255,.92); font-size: 16px; box-shadow: 0 8px 24px rgba(16,42,67,.08); backdrop-filter: blur(10px); }
  .search-box span { top: 13px; left: 15px; font-size: 18px; }
  .mobile-filter-button { position: relative; display: inline-flex; flex: 0 0 86px; min-height: 48px; align-items: center; justify-content: center; gap: 5px; border: 1px solid rgba(255,255,255,.88); border-radius: 16px; color: var(--navy-900); background: rgba(255,255,255,.88); font-size: 14px; font-weight: 700; box-shadow: 0 8px 24px rgba(16,42,67,.08); backdrop-filter: blur(10px); }
  .mobile-filter-button.active { color: var(--accent); border-color: #bcdcf2; background: var(--accent-soft); }
  .mobile-filter-button b { min-width: 19px; height: 19px; display: grid; place-items: center; border-radius: 99px; color: #fff; background: var(--accent); font-size: 11px; }
  .filter-controls { display: none; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; padding: 12px; border: 1px solid #e3daf0; border-radius: 14px; background: #fff; box-shadow: 0 12px 30px rgba(16,36,58,.07); }
  .filter-controls.open { display: grid; }
  .filter-spacer { display: none; }
  .toolbar > .custom-select, .filter-controls > .custom-select { width: auto; min-width: 0; }
  .toolbar .custom-select-trigger { height: 42px; border-radius: 9px; }
  #sort-events { grid-column: 1 / -1; height: 44px; padding-inline: 14px; font-size: 14px; }
  .category-tabs { gap: 8px; margin-inline: -16px; margin-bottom: 10px; padding: 2px 16px 6px; scrollbar-width: none; }
  .category-tabs::-webkit-scrollbar { display: none; }
  .category-tab { min-height: 44px; padding: 9px 15px; border-color: rgba(111,128,141,.13); color: #687986; background: rgba(255,255,255,.78); font-size: 14px; box-shadow: 0 4px 14px rgba(16,42,67,.04); backdrop-filter: blur(9px); }
  .category-tab.active { color: var(--accent); background: rgba(255,255,255,.94); border-color: rgba(14,127,201,.28); box-shadow: inset 0 -2px var(--accent), 0 4px 14px rgba(16,42,67,.045); }
  .section-header { margin: 10px -16px 0; padding: 20px 16px 12px; border-radius: 26px 26px 0 0; background: #fff; }
  .section-header h2 { font-size: 22px; }
  .section-header span { font-size: 14px; }
  .event-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0 -16px; padding: 0 16px 22px; background: #fff; }
  .event-grid .event-card { display: flex; width: 100%; min-width: 0; margin: 0; border-radius: 15px; box-shadow: 0 7px 22px rgba(16,36,58,.07); }
  .event-grid .event-image { flex: 0 0 auto; aspect-ratio: 16 / 9; height: auto; min-height: 0; }
  .event-grid .event-image-backdrop { display: none; }
  .event-grid .event-image-main { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
  .event-grid .event-category { left: 8px; top: 8px; max-width: calc(100% - 16px); overflow: hidden; padding: 5px 8px; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .event-grid .event-status { top: auto; right: 8px; bottom: 8px; max-width: calc(100% - 16px); padding: 5px 8px; font-size: 10px; }
  .event-grid .event-body { padding: 15px; }
  .event-grid .event-body h3 { margin-bottom: 12px; font-size: 18px; line-height: 1.45; }
  .event-grid .event-description { display: none; }
  .event-grid .event-details { gap: 8px; margin-top: auto; padding: 0; border: 0; }
  .event-grid .detail-line { font-size: 14px; line-height: 1.5; }

  .event-grid .card-footer { justify-content: flex-end; margin-top: 14px; padding-top: 12px; }
  .event-grid .capacity-bar { display: none; }
  .stats-row { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
  .stat-card { min-height: 124px; padding: 15px; border-radius: 14px; box-shadow: 0 6px 20px rgba(16,36,58,.05); }
  .stat-top { margin-bottom: 12px; }
  .stat-label { font-size: 14px; }
  .stat-icon { width: 34px; height: 34px; font-size: 16px; }
  .stat-value strong { color: var(--accent); font-size: 28px; }
  .stat-note { font-size: 12px; line-height: 1.45; }
  .admin-quick-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 2px 0 17px; }
  .admin-quick-actions button { min-width: 0; padding: 11px 4px 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--navy-900); }
  .admin-quick-actions span { width: 30px; height: 30px; display: grid; place-items: center; margin: 0 auto 7px; border-radius: 8px; background: var(--cerulean-soft); color: var(--cerulean); font-size: 15px; }
  .admin-quick-actions strong { display: block; overflow-wrap: anywhere; font-size: 9px; font-weight: 600; }
  .admin-heading { margin-bottom: 15px; }
  .admin-heading > .primary-button, .admin-heading > .secondary-button { width: 100%; min-height: 44px; margin-top: 13px; }
  .admin-tabs { order: -1; width: calc(100% + 32px); max-width: none; margin: 0 -16px 17px; padding: 6px 16px; border-width: 0 0 1px; border-radius: 0; background: #fff; scrollbar-width: none; }
  .admin-tabs::-webkit-scrollbar { display: none; }
  .admin-tab { min-height: 38px; padding-inline: 14px; }
  .admin-quick-actions-visible { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
  .admin-quick-actions-visible button { min-height: 74px; display: block; padding: 10px 4px; text-align: center; }
  .admin-quick-actions-visible span { margin: 0 auto 7px; }
  .review-workspace { width: 100%; }
  .review-toolbar { flex-wrap: wrap; gap: 10px; padding: 12px; }
  .review-toolbar .review-search { flex-basis: 100%; }
  .review-toolbar { border-bottom: 1px solid var(--line); border-radius: 9px; }
  .review-toolbar > .custom-select { width: 100%; flex-basis: 100%; }
  .review-summary { padding: 10px 2px 8px; border: 0; background: transparent; }
  .review-table-wrap { padding: 0; border: 0; background: transparent; }
  .pagination { justify-content: center; padding-top: 14px; }
  .page-button { width: 44px; height: 44px; }
  .dashboard-grid { gap: 11px; }
  .panel { padding: 15px; border-radius: 10px; }
  .bar-chart { height: 172px; gap: 10px; }
  .application-card { grid-template-columns: 102px minmax(0, 1fr); gap: 13px; padding: 12px; border-radius: 15px; box-shadow: 0 7px 22px rgba(16,36,58,.05); }
  .application-thumb { width: 102px; height: 92px; border-radius: 11px; }
  .application-info h3 { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .application-info h3 { font-size: 16px; line-height: 1.45; }
  .application-info p { font-size: 13px; line-height: 1.55; }
  .application-info .text-button { min-height: 40px; font-size: 14px; }
  .application-side { grid-column: 2; text-align: left; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .application-group-card { align-items: start; }
  .application-group-card .application-info { min-width: 0; }
  .group-participants li { grid-template-columns: minmax(0, 1fr) auto; }
  .group-participants small { grid-column: 1 / -1; }
  .application-side { min-width: 0; align-items: flex-start; }
  .application-side .primary-button { width: 100%; }
  .application-side small { margin-top: 0; font-size: 12px; line-height: 1.45; }
  .data-table { min-width: 0; }
  .data-table thead { display: none; }
  .data-table tbody { display: grid; gap: 9px; }
  .data-table tr { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
  .data-table td { border: 0; padding: 0; white-space: normal; }
  .data-table td:first-child { grid-column: 1 / -1; margin-bottom: 3px; font-size: 12px; }
  .data-table td:nth-child(4) { display: none; }
  .data-table td:nth-child(5), .data-table td:nth-child(6) { text-align: right; }
  .application-table { table-layout: auto; }
  .application-table tr.review-record { grid-template-columns: minmax(0, 1fr) minmax(112px, .72fr); gap: 13px 16px; padding: 15px; border-radius: 8px; background: #fff; }
  .application-table td.review-main { grid-column: 1 / -1; margin: 0; padding-bottom: 1px; }
  .application-table .review-person, .application-table .review-school, .application-table .review-date { display: grid; min-width: 0; gap: 4px; text-align: left; }
  .application-table .review-school { text-align: right; }
  .application-table td.review-date { display: grid; grid-column: 1 / -1; padding-top: 1px; }
  .application-table td.review-status-cell { display: none; }
  .application-table td.review-actions-cell { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid #edf1f3; text-align: left; }
  .application-table .review-event { max-width: none; }
  .review-event-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .application-table .review-event strong { min-width: 0; color: var(--navy-950); font-size: 14px; line-height: 1.45; white-space: normal; }
  .application-table .review-event small { display: -webkit-box; max-width: none; margin-top: 2px; overflow: hidden; line-height: 1.55; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .mobile-review-status { display: inline-flex; flex: 0 0 auto; margin-top: 1px; }
  .mobile-field-label { display: block; color: #93a1ac; font-size: 9px; font-weight: 600; }
  .review-field-value { color: #506675; font-size: 11px; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; }
  .review-email { max-width: 100%; font-size: 9px; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; }
  .application-table .table-actions { display: flex; width: 100%; gap: 9px; }
  .application-table .review-action { flex: 1 1 0; min-width: 0; min-height: 44px; font-size: 12px; }
  .application-table .table-muted { display: block; width: 100%; padding: 5px 0; text-align: center; }
  .application-table .review-empty-row { display: block; padding: 0; border: 0; background: transparent; }
  .application-table .review-empty-row td { display: block; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .form-field.full { grid-column: auto; }
  .form-field label { font-size: 14px; }
  .form-field input:not([type="checkbox"]):not([type="radio"]), .form-field textarea, .form-field .custom-select-trigger { min-height: 48px; border-radius: 12px; font-size: 16px; }
  .form-hint { font-size: 13px; line-height: 1.5; }
  .verification-row { grid-template-columns: minmax(0, 1fr) auto; }
  .verification-row input { min-width: 0; }
  .verification-row .secondary-button { min-width: 106px; padding-inline: 8px; font-size: 11px; }
  .modal-backdrop { place-items: end center; padding: 0; }
  .modal, .modal.small { width: 100%; max-height: 92dvh; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .modal::before { content: ""; display: block; width: 38px; height: 4px; margin: 8px auto 0; border-radius: 99px; background: #d7dfe4; }
  .modal-header { position: sticky; top: 0; z-index: 2; padding: 15px 18px 14px; background: #fff; }
  .modal-header h2 { font-size: 22px; line-height: 1.3; }
  .modal-header p { font-size: 14px; line-height: 1.5; }
  .modal-close { width: 44px; height: 44px; font-size: 22px; }
  .modal-body { padding: 19px 18px; }
  .modal-event-hero { height: 160px; }
  .modal-footer { position: sticky; bottom: 0; z-index: 2; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -8px 20px rgba(16,36,58,.05); }
  .modal-footer button { flex: 1; min-height: 45px; }
  .form-section, .account-section { padding: 15px 13px; border-radius: 13px; }
  .section-heading h3 { font-size: 16px; }
  .section-heading p, .registration-note, .validation-summary p, .validation-summary button { font-size: 13px; }
  .field-error { font-size: 12px; }
  .validation-summary { padding: 13px; }
  .registration-note { padding: 13px; }
  .group-readonly-list article { align-items: flex-start; }
  .account-actions { flex-wrap: wrap; }
  .account-actions #logout-account { flex-basis: 100%; order: 3; margin: 4px 0 0; }
  .confirm-backdrop { padding: 16px; }
  .confirm-dialog { padding: 22px 18px; border-radius: 16px; }
  .confirm-actions { grid-template-columns: 1fr; }
  .event-detail-page { border: 0; border-radius: 0; margin: 0 -16px; }
  .page-back { min-height: 44px; margin-bottom: 4px; font-size: 14px; }
  .event-detail-hero { height: 240px; }
  .event-detail-content { padding: 22px 16px 28px; }
  .event-detail-heading { display: block; }
  .event-detail-heading h1 { margin-block: 12px 9px; font-size: 27px; line-height: 1.25; }
  .event-detail-heading p { font-size: 16px; line-height: 1.65; }
  .event-category-inline, .mini-status { font-size: 13px; }
  .event-detail-grid { grid-template-columns: 1fr; gap: 8px; margin-block: 22px; border: 0; border-radius: 0; background: transparent; }
  .event-detail-grid div { padding: 15px 16px; border: 1px solid #e5dcf2; border-radius: 13px; background: linear-gradient(135deg, #fff, #faf7fe); }
  .event-detail-grid strong { font-size: 13px; }
  .event-detail-grid span { font-size: 15px; line-height: 1.5; }
  .modal-callout { padding: 15px; border-color: #cfe4f4; border-radius: 13px; color: #51677a; background: var(--accent-soft); font-size: 14px; line-height: 1.6; }
  .modal-callout strong { color: var(--accent); font-size: 14px; }
  .event-gallery, .event-gallery.single { grid-template-columns: 1fr 1fr; grid-auto-rows: 135px; }
  .gallery-photo.featured:not(:only-child) { grid-column: 1 / -1; grid-row: auto; height: 205px; }
  .photo-lightbox { padding: 14px 12px calc(16px + env(safe-area-inset-bottom)); }
  .lightbox-stage img { max-height: calc(100dvh - 128px); border-radius: 8px; }
  .lightbox-stage figcaption { flex-direction: column; gap: 7px; font-size: 13px; }
  .lightbox-close { top: max(12px, env(safe-area-inset-top)); right: 12px; }
  .lightbox-nav { width: 42px; height: 42px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .media-report-list { grid-template-columns: 1fr; }
  .event-detail-actions { position: fixed; z-index: 4; right: 0; bottom: calc(82px + env(safe-area-inset-bottom)); left: 0; margin: 0; padding: 12px 16px; border-top: 1px solid var(--line); background: rgba(255,255,255,.96); box-shadow: 0 -8px 22px rgba(16,36,58,.07); backdrop-filter: blur(12px); }
  .event-detail-actions .primary-button { width: 100%; min-height: 52px; border-radius: 14px; font-size: 16px; }
  .event-editor-modal { width: 100%; height: 92dvh; max-height: 92dvh; }
  .editor-workspace { display: block; overflow-y: auto; }
  .editor-form-pane { overflow: visible; padding: 17px 18px 25px; }
  .editor-preview-pane { overflow: visible; border-top: 1px solid var(--line); border-left: 0; }
  .preview-toolbar { position: static; }
  #event-live-preview { padding: 14px; }
  .preview-cover { height: 180px; }
  .content-editor-heading { align-items: flex-start; }
  .content-editor-heading .secondary-button { min-height: 38px; }
  .asset-row { grid-template-columns: 54px minmax(0, 1fr) 28px; }
  .asset-row img { width: 54px; height: 48px; }
  .report-editor-row > div { grid-template-columns: 1fr; }
  .submission-success, .application-detail-page { width: 100%; margin: 8px 0; padding: 20px 15px; border-radius: 10px; }
  .success-list article { grid-template-columns: 1fr; }
  .success-list .mini-status { grid-row: auto; grid-column: auto; justify-self: start; }
  .success-actions { display: grid; grid-template-columns: 1fr; }
  .application-detail-page dl { grid-template-columns: 1fr; }
  .participant-form { padding: 16px 13px; border-radius: 13px; }
  .participant-form legend, .contact-form h3 { font-size: 16px; }
  .checkbox-options { grid-template-columns: 1fr; }
  .auth-modal { padding: 30px 22px calc(30px + env(safe-area-inset-bottom)); }
  .auth-brand strong { font-size: 16px; }
  .auth-modal h2 { font-size: 28px; }
  .auth-modal > p { font-size: 15px; line-height: 1.6; }
  .auth-form .primary-button { height: 50px; border-radius: 13px; font-size: 16px; }
  .auth-separator, .auth-footnote { font-size: 14px; }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 32px); text-align: center; }
  .mobile-nav { position: fixed; display: flex; align-items: flex-start; justify-content: space-around; left: 0; right: 0; bottom: 0; height: calc(82px + env(safe-area-inset-bottom)); padding: 7px 8px env(safe-area-inset-bottom); background: rgba(255,255,255,.96); border-top: 1px solid var(--line); box-shadow: 0 -7px 24px rgba(16,36,58,.07); backdrop-filter: blur(10px); z-index: 5; }
  .mobile-nav-item { position: relative; flex: 1; height: 68px; max-width: 120px; background: transparent; color: #8d9aa5; display: grid; justify-items: center; align-content: center; gap: 7px; padding: 3px; }
  .mobile-nav-item > span { font-size: 30px; line-height: .8; font-weight: 600; }
  .mobile-nav-item:focus { outline: none; }
  .mobile-nav-item:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); border-radius: 8px; }
  .mobile-nav-item small { font-size: 14px; line-height: 1.2; font-weight: 600; }
  .mobile-nav-item.active { color: var(--accent); font-weight: 700; }
  .mobile-nav-item.active::before { content: ""; position: absolute; top: -7px; width: 34px; height: 4px; border-radius: 0 0 4px 4px; background: var(--accent); }
}

@media (max-width: 900px) {
  .event-grid .event-category, .event-grid .event-status { font-size: 12px; }
  .auth-footnote button { min-height: 44px; padding-block: 8px; }
  .custom-option { min-height: 44px; }
  .mine-summary .stat-card { min-height: 0; padding: 12px 14px; }
  .mine-summary .stat-icon, .mine-summary .stat-note { display: none; }
  .mine-summary .stat-top { margin-bottom: 8px; }
  .mine-summary .stat-label { font-size: 13px; }
  .mine-summary .stat-value strong { font-size: 24px; }
  .application-group-card .application-info { display: contents; }
  .application-group-card .application-thumb { grid-column: 1; grid-row: 1 / span 2; }
  .application-group-card .application-info h3 { grid-column: 2; display: block; overflow: visible; margin-bottom: 0; }
  .application-group-card .application-info p { grid-column: 2; }
  .application-group-card .group-participants { grid-column: 1 / -1; margin-top: 0; }
  .application-group-card .group-participants .text-button { overflow: visible; white-space: normal; overflow-wrap: anywhere; text-align: left; line-height: 1.5; }
  .application-group-card .group-participants small { font-size: 12px; }
  .application-group-card .application-side { grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid var(--line); }
  .application-detail-heading { flex-wrap: wrap; }
  .application-detail-heading h1 { overflow-wrap: anywhere; }
  .application-detail-page dt { font-size: 13px; line-height: 1.5; }
  .application-detail-page dd { font-size: 15px; line-height: 1.6; }
  .application-detail-page .event-detail-actions button { flex: 1; min-width: 0; min-height: 48px; font-size: 14px; }
  .success-list strong { font-size: 16px; }
  .success-list span, .success-list time, .success-list code { font-size: 13px; line-height: 1.5; }
  .event-admin-table tr { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px; }
  .event-admin-table td:nth-child(n) { display: block; min-width: 0; font-size: 14px; line-height: 1.5; text-align: left; overflow-wrap: anywhere; }
  .event-admin-table td:first-child { font-size: 16px; }
  .event-admin-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; }
  .event-admin-table td:nth-child(6) { grid-column: 1 / -1; }
  .event-admin-table td:last-child { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid var(--line); }
  .event-admin-table .table-actions { gap: 12px; }
  .event-admin-table .table-actions button { flex: 1; min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
  .app-shell:has(.event-detail-actions) { padding-bottom: calc(170px + env(safe-area-inset-bottom)); }
  body:has(.event-detail-actions):not(.modal-open) .toast { bottom: calc(174px + env(safe-area-inset-bottom)); }
}

/* Improved mobile readability */
@media (max-width: 600px) {
  .event-grid { grid-template-columns: minmax(0, 1fr); }
  body { font-size: 18px; }
  button, input, select, textarea { font-size: 16px; }
  .page-heading p, .section-header span, .stat-note, .detail-line { font-size: 15px; }
  .event-grid .event-body h3, .welcome-band h2 { font-size: 19px; }
  .event-grid .detail-line { font-size: 14px; }
  .admin-tab, .category-tab { font-size: 16px; }
  .admin-quick-actions strong { font-size: 12px; }
  .review-detail, .review-email, .review-field-value { font-size: 14px; }
}

@media (orientation: landscape) and (max-height: 500px) and (max-width: 900px) {
  .app-shell { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .topbar { height: 52px; }
  .school-identity { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 14px; margin-bottom: 8px; padding-block: 4px; }
  .school-banner { min-height: 38px; }
  .school-banner img { height: 38px; }
  .identity-stats { margin-top: 0; border-top: 0; border-left: 1px solid var(--line); }
  .page-heading { margin-bottom: 8px; }
  .page-heading h1 { margin-bottom: 0; font-size: 24px; }
  .page-heading p { display: none; }
  .category-tabs { margin-bottom: 4px; }
  .section-header { margin-top: 4px; }
  .event-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile-nav { height: calc(62px + env(safe-area-inset-bottom)); }
  .mobile-nav-item { height: 52px; gap: 3px; }
  .mobile-nav-item > span { font-size: 22px; }
  .mobile-nav-item small { font-size: 12px; }
  .event-detail-actions { bottom: calc(62px + env(safe-area-inset-bottom)); }
  .event-detail-hero { height: 200px; }
  .modal, .modal.small { max-height: 100dvh; }
}

@media (orientation: landscape) and (max-height: 500px) and (max-width: 900px) {
  .modal-header { position: static; }
  .account-actions { flex-wrap: nowrap; }
  .account-actions #logout-account { flex-basis: auto; order: 0; margin-right: auto; }
  .app-shell:has(.event-detail-actions) { padding-bottom: calc(146px + env(safe-area-inset-bottom)); }
  body:has(.event-detail-actions):not(.modal-open) .toast { bottom: calc(154px + env(safe-area-inset-bottom)); }
}

/* Activity Markdown and independently reviewed registration time slots. */
.markdown-body { color: var(--ink); line-height: 1.8; overflow-wrap: anywhere; min-width: 0; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 { color: var(--navy-900); line-height: 1.4; margin: 1.4em 0 .6em; }
.markdown-body h1 { font-size: 1.5rem; }
.markdown-body h2 { font-size: 1.25rem; }
.markdown-body h3, .markdown-body h4 { font-size: 1.05rem; }
.markdown-body p, .markdown-body ul, .markdown-body ol { margin: .65em 0; font-size: inherit; }
.markdown-body ul, .markdown-body ol { padding-left: 1.6em; }
.markdown-body li + li { margin-top: .3em; }
.markdown-body a { color: var(--accent); text-decoration: underline; }
.markdown-body blockquote { border-left: 3px solid var(--sky); margin: 1em 0; padding: .2em 1em; background: var(--sky-soft); }
.markdown-body table { display: block; overflow-x: auto; border-collapse: collapse; width: 100%; font-size: .9em; }
.markdown-body th, .markdown-body td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.markdown-body th { background: var(--sky-soft); }
.markdown-body img { max-width: 100%; height: auto; border-radius: 8px; }
.markdown-body pre { background: var(--canvas); border-radius: 8px; padding: 12px; overflow-x: auto; }
.markdown-body code { white-space: pre-wrap; font-family: ui-monospace, monospace; }
.markdown-toolbar { display: flex; flex-wrap: wrap; gap: 5px; padding: 7px; background: var(--canvas); border: 1px solid var(--line); border-radius: 9px 9px 0 0; }
.markdown-toolbar button { background: white; border: 1px solid var(--line); color: var(--navy-900); border-radius: 5px; padding: 6px 10px; font-size: 12px; }
.markdown-toolbar button:hover { background: var(--accent-soft); }
.form-field .markdown-input { min-height: 230px; border-radius: 0 0 9px 9px; font-family: ui-monospace, "Noto Sans TC", monospace; line-height: 1.7; resize: vertical; }
.event-detail-heading .markdown-body { margin-top: 20px; font-size: 15px; }
.activity-notice > span { flex: 0 0 auto; }
.activity-notice-content { flex: 1; min-width: 0; }
.activity-notice .activity-notice-title { margin-bottom: 8px; }
.activity-notice .markdown-body { color: inherit; font-size: inherit; line-height: inherit; }
.activity-notice .markdown-body strong { display: inline; color: inherit; font-size: inherit; }
.activity-notice .markdown-body h1 { font-size: 1.3em; }
.activity-notice .markdown-body h2 { font-size: 1.2em; }
.activity-notice .markdown-body h3, .activity-notice .markdown-body h4 { font-size: 1.1em; }
.activity-notice .registration-policy { margin: 0 0 .8em; }
.activity-notice-content > :last-child { margin-bottom: 0; }
.event-sessions { min-width: 0; margin: 24px 0; border: 1px solid var(--line); padding: 20px; border-radius: 14px; background: #f9fbfe; }
.event-sessions legend { color: var(--navy-900); font-size: 19px; font-weight: 700; padding: 0 7px; }
.event-sessions legend small { font-size: 11px; font-weight: 400; margin-left: 10px; color: var(--muted); }
.session-instructions { font-size: 13px; color: var(--muted); line-height: 1.7; margin: 0 0 15px; }
.session-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.session-option { display: flex; align-items: flex-start; gap: 10px; background: white; border: 1px solid #d3dfe9; border-radius: 10px; padding: 14px; min-width: 0; cursor: pointer; }
.session-option:has(input:checked) { background: var(--sky-soft); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.session-option:has(input:focus-visible) { outline: 3px solid var(--sky); outline-offset: 2px; }
.session-option input { width: 18px; height: 18px; margin: 3px 0 0; flex: 0 0 18px; accent-color: var(--accent); }
.session-option-copy { display: grid; gap: 5px; font-size: 13px; line-height: 1.6; min-width: 0; }
.session-option-copy strong { color: var(--navy-900); font-size: 15px; }
.session-option-copy small, .session-unavailable { font-size: 11px; color: var(--muted); }
.session-option.is-unavailable { opacity: .65; cursor: default; }
.session-summary { cursor: default; }
.preview-event-content .event-sessions { padding: 12px; }
.preview-event-content .event-sessions legend { font-size: 16px; }
.preview-event-content .session-options { grid-template-columns: 1fr; }
.session-mode-toggle { display: flex; gap: 10px; align-items: center; font-size: 14px; margin: 14px 0; font-weight: 600; }
.session-mode-toggle input { accent-color: var(--accent); width: 18px; height: 18px; }
.session-editor-row { background: var(--canvas); padding: 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; }
.session-row-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 13px; }
.session-row-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.session-row-grid label { display: grid; gap: 6px; font-size: 12px; color: var(--muted); min-width: 0; }
.session-row-grid input { width: 100%; min-width: 0; padding: 9px; border: 1px solid #cdd9e3; border-radius: 7px; background: white; color: var(--ink); }
.session-editor-total { font-size: 12px; color: var(--accent); font-weight: 600; }
.form-field select[data-session-id] { width: 100%; padding: 12px; border: 1px solid #bccddc; border-radius: 8px; color: var(--ink); background: white; font: inherit; min-width: 0; }
.application-session { color: var(--accent); font-size: 12px; display: block; line-height: 1.6; }
.group-participants li { flex-wrap: wrap; }
.group-participants .application-session { flex-basis: 100%; }
.review-toolbar { flex-wrap: wrap; }
.local-development-banner { background: #fff1bd; color: #614600; text-align: center; padding: 10px 18px; font-size: 13px; border-bottom: 1px solid #dfc96e; line-height: 1.7; }
@media (max-width: 600px) {
  .event-sessions { padding: 14px; }
  .session-options, .session-row-grid { grid-template-columns: 1fr; }
  .session-option { padding: 12px; }
  .event-detail-heading .markdown-body { font-size: 14px; }
}
/* Keep editor sections full-width and the cover inside its fixed-height track. */
.content-editor-section.full { grid-column: 1 / -1; min-width: 0; }
.preview-cover { position: relative; overflow: hidden; }
.preview-cover img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

/* Administrative display order and reversible activity visibility. */
.admin-event-heading-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-order-hint { margin: -3px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.admin-event-rank { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 5px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; margin-right: 9px; }
.event-visibility-badge { display: inline-block; font-size: 10px; background: #e8edf2; color: #516475; border-radius: 5px; padding: 3px 6px; margin: 5px 0 0 6px; white-space: nowrap; }
.event-visibility-badge.is-hidden { background: #fff1cd; color: #805b06; }
.event-row-hidden { background: #fffdf5; }
.event-admin-table .table-actions { flex-wrap: wrap; }
.restore-event-button { color: var(--accent); font-weight: 700; }
.event-order-modal { width: min(840px, calc(100vw - 32px)); }
.event-order-modal .modal-body { padding: 20px 24px; overflow-y: auto; }
.order-help { display: flex; align-items: flex-start; gap: 15px; justify-content: space-between; margin-bottom: 14px; }
.order-help p { font-size: 12px; color: var(--muted); line-height: 1.7; margin: 0; }
.order-help button { white-space: nowrap; }
.event-order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.event-order-list > li { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; }
.event-order-list > li:focus { outline: 2px solid var(--sky); outline-offset: 1px; }
.order-grip { font-size: 23px; color: #8a9dae; cursor: grab; user-select: none; }
.order-position { display: grid; place-items: center; width: 27px; height: 27px; flex: 0 0 27px; background: var(--accent-soft); color: var(--accent); border-radius: 8px; font-size: 12px; font-weight: 700; }
.order-event-copy { flex: 1; min-width: 0; display: grid; gap: 4px; }
.order-event-copy strong { font-size: 13px; overflow-wrap: anywhere; }
.order-event-copy small { font-size: 11px; color: var(--muted); }
.order-event-copy .event-visibility-badge { justify-self: start; margin: 0; }
.order-row-actions { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.order-row-actions button { padding: 7px; border-radius: 6px; background: #f1f6fa; font-size: 11px; white-space: nowrap; min-height: 34px; }
.order-row-actions button:hover:not(:disabled) { background: var(--sky-soft); }
.order-error { color: var(--red); font-size: 13px; line-height: 1.6; }
@media (max-width: 600px) {
  .admin-event-heading-actions { width: 100%; }
  .admin-event-heading-actions button { flex: 1; }
  .event-order-modal .modal-body { padding: 15px; }
  .order-help { display: block; }
  .order-help button { margin-top: 8px; }
  .event-order-list > li { flex-wrap: wrap; gap: 8px; }
  .order-row-actions { flex-basis: 100%; }
  .order-row-actions button { flex: 1; min-height: 40px; }
}

/* Browsing cards show a short summary; full Markdown remains on the detail page. */
.event-grid .event-description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
  line-height: 1.65;
  max-height: 4.95em;
  min-height: 0;
  margin-bottom: 14px;
}
@media (max-width: 760px) {
  .event-grid .event-description {
    -webkit-line-clamp: 2;
    line-clamp: 2;
    max-height: 3.3em;
    margin-bottom: 12px;
    font-size: 13px;
  }
}
