:root {
  --bg: #f5f7f4; --surface: #ffffff; --surface-2: #f0f4ef; --border: #e1e7df;
  --text: #1d2b24; --muted: #66756d; --brand: #2f7d55; --brand-600: #256845; --brand-50: #e8f3ec;
  --accent: #e2a03f; --danger: #c2413b; --info: #3b6fb6; --staff: #7a4fb5;
  --radius: 12px; --shadow: 0 1px 2px rgba(20,40,30,.05), 0 4px 16px rgba(20,40,30,.05);
  --sidebar: 248px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; }
h2 { font-size: 1.35rem; } h3 { font-size: 1.05rem; } h4 { font-size: .95rem; }
p { margin: 0 0 .75rem; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.nav-toggle { display: none; }
.sidebar { width: var(--sidebar); background: #173a2a; color: #d6e6dc; position: fixed; inset: 0 auto 0 0; overflow-y: auto; padding: 18px 12px; z-index: 30; }
.brand { display: flex; gap: 10px; align-items: center; color: #fff; padding: 4px 8px 18px; }
.brand:hover { text-decoration: none; }
.brand strong { display: block; font-size: 1rem; }
.brand small { display: block; color: #9fbfab; font-size: .78rem; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--brand); color: #fff; flex: none; }
.brand-mark .icon { width: 20px; height: 20px; }
.brand-mark.lg { width: 48px; height: 48px; border-radius: 14px; }
.brand-mark.lg .icon { width: 26px; height: 26px; }
.nav-section { text-transform: uppercase; letter-spacing: .08em; font-size: .7rem; color: #87a993; padding: 16px 10px 6px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #d6e6dc; font-size: .93rem; }
.nav-link:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.nav-link.active { background: rgba(255,255,255,.13); color: #fff; font-weight: 600; }
.nav-link .badge { margin-left: auto; background: var(--accent); color: #2b1d05; border-radius: 99px; font-size: .72rem; font-weight: 700; padding: 1px 8px; }
.main { flex: 1; margin-left: var(--sidebar); min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: rgba(245,247,244,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); }
.page-title { font-size: 1.2rem; margin: 0; flex: 1; }
.menu-btn { display: none; cursor: pointer; padding: 6px; border-radius: 8px; }
.topbar-user { display: flex; align-items: center; gap: 6px; }
.topbar-user form { margin: 0; }
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--text); padding: 4px 8px; border-radius: 99px; }
.user-chip:hover { background: var(--surface-2); text-decoration: none; }
.user-meta strong { display: block; font-size: .88rem; line-height: 1.1; }
.user-meta small { color: var(--muted); text-transform: capitalize; font-size: .75rem; }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-50); color: var(--brand-600); font-weight: 700; font-size: .8rem; flex: none; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.1rem; }
.content { padding: 24px 28px 48px; max-width: 1280px; width: 100%; }
.scrim { display: none; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .nav-toggle:checked ~ .shell .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .nav-toggle:checked ~ .shell .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 25; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .content { padding: 16px 16px 40px; }
  .user-meta { display: none; }
}

/* ---------- Components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.card.narrow { max-width: 720px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.empty-state { text-align: center; padding: 40px 20px; }
.sticky { position: sticky; top: 80px; }

.grid-main { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.grid-main > .col { min-width: 0; }
.grid-main > .col.wide { grid-column: span 1; }
.grid-main:has(> .col.wide) { grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); }
.grid-main > section.card.col { margin-bottom: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.grid-2 > * { min-width: 0; }
@media (max-width: 1050px) { .grid-main, .grid-main:has(> .col.wide) { grid-template-columns: 1fr; } .sticky { position: static; } }
@media (max-width: 560px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row form { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack > .btn { align-self: flex-start; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar form { margin: 0; }

label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .88rem; }
label.check, label.inline { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
label.inline input { width: 90px; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--text); background: #fff; border: 1px solid #cfd8cc; border-radius: 8px; padding: 9px 11px; width: 100%; min-width: 0; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--brand); padding: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-50); border-color: var(--brand); }
textarea { resize: vertical; }
fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin: 0; }
legend { font-weight: 700; padding: 0 6px; }
.toolbar input[type=search], .toolbar select { width: auto; }
.search { margin-bottom: 16px; }
.search input { padding: 11px 14px; border-radius: 10px; }
.row-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row-form label { flex: 1; min-width: 140px; }
.filters { align-items: flex-end; }
.filters label { min-width: 150px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-weight: 600; font-size: .9rem; border-radius: 9px; padding: 9px 16px; border: 1px solid transparent; cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .15s, border-color .15s; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-secondary { background: var(--brand-50); color: var(--brand-600); }
.btn-secondary:hover { background: #d8ebdf; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-light { background: rgba(255,255,255,.95); color: var(--brand-600); }
.btn-light:hover { background: #fff; }
.btn-sm { padding: 5px 11px; font-size: .82rem; }
.btn-block { width: 100%; }
.btn.danger, .link-btn.danger { color: var(--danger); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: .85rem; color: var(--brand-600); cursor: pointer; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
td.actions { white-space: nowrap; }
td.actions > * { display: inline-block; margin: 0 6px 0 0; }
td.actions form { display: inline; }

.alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; transition: opacity .6s; }
.alert-success { background: #e5f4ea; color: #1e5e3c; border: 1px solid #c4e3cf; }
.alert-error { background: #fbeaea; color: #8a2621; border: 1px solid #f1caca; }
.alert.fade { opacity: 0; }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; vertical-align: middle; }
.pill.lg { font-size: .88rem; padding: 6px 12px; }
.pill .icon { width: 14px; height: 14px; }
.pill-approved, .pill-active { background: #e2f3e8; color: #1e6b41; }
.pill-pending { background: #fdf1dc; color: #8a5a10; }
.pill-rejected, .pill-inactive { background: #f9e6e5; color: #9b2f29; }
.pill-staff, .pill-role-staff { background: #efe8f8; color: var(--staff); }
.pill-role-admin { background: #e5edf8; color: var(--info); }
.pill-role-volunteer { background: var(--brand-50); color: var(--brand-600); }
.pill-open { background: #e5edf8; color: var(--info); }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 3px; }
.seg a { padding: 5px 12px; border-radius: 7px; font-size: .84rem; font-weight: 600; color: var(--muted); }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg a.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 8px 8px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px 8px; border-bottom: 1px solid #eef2ec; vertical-align: top; }
.table tbody tr:hover { background: #fafcf9; }
.table.compact td { padding: 7px 4px; }
.table tfoot th { font-size: .9rem; color: var(--text); border-top: 2px solid var(--border); border-bottom: 0; }
.note { color: #8a5a10; }

/* ---------- Dashboard ---------- */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; background: linear-gradient(120deg, #2f7d55, #3f9a6b 60%, #6bb58a); color: #fff; border-radius: 16px; padding: 26px 28px; margin-bottom: 20px; box-shadow: var(--shadow); }
.hero h2 { font-size: 1.5rem; }
.hero p { margin: 0; opacity: .92; max-width: 60ch; }
.hero-staff { background: linear-gradient(120deg, #3c2f6b, #5a46a0 60%, #7b67c2); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stats-3 { grid-template-columns: repeat(3, 1fr); }
.stat { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); color: var(--text); }
a.stat:hover { text-decoration: none; border-color: #c9d8cd; }
.stat b { display: block; font-size: 1.55rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); }
.stat-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: var(--brand-50); color: var(--brand-600); flex: none; }
.stat-icon.warn { background: #fdf1dc; color: #a56b12; }
@media (max-width: 1000px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .stats, .stats-3 { grid-template-columns: 1fr 1fr; gap: 10px; } .stat { padding: 12px; } .stat-icon { display: none; } }

.event-list { list-style: none; margin: 0; padding: 0; }
.event-list li + li { border-top: 1px solid #eef2ec; }
.event-list a { display: flex; align-items: center; gap: 14px; padding: 10px 4px; color: var(--text); }
.event-list a:hover { text-decoration: none; background: #fafcf9; }
.event-list strong { display: block; }
.event-list small { color: var(--muted); display: block; }
.date-badge { display: grid; place-items: center; width: 46px; height: 50px; border-radius: 10px; background: var(--brand-50); color: var(--brand-600); flex: none; line-height: 1.05; }
.date-badge b { font-size: 1.2rem; }
.date-badge small { font-size: .7rem; text-transform: uppercase; font-weight: 700; color: var(--brand-600) !important; }
.date-badge.lg { width: 64px; height: 70px; }
.date-badge.lg b { font-size: 1.6rem; }

.news { padding: 10px 0; }
.news + .news { border-top: 1px solid #eef2ec; }
.news h4 { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.news p { margin: 0 0 4px; color: #3c4a42; }
.pin { color: var(--accent); display: inline-flex; }
.pin .icon { width: 16px; height: 16px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.clamp-1 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prose { white-space: pre-line; margin-bottom: 12px; }
.news-card.pinned { border-left: 4px solid var(--accent); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 8px; }
.tile { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-weight: 600; font-size: .9rem; background: #fbfcfa; }
.tile:hover { border-color: var(--brand); background: var(--brand-50); text-decoration: none; }
.tile .icon { color: var(--brand); margin-top: 2px; }
.tile small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; }
.group-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 8px; }

/* ---------- Calendar ---------- */
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav h2 { margin: 0 6px; min-width: 170px; text-align: center; }
.cal { padding: 0; overflow: hidden; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head span { padding: 10px; font-size: .75rem; font-weight: 700; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); text-align: center; }
.cal-day { min-height: 112px; border-right: 1px solid #eef2ec; border-bottom: 1px solid #eef2ec; padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.out { background: #fafbf9; }
.cal-day.out .cal-num { color: #b5c0b8; }
.cal-num { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; font-weight: 700; color: var(--muted); padding: 0 2px 2px; }
.cal-day.today .cal-num { color: var(--brand); }
.cal-day.today { background: #f5fbf7; }
.cal-add { opacity: 0; color: var(--muted); display: inline-flex; }
.cal-add .icon { width: 15px; height: 15px; }
.cal-day:hover .cal-add { opacity: 1; }
.cal-event { display: block; font-size: .76rem; padding: 3px 6px; border-radius: 6px; background: #e5edf8; color: #234a80; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--info); }
.cal-event:hover { text-decoration: none; filter: brightness(.96); }
.cal-event span { font-weight: 700; }
.cal-event.mine { background: #e2f3e8; color: #1e5e3c; border-left-color: var(--brand); }
.cal-event.staff { background: #efe8f8; color: #4e2f80; border-left-color: var(--staff); }
.cal-event.full { opacity: .6; }
.legend { display: flex; gap: 14px; align-items: center; padding: 10px 14px; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.lg-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--info); display: inline-block; margin-right: -8px; }
.lg-dot.mine { background: var(--brand); } .lg-dot.staff { background: var(--staff); } .lg-dot.full { background: #b9c2bc; }
@media (max-width: 700px) {
  .cal-day { min-height: 64px; padding: 3px; }
  .cal-event { font-size: 0; padding: 0; height: 6px; border-left-width: 0; background: var(--info); }
  .cal-event.mine { background: var(--brand); }
  .cal-event.staff { background: var(--staff); }
  .cal-head span { padding: 6px 0; font-size: .65rem; }
  .month-nav h2 { min-width: 0; font-size: 1.1rem; }
}

.event-hero { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 12px; }
.event-hero p { margin-bottom: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.attendance-bar, .approval-bar { margin-top: 14px; }
.approval-bar input { min-width: 220px; }

/* ---------- People & docs ---------- */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.person { text-align: center; margin: 0; }
.person .avatar { margin-bottom: 10px; }
.person-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.person-head h2 { margin: 0; }
.person-head p { margin: 0; text-transform: capitalize; }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; margin: 0 0 14px; }
.dl dt { color: var(--muted); font-size: .85rem; }
.dl dd { margin: 0; }
.tick { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-size: .7rem; font-weight: 800; background: #f1f1f1; color: #b2b2b2; margin-right: 4px; }
.tick.ok { background: #e2f3e8; color: #1e6b41; }
.doc-list, .team-list { list-style: none; margin: 0; padding: 0; }
.doc-list li, .team-list li { display: flex; gap: 12px; align-items: center; padding: 10px 0; }
.doc-list li + li, .team-list li + li { border-top: 1px solid #eef2ec; }
.doc-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; background: var(--surface-2); color: var(--brand-600); flex: none; }
.team-list strong { display: block; font-size: .92rem; }
.quick-post { margin-top: 12px; }
.quick-post summary { cursor: pointer; font-weight: 600; color: var(--brand-600); margin-bottom: 10px; }

/* ---------- Reports ---------- */
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 60px; gap: 10px; align-items: center; font-size: .86rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--surface-2); border-radius: 6px; height: 14px; overflow: hidden; }
.bar { display: block; height: 100%; background: var(--brand); border-radius: 6px; min-width: 2px; }
.bar.alt { background: var(--accent); }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- Auth ---------- */
.auth-body { background: radial-gradient(circle at 20% 0%, #dff0e5, transparent 50%), radial-gradient(circle at 100% 100%, #f6ead3, transparent 45%), var(--bg); }
.auth-wrap { max-width: 520px; margin: 0 auto; padding: 48px 16px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; justify-content: center; }
.auth-brand strong { display: block; font-size: 1.2rem; }
.auth-brand small { color: var(--muted); }
.auth-card { padding: 28px; }
.auth-alt { text-align: center; margin: 16px 0 0; }

/* ---------- Statement / print ---------- */
.print-body { background: #fff; }
.print-bar { display: flex; justify-content: space-between; max-width: 820px; margin: 20px auto 0; padding: 0 16px; }
.statement { max-width: 820px; margin: 0 auto; padding: 32px 16px; }
.statement header { display: flex; gap: 16px; align-items: center; border-bottom: 2px solid var(--brand); padding-bottom: 16px; margin-bottom: 24px; }
.statement h1 { font-size: 1.5rem; margin: 0; }
.statement header p { margin: 0; color: var(--muted); }
.sig { display: flex; gap: 40px; margin: 56px 0 24px; }
.sig div { flex: 1; font-size: .85rem; color: var(--muted); }
.sig span { display: block; border-bottom: 1px solid #333; height: 36px; margin-bottom: 4px; }
@media print {
  .no-print { display: none !important; }
  .statement { padding: 0; }
  .table tbody tr:hover { background: none; }
}
.grid-main > .col > .card:last-child { margin-bottom: 0; }
.grid-main { margin-bottom: 20px; }

/* ---------- Board, security & tools ---------- */
:root { --board: #b5651d; }
.pill-board, .pill-role-board, .pill-aud-board { background: #fbeee0; color: #95511a; }
.pill-aud-staff { background: #efe8f8; color: var(--staff); }
.pill-aud-all { background: var(--brand-50); color: var(--brand-600); }
.hero-board { background: linear-gradient(120deg, #6b3a14, #9a5523 60%, #c27a3e); }
.tile.board .icon { color: var(--board); }
.tile.board:hover { border-color: var(--board); background: #fbf3ea; }
.date-badge.board, .avatar.board { background: #fbeee0; color: #95511a; }
.date-badge.board small { color: #95511a !important; }
.bar.board { background: var(--board); }
.section-title { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 8px 0 12px; }
.people-grid + .section-title { margin-top: 28px; }
.plain-list { margin: 0; padding-left: 18px; }
.plain-list li { margin: 4px 0; }
.inline-form { display: inline; margin-left: 8px; }
.mt { margin-top: 12px; }
.steps { padding-left: 20px; margin: 0 0 12px; }
.steps li { margin-bottom: 16px; }
.qr { margin: 12px 0; }
.qr img { border: 1px solid var(--border); border-radius: 10px; padding: 8px; background: #fff; display: block; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1rem; letter-spacing: .05em; background: var(--surface-2); padding: 8px 12px; border-radius: 8px; display: inline-block; margin-top: 4px; word-break: break-all; }
.code-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.25rem; letter-spacing: .15em; text-align: center; }
.code-input.short { width: 170px; }
.codes-card { border: 2px solid var(--accent); }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0 16px; }
.codes code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1rem; background: var(--surface-2); padding: 8px; border-radius: 8px; text-align: center; }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { padding: 8px 0 8px 12px; border-left: 3px solid var(--brand-50); margin-bottom: 4px; }
.activity li.bad { border-left-color: var(--danger); }
.row-bad td { background: #fff7f6; }
tr.selected td { background: var(--brand-50); }
.break { word-break: break-all; }
details summary { cursor: pointer; }
@media print { body:has(.codes-card) :is(.sidebar, .topbar, .codes-card .row, .grid-main > .col:last-child, .card:not(.codes-card), .alert) { display: none !important; } body:has(.codes-card) .main { margin: 0; } }
.auth-body { min-height: 100vh; }

/* ---------- Email & files ---------- */
.pill-mail-sent { background: #e2f3e8; color: #1e6b41; }
.pill-mail-queued, .pill-mail-sending { background: #e5edf8; color: var(--info); }
.pill-mail-failed { background: #f9e6e5; color: #9b2f29; }
.pill-mail-skipped { background: #fdf1dc; color: #8a5a10; }
.sep { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.tips { padding-left: 18px; margin: 8px 0; }
.tips li { margin-bottom: 6px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; font-weight: 600; }
.crumbs span { color: var(--muted); }
.file-link { display: flex; align-items: center; gap: 10px; color: var(--text); }
.file-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--surface-2); color: var(--muted); flex: none; }
.file-icon.dir { background: #fdf1dc; color: #a56b12; }
.table.files td { vertical-align: middle; }
.lib-card { display: block; color: var(--text); margin: 0; }
.lib-card:hover { text-decoration: none; border-color: var(--brand); }
.doc-icon.lg { width: 48px; height: 48px; margin-bottom: 10px; }
@media (max-width: 600px) { .hide-sm { display: none; } }
.presets { margin-bottom: 14px; }

/* ---------- PHP edition additions ---------- */
.checks { list-style: none; padding: 0; margin: 0 0 16px; font-size: .88rem; }
.checks li { padding: 3px 0; }
.checks li.ok { color: #1e6b41; }
.checks li.bad { color: var(--danger); }
.lg-dot.board { background: var(--board); }
.cal-event.board { background: #fbeee0; color: #7a4113; border-left-color: var(--board); }
label.check span { font-weight: 400; }
.auth-wrap:has(form[action$="/setup"]) { max-width: 640px; }
input[type=radio] { width: 17px; height: 17px; padding: 0; flex: none; accent-color: var(--brand); margin-top: 2px; }
label.check { align-items: flex-start; }

/* ---------- Kiosk mode ---------- */
.kiosk-body { min-height: 100vh; display: flex; flex-direction: column; background: linear-gradient(160deg, #e8f3ec, #f5f7f4 45%, #f6ead3); }
.kiosk-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; }
.kiosk-brand { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; }
.kiosk-clock { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brand-600); }
.kiosk-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; gap: 16px; }
.kiosk-card { background: #fff; border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 10px 40px rgba(20,40,30,.08); padding: 28px; width: 100%; max-width: 460px; text-align: center; }
.kiosk-card.narrow-card { text-align: left; }
.kiosk-card h1 { font-size: 1.5rem; margin-bottom: 6px; }
.kiosk-card .avatar.lg { margin-bottom: 10px; }
.kiosk-big { font-size: 1.15rem; margin: 10px 0 18px; }
.kiosk-form { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.kiosk-code { font-size: 2rem; text-align: center; letter-spacing: .5em; padding: 12px; border-radius: 12px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button { font: inherit; font-size: 1.6rem; font-weight: 700; padding: 16px 0; border-radius: 14px; border: 1px solid var(--border); background: #fbfcfa; color: var(--text); cursor: pointer; touch-action: manipulation; }
.keypad button:active { background: var(--brand-50); }
.keypad button.soft { font-size: 1rem; color: var(--muted); }
.kiosk-go { font-size: 1.25rem; padding: 16px; width: 100%; border-radius: 14px; }
.kiosk-programs { display: grid; gap: 10px; margin: 16px 0; }
.kiosk-programs .btn { font-size: 1.1rem; padding: 16px; border-radius: 14px; }
.kiosk-check { width: 84px; height: 84px; margin: 0 auto 12px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; }
.kiosk-check .icon { width: 46px; height: 46px; stroke-width: 2.5; }
.kiosk-here { background: rgba(255,255,255,.8); border: 1px solid var(--border); border-radius: 12px; padding: 10px 16px; max-width: 460px; text-align: center; }
.kiosk-foot { text-align: center; padding: 14px; font-size: .85rem; }
.kiosk-foot a { color: var(--muted); }
.clocked-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.clocked-row form { display: flex; gap: 6px; align-items: center; margin: 0; }
.clocked-row input[type=datetime-local] { width: auto; padding: 5px 8px; font-size: .85rem; }
.guide ol { margin-top: 10px; } .guide { background: var(--surface-2); padding: 10px 14px; border-radius: 10px; } [hidden] { display: none !important; }
.brand-logo { height: 52px; width: auto; max-width: 160px; object-fit: contain; flex: none; border-radius: 12px; background: #fff; padding: 2px; }
.brand-logo.lg { height: 110px; max-width: 280px; border-radius: 18px; padding: 4px; }
.auth-brand:has(.brand-logo) { flex-direction: column; text-align: center; gap: 8px; }
.kiosk-brand .brand-logo { height: 64px; }
.statement header .brand-logo.lg { height: 96px; }
.logo-preview { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo-preview img { max-height: 72px; max-width: 240px; border: 1px solid var(--border); border-radius: 10px; padding: 6px; background: #fff; }
/* ---------- Welcome steps & waivers ---------- */
.auth-wrap:has(.welcome) { max-width: 600px; }
.welcome h2 { font-size: 1.4rem; }
.welcome-progress { display: flex; gap: 6px; align-items: center; margin-bottom: 18px; }
.welcome-progress span { height: 6px; flex: 1; border-radius: 99px; background: var(--surface-2); }
.welcome-progress span.done { background: var(--brand); }
.welcome-progress span.now { background: var(--accent); }
.welcome-progress small { margin-left: 8px; white-space: nowrap; }
.welcome-list { list-style: none; padding: 0; margin: 0 0 18px; }
.welcome-list li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #eef2ec; }
.welcome-list .icon { color: var(--brand); }
.welcome-out { text-align: center; margin-top: 14px; }
.waiver-text { max-height: 320px; overflow-y: auto; background: #fbfcfa; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; font-size: .92rem; line-height: 1.6; margin-bottom: 14px; }
.waiver-text.print { max-height: none; overflow: visible; }

.welcome-skip { margin-top: 10px; }
.alert-info { background: #eef4fb; color: #234a80; border: 1px solid #d3e2f4; }
/* ---------- Public website calendar & join form ---------- */
.embed-body { background: #fff; }
.embed { max-width: 820px; margin: 0 auto; padding: 18px 16px 28px; }
.embed-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.embed-head h1 { font-size: 1.35rem; margin: 0; }
.embed-head p { margin: 2px 0 0; }
.embed-logo { height: 56px; width: auto; }
.embed-month { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 6px; }
.embed-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.embed-event { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); background: #fff; }
a.embed-event:hover { border-color: var(--brand); background: var(--brand-50); text-decoration: none; }
.embed-event.is-full { opacity: .65; }
.embed-event strong { display: block; }
.embed-event small { display: block; color: var(--muted); }
.embed-desc { margin-top: 3px; }
.embed-cta { text-align: right; font-size: .82rem; color: var(--muted); white-space: nowrap; }
.embed-cta b { color: var(--brand-600); font-size: .9rem; }
.embed-empty { padding: 20px 0; }
.embed-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }
.join-event { display: flex; gap: 14px; align-items: flex-start; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; margin: 6px 0 12px; }
.join-event p { margin: 6px 0 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.request-row { flex-wrap: wrap; }
.request-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
@media (max-width: 520px) { .embed-cta { display: none; } }
.pill-aud-staffboard { background: #f3ecf9; color: #6b3fa0; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; color: var(--muted); font-size: .85rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* ---- Security / 2FA ---- */
.qr { display: inline-block; padding: 8px; background: #fff; border: 1px solid var(--border, #dfe5dd); border-radius: 10px; margin: 4px 0 8px; min-height: 40px; }
.qr img { display: block; image-rendering: pixelated; }
.backup-codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px 16px; }
.backup-codes code { font-size: 1rem; letter-spacing: .04em; }
.cf-turnstile { min-height: 65px; }

/* ---- Fold-out sections (details/summary) ---- */
details.fold { border: 1px solid var(--border, #dfe5dd); border-radius: 10px; padding: 0 14px; margin: 10px 0; background: var(--surface, #fff); }
details.fold > summary { cursor: pointer; font-weight: 600; padding: 12px 0; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s; opacity: .6; flex: none; margin-right: 4px; }
details.fold[open] > summary::after { transform: rotate(-135deg); }
details.fold > summary .summary-note { font-weight: 400; font-size: .85rem; color: var(--muted); margin-left: auto; }
details.fold[open] { padding-bottom: 14px; }
details.fold > .stack, details.fold > form { margin-top: 2px; }
@media print { details.fold { border: 0; } }
.btn-danger { background: #b42318; color: #fff; border-color: #b42318; }
.btn-danger:hover { background: #912018; }
details.fold.card { padding: 0 20px; margin-bottom: 12px; }
details.fold.card[open] { padding-bottom: 20px; }

/* ---- Neon CRM items ---- */
.cal-event.neon { background: #eef1f4; color: #33414d; border-left-color: #6b7a88; }
.lg-dot.neon { background: #6b7a88; }
.pill-neon { background: #eef1f4; color: #33414d; }
@media (max-width: 700px) { .cal-event.neon { background: #6b7a88; } }

/* ---- Charts (Board fundraising) ---- */
.viz-wrap { width: 100%; overflow-x: auto; }
svg.viz { width: 100%; min-width: 520px; height: auto; display: block; font-family: inherit; }
.viz-s1 { fill: #2a78d6; background: #2a78d6; }
.viz-s2 { fill: #eb6834; background: #eb6834; }
.viz-grid { stroke: #e6ebe7; stroke-width: 1; }
.viz-axis { stroke: #b9c4bd; stroke-width: 1; }
.viz-tick { fill: var(--muted); font-size: 11px; }
.viz-hit { fill: transparent; }
.viz-col:hover .viz-hit { fill: rgba(29, 43, 36, .04); }
.viz-col:hover path { filter: brightness(.92); }
.viz-legend { display: flex; gap: 16px; font-size: .84rem; color: var(--muted); margin: 0 0 6px; }
.viz-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bar.viz-bar { background: #2a78d6; }
.bar-row.wide { grid-template-columns: minmax(90px, 160px) 1fr 64px; }
.viz-split { margin-top: 18px; gap: 24px; }
.kpis .stat { padding: 14px 16px; }
.kpis .stat b { font-size: 1.4rem; }
.delta { display: block; font-size: .74rem; margin-top: 4px; color: var(--muted); }
.delta.up { color: #1e6b41; }
.delta.down { color: #9a3a2e; }
#fundraising h4 { margin: 18px 0 8px; font-size: .95rem; }
.viz-note { margin-top: 14px; }
.retention-line { margin: 0 0 8px; }
.retention-line b { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.retention-line .delta { display: block; }
.bar-track.lg { height: 18px; margin-bottom: 14px; }
.kpis.compact { margin-top: 4px; }
.bar-row.band { grid-template-columns: minmax(110px, 140px) 1fr 150px; }
.bar-row.band .bar-val small { font-weight: 400; }
.event-results .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inline-bar { display: grid; grid-template-columns: minmax(60px, 1fr) auto; gap: 8px; align-items: center; min-width: 160px; }
.inline-bar b { font-variant-numeric: tabular-nums; }
@media (min-width: 700px) { .stats.stats-3.compact { grid-template-columns: repeat(3, 1fr); } }

/* ---- Fundraising tabs ---- */
.fr-head { padding-bottom: 0; }
.fr-head h2 { margin: 0; font-size: 1.2rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fr-head h2 small { font-size: .8rem; font-weight: 600; }
.tabs { display: flex; gap: 4px; margin: 14px -20px 0; padding: 0 16px; border-top: 1px solid var(--border); overflow-x: auto; }
.tabs a { padding: 12px 14px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: #2a78d6; }
svg.viz { min-width: 0; }
svg.viz-narrow { display: none; }
@media (max-width: 640px) { svg.viz-wide { display: none; } svg.viz-narrow { display: block; } }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 10px; font-size: .86rem; margin-bottom: 3px; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hbar-val { font-weight: 600; font-variant-numeric: tabular-nums; margin-left: auto; text-align: right; }
.hbar-val small { white-space: nowrap; }
.hbar-val small { font-weight: 400; }
.hbar .bar-track { display: block; height: 10px; }
h4.sub { margin: 16px 0 8px; font-size: .88rem; color: var(--muted); font-weight: 600; }
.compact-table td, .compact-table th { padding: 6px 8px; }
.compact-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.compare-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.compare-list li { display: flex; flex-direction: column; font-size: .88rem; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.event-cards { display: flex; flex-direction: column; gap: 10px; }
details.event-card > summary span { display: flex; flex-direction: column; min-width: 0; }
details.event-card > summary span strong { overflow: hidden; text-overflow: ellipsis; }
details.event-card > summary b { margin-left: auto; font-variant-numeric: tabular-nums; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 12px; }
.mini-stats div { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.mini-stats b { display: block; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.mini-stats small { color: var(--muted); font-size: .76rem; }
.money-dl dd { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .kpis .stat b { font-size: 1.2rem; } }
.money-dl { grid-template-columns: 1fr auto; } .money-dl dd { text-align: right; }
@media (max-width: 699px) { .stats-3.compact .stat:nth-child(3):last-child { grid-column: span 2; } }
.bar[style*="width: 0%"] { min-width: 0; }
.viz-s3 { fill: #1baf7a; background: #1baf7a; }
.seg-bar { display: flex; gap: 2px; height: 22px; border-radius: 6px; overflow: hidden; background: var(--surface-2); margin: 6px 0 10px; }
.seg-bar span { display: block; height: 100%; min-width: 3px; }
.seg-legend { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .86rem; }
.seg-legend li { display: flex; align-items: center; gap: 6px; }
.seg-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.seg-legend b { font-variant-numeric: tabular-nums; }
.viz-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-line.viz-s1 { stroke: #2a78d6; } .viz-line.viz-s2 { stroke: #eb6834; }
.viz-dot { stroke: #fff; stroke-width: 2; }
circle.viz-hit { fill: transparent; }
circle.viz-hit:hover { fill: rgba(29, 43, 36, .06); }
.viz-line.gap { stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .6; }
.pace-pick { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 12px 0 4px; }
.pace-pick label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--muted); font-weight: 600; flex: 1 1 200px; min-width: 0; }
.pace-pick select { width: 100%; }

/* ---- News & Media (staff pages) ---- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.news-head { padding-bottom: 0; }
.news-head h2 { margin: 0; font-size: 1.2rem; display: flex; align-items: center; gap: 8px; }
.news-tabs a { display: inline-flex; align-items: center; gap: 6px; }
.news-tabs .icon { width: 16px; height: 16px; }
.news-filter { margin-bottom: 14px; gap: 10px; }
.news-filter .seg small { font-weight: 500; opacity: .7; margin-left: 2px; }
.empty-state { text-align: center; padding: 28px 12px; }
.news-rows { list-style: none; margin: 0; padding: 0; }
.news-rows li + li { border-top: 1px solid var(--border); }
.news-rows a { display: flex; align-items: center; gap: 14px; padding: 12px 4px; color: var(--text); }
.news-rows a:hover { text-decoration: none; background: var(--surface-2); }
.news-rows .grow { display: flex; flex-direction: column; min-width: 0; }
.news-rows strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-thumb { width: 72px; height: 48px; border-radius: 8px; overflow: hidden; background: var(--surface-2); flex: none; display: grid; place-items: center; color: var(--muted); }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; }
.drop { display: flex; align-items: center; gap: 14px; padding: 18px; border: 2px dashed var(--border); border-radius: 12px; cursor: pointer; position: relative; background: var(--surface-2); }
.drop:hover, .drop:focus-within { border-color: var(--brand); }
.drop > span { display: flex; flex-direction: column; }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop .icon { width: 28px; height: 28px; color: var(--brand); flex: none; }
.small-drop { padding: 12px; margin: 10px 0; }
.media-upload { margin-bottom: 8px; }
.media-grid { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.media-grid a, .media-grid button { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 0; border: 2px solid transparent; border-radius: 10px; background: none; cursor: pointer; color: var(--text); text-align: left; font: inherit; }
.media-grid a:hover, .media-grid button:hover { text-decoration: none; border-color: var(--border); }
.media-grid li.on a { border-color: var(--brand); }
.media-grid img, .media-file { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.media-file { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); }
.media-file.big { aspect-ratio: auto; padding: 30px; }
.media-name { font-size: .76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px 4px; }
.media-preview { width: 100%; border-radius: 10px; margin-bottom: 10px; background: var(--surface-2); }
.media-detail h3 { margin: 6px 0 2px; font-size: 1rem; }
.media-layout:not(.has-sel) { grid-template-columns: 1fr; }
.title-input { font-size: 1.5rem; font-weight: 700; border: 0; border-bottom: 2px solid var(--border); border-radius: 0; padding: 6px 2px 10px; margin-bottom: 14px; width: 100%; background: transparent; }
.title-input:focus { outline: none; border-bottom-color: var(--brand); }
.md-editor { margin-top: 12px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.md-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.seg button { padding: 5px 12px; border-radius: 7px; font-size: .84rem; font-weight: 600; color: var(--muted); background: none; border: 0; cursor: pointer; font: inherit; }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.md-tools { display: flex; flex-wrap: wrap; gap: 4px; }
.md-tools button { display: inline-flex; align-items: center; gap: 4px; min-width: 34px; height: 32px; padding: 0 9px; border: 1px solid var(--border); background: #fff; border-radius: 7px; cursor: pointer; font: inherit; font-size: .84rem; color: var(--text); }
.md-tools button:hover { border-color: var(--brand); color: var(--brand-600); }
.md-tools .icon { width: 15px; height: 15px; }
.md-editor textarea { border: 0; border-radius: 0; width: 100%; min-height: 380px; padding: 14px; font-size: 1rem; line-height: 1.6; resize: vertical; display: block; }
.md-editor textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--brand-50); }
.md-preview { padding: 16px 18px; min-height: 380px; }
.md-help { margin-top: 12px; }
.md-help code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.publish-box .publish-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.cover-box { border-radius: 10px; overflow: hidden; background: var(--surface-2); margin-bottom: 10px; }
.cover-box img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.cover-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; aspect-ratio: 16 / 10; color: var(--muted); }
.delete-post { margin: 4px 0 24px; }
.media-dialog { width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 40px); border: 0; border-radius: 14px; padding: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.media-dialog::backdrop { background: rgba(20, 30, 25, .45); }
.md-dialog-head { display: flex; align-items: center; justify-content: space-between; }
.md-dialog-head h3 { margin: 0; }
.media-grid.picker { max-height: 56vh; overflow: auto; }
.news-preview-frame { width: 100%; height: 640px; border: 1px solid var(--border); border-radius: 12px; background: #F4EFFD; display: block; }
.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type=color] { width: 48px; height: 36px; padding: 2px; border-radius: 8px; flex: none; }
.stack-tight { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
/* the editor's preview uses the same reading styles as the public post */
.news-prose { line-height: 1.7; }
.news-prose h2, .news-prose h3, .news-prose h4 { line-height: 1.25; margin: 1.3em 0 .5em; }
.news-prose img { max-width: 100%; height: auto; border-radius: 8px; }
.news-prose figure { margin: 1.2em 0; }
.news-prose figcaption { font-size: .86rem; color: var(--muted); text-align: center; margin-top: 6px; }
.news-prose blockquote { margin-left: 0; padding: 10px 16px; border-left: 4px solid var(--brand); background: var(--surface-2); border-radius: 0 8px 8px 0; font-style: italic; }
.news-video { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; }
.news-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 640px) { .title-input { font-size: 1.25rem; } .md-editor textarea, .md-preview { min-height: 280px; } }
.kind-switch { margin-bottom: 14px; }
.kind-switch label { padding: 6px 14px; border-radius: 7px; font-size: .88rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.kind-switch label.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.kind-switch input { position: absolute; opacity: 0; pointer-events: none; }
.kind-switch label:focus-within { outline: 2px solid var(--brand); }
.link-fields { margin-bottom: 14px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.article-image { display: flex; gap: 12px; align-items: center; margin: 4px 0 12px; }
.article-image img { width: 120px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; flex: none; background: var(--surface-2); }
.slider-preview { margin-top: 14px; border-radius: 12px; padding: 16px; background: #393540; }
.slider-preview.theme-light { background: #fff; border: 1px solid var(--border); }
.slider-preview.theme-lavender { background: #F4EFFD; }
.news-preview-frame.slider { height: 390px; border: 0; background: transparent; border-radius: 0; }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li + li { border-top: 1px solid var(--border); }
.cat-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; flex-wrap: wrap; }
.cat-row input { min-width: 160px; }
.cat-count { white-space: nowrap; min-width: 56px; }
.cat-picks { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 10px; }
.cat-picks[hidden] { display: none; }
/* placeholder samples on the settings page (the artwork styles live in news.css; repeated here for the preview) */
.ph-samples { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: -4px 0 6px; }
.ph-sample { display: block; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; }
.ph-sample img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 560px) { .ph-samples { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- Block editor (news posts) ---- */
.block-editor { margin-top: 14px; }
.be-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.be-blocks { display: flex; flex-direction: column; gap: 10px; }
.be-block { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px 12px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.be-block.focused { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.be-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.be-type { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.be-move { display: flex; gap: 4px; opacity: .55; transition: opacity .15s; }
.be-block:hover .be-move, .be-block.focused .be-move { opacity: 1; }
.be-move button, .be-ph-tools button { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border); background: #fff; cursor: pointer; font: inherit; font-size: .85rem; color: var(--text); display: grid; place-items: center; padding: 0; }
.be-move button:hover:not(:disabled) { border-color: var(--brand); }
.be-move button:disabled { opacity: .35; cursor: default; }
.be-move .del:hover { border-color: var(--danger); color: var(--danger); }
.be-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 8px; }
.be-inline, .be-seg { display: inline-flex; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.be-inline button, .be-seg button { min-width: 32px; height: 30px; padding: 0 10px; border: 0; border-right: 1px solid var(--border); background: none; cursor: pointer; font: inherit; font-size: .82rem; color: var(--text); display: inline-flex; align-items: center; gap: 4px; }
.be-inline button:last-child, .be-seg button:last-child { border-right: 0; }
.be-inline button:hover, .be-seg button:hover { background: var(--surface-2); }
.be-seg button.on { background: var(--brand-50); color: var(--brand-600); font-weight: 600; }
.al-icon { display: inline-flex; flex-direction: column; gap: 2px; width: 14px; }
.al-icon i { display: block; width: 100%; height: 2px; background: currentColor; border-radius: 2px; }
.al-icon i:nth-child(2) { width: 60%; }
.al-icon.al-center { align-items: center; } .al-icon.al-right { align-items: flex-end; }
.be-block textarea, .be-block input[type=text], .be-block input[type=url] { width: 100%; border: 0; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; font: inherit; line-height: 1.6; resize: none; overflow: hidden; }
.be-block textarea:focus, .be-block input:focus { outline: 2px solid var(--brand-50); background: #fff; box-shadow: inset 0 0 0 1px var(--brand); }
.be-text.large { font-size: 1.2rem; }
.be-block .al-center { text-align: center; } .be-block .al-right { text-align: right; }
.be-heading.lv2 { font-size: 1.4rem; font-weight: 700; } .be-heading.lv3 { font-size: 1.15rem; font-weight: 600; }
.be-quote { font-style: italic; font-size: 1.05rem; border-left: 4px solid var(--brand) !important; }
.be-cite { margin-top: 6px; }
.be-list.ul { background-image: none; }
.be-row { display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; }
.be-btn-preview { margin-top: 10px; }
.be-btn-preview .news-btn { pointer-events: none; }
.be-hr { border: 0; border-top: 2px dashed var(--border); margin: 8px 0; }
.be-photos { display: grid; gap: 10px; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); }
.be-photos.n1 { --cols: 2; } .be-photos.n2 { --cols: 3; } .be-photos.n3, .be-photos.n4 { --cols: 4; }
.be-photos figure { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.be-ph { position: relative; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.be-ph img { width: 100%; display: block; }
.be-photos.shape-wide .be-ph img { aspect-ratio: 4 / 3; object-fit: cover; }
.be-photos.shape-square .be-ph img { aspect-ratio: 1; object-fit: cover; }
.be-ph-tools { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.be-ph-tools button { background: rgba(255,255,255,.92); }
.be-cap { font-size: .85rem !important; padding: 6px 10px !important; }
.be-ph-add { min-height: 120px; border: 2px dashed var(--border); border-radius: 10px; background: none; cursor: pointer; color: var(--muted); font: inherit; font-size: .86rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px; }
.be-ph-add span { font-size: 1.6rem; line-height: 1; }
.be-ph-add:hover { border-color: var(--brand); color: var(--brand-600); }
.be-add { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; padding: 10px; border: 1px dashed var(--border); border-radius: 12px; background: var(--surface-2); }
.be-add-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-right: 4px; }
.be-add button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: #fff; cursor: pointer; font: inherit; font-size: .85rem; color: var(--text); }
.be-add button:hover { border-color: var(--brand); color: var(--brand-600); }
.be-add button b { font-size: .95rem; color: var(--brand); width: 14px; text-align: center; }
.be-add .icon { width: 15px; height: 15px; color: var(--brand); }
.md-preview { border: 1px solid var(--border); border-radius: 12px; }
@media (max-width: 640px) {
  .be-photos.n1 { --cols: 1; } .be-photos.n2, .be-photos.n3, .be-photos.n4 { --cols: 2; }
  .be-row { grid-template-columns: 1fr; }
  .be-add button { padding: 0 10px; }
}
