:root {
  --bg: #5b3a24;
  --on-bg: #f7ecdb;
  --on-bg-muted: #dcc6a6;
  --bar: #3a2113;
  --surface: #fffaf2;
  --surface-2: #f5eadb;
  --text: #2b1b10;
  --muted: #7d6551;
  --border: #e8d9c4;
  --primary: #e9a73a;
  --primary-ink: #2b1b10;
  --primary-soft: #fbe7c2;
  --chart: #7a4b2a;
  --accent: #a87a12;
  --danger: #b8382c;
  --ok: #2f7d32;
  --warn: #b45309;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(43, 27, 16, .10), 0 6px 18px rgba(43, 27, 16, .18);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #22150c;
    --on-bg: #f2e4cd;
    --on-bg-muted: #bba486;
    --bar: #160d07;
    --surface: #2e1f14;
    --surface-2: #3a291b;
    --text: #f3e9dc;
    --muted: #b8a48e;
    --border: #4b3726;
    --primary: #f0b24a;
    --primary-ink: #22150c;
    --primary-soft: #4a3519;
    --chart: #c99a5e;
    --accent: #e0b54a;
    --danger: #f06b60;
    --ok: #6fcf73;
    --warn: #fbbf24;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 18px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #22150c;
  --on-bg: #f2e4cd;
  --on-bg-muted: #bba486;
  --bar: #160d07;
  --surface: #2e1f14;
  --surface-2: #3a291b;
  --text: #f3e9dc;
  --muted: #b8a48e;
  --border: #4b3726;
  --primary: #f0b24a;
  --primary-ink: #22150c;
  --primary-soft: #4a3519;
  --chart: #c99a5e;
  --accent: #e0b54a;
  --danger: #f06b60;
  --ok: #6fcf73;
  --warn: #fbbf24;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 18px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
h1, h2 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; }
h2 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
h2.flush { margin: 0; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; font-weight: 400; }
.spacer { flex: 1; }
[hidden] { display: none !important; }

/* Buttons & inputs */
.btn {
  appearance: none; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; font-weight: 500;
  padding: 8px 14px; border-radius: 8px; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.primary.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
#confirmBody { margin: 6px 0 0; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .6; cursor: progress; }
.icon-btn {
  border: 0; background: transparent; color: var(--muted); font-size: 24px;
  line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field > span { font-size: 12px; font-weight: 500; color: var(--muted); }
.field .hint { font-size: 11px; color: var(--muted); }
.maiden { font-weight: 400; color: var(--muted); }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding-block: 16px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.login-card {
  width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px 28px; box-shadow: var(--shadow); text-align: center;
}
.login-card .field { text-align: left; margin-top: 20px; }
.login-card p { margin: 6px 0 0; }
.login-school { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px !important; }
.error { color: var(--danger); font-size: 13px; }
.crest {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px;
  display: grid; place-items: center; background: var(--primary); color: var(--primary-ink);
}
.login-logo { display: block; width: 110px; height: auto; margin: 0 auto 12px; }
.brand-logo { display: block; width: 40px; height: 40px; object-fit: contain; flex: none; }
.crest.small { width: 34px; height: 34px; margin: 0; border-radius: 9px; }

/* Layout */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; display: flex; align-items: center; gap: 16px;
  padding-block: 10px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); background: var(--bar); color: var(--on-bg); border-bottom: 2px solid var(--primary);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.brand .tiny { display: block; color: var(--on-bg-muted); }
.brand > div { min-width: 0; }
.tabs { display: flex; gap: 4px; margin: 0 auto; }
.tab {
  border: 0; background: transparent; font: inherit; font-weight: 500; color: var(--muted);
  padding: 8px 14px; border-radius: 8px; cursor: pointer;
}
.tab { color: var(--on-bg-muted); }
.tab:hover { color: var(--on-bg); background: rgba(255, 255, 255, .08); }
.tab.active { color: var(--primary-ink); background: var(--primary); }
.topbar .btn.ghost { color: var(--on-bg); }
.topbar .btn.ghost:hover { background: rgba(255, 255, 255, .08); }
main { max-width: 1200px; margin: 0 auto; padding-block: 24px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }

/* Dashboard */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.stat .label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); min-width: 0;
}
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 36px; align-items: center; gap: 10px; font-size: 13px; }
.bar-row .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--chart); border-radius: 99px; }
.bar-row .n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex; justify-content: space-between; gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.list li:last-child { border-bottom: 0; }
.list a { color: var(--text); font-weight: 500; text-decoration: none; cursor: pointer; }
.list a:hover { color: var(--primary); }
.empty-note { color: var(--muted); font-size: 13px; }

/* Alumni table */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar input[type=search] { max-width: 300px; }
.toolbar select { width: auto; }
.table-wrap {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow-x: auto; box-shadow: var(--shadow);
}
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th {
  font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2);
  cursor: pointer; user-select: none; white-space: nowrap;
}
.table th[data-sort]:hover { color: var(--text); }
.table th.sorted::after { content: " ↑"; }
.table th.sorted.desc::after { content: " ↓"; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .primary-line { font-weight: 600; }
.table .secondary-line { font-size: 12px; color: var(--muted); }
.pill {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.pill.ok { color: var(--ok); }
.pill.warn { color: var(--warn); }
.empty { text-align: center; color: var(--on-bg-muted); padding: 40px 0; }
.toolbar h2, #countLine { color: var(--on-bg); }
#countLine { opacity: .85; }

/* Events */
.event-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.event-card { display: flex; flex-direction: column; gap: 6px; }
.event-card h3 { margin: 0; font-size: 15px; }
.event-card .meta { font-size: 12px; color: var(--muted); }
.event-card .count { font-size: 24px; font-weight: 700; color: var(--primary); }
.event-card .actions { display: flex; gap: 8px; margin-top: 8px; }

/* Dialogs */
.dialog {
  border: 1px solid var(--border); border-radius: 16px; padding: 0; width: min(720px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.dialog.narrow { width: min(460px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(15, 18, 24, .5); }
.dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.dialog-head, .dialog-foot { display: flex; align-items: center; gap: 8px; padding: 14px 20px; }
.dialog-head { border-bottom: 1px solid var(--border); }
.dialog-head h2 { margin: 0; }
.dialog-head .icon-btn { margin-left: auto; }
.dialog-foot { border-top: 1px solid var(--border); }
.dialog-body { padding: 16px 20px; overflow-y: auto; }
fieldset { border: 0; padding: 0; margin: 0 0 8px; }
legend { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-grid.three { grid-template-columns: 1fr 2fr 1fr; }
.span-2 { grid-column: span 2; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.check-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 99px; cursor: pointer; color: var(--text);
}
.check-chip input { width: auto; margin: 0; }
.check-chip:has(input:checked) { background: var(--primary-soft); border-color: var(--primary); }
.attend-list { margin-top: 10px; max-height: 50vh; overflow-y: auto; }
.attend-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); cursor: pointer;
}
.attend-row input { width: auto; margin: 0; }
.attend-row .secondary-line { font-size: 12px; color: var(--muted); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px;
  font-weight: 500; box-shadow: var(--shadow); max-width: calc(100vw - 32px);
}
.toast.error { background: var(--danger); color: #fff; }

/* Small screens */
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .tabs { order: 3; width: 100%; margin: 0; }
  .tab { flex: 1; }
  .brand { flex: 1; }
  main { padding-block: 16px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat .value { font-size: 22px; }
  .grid-2 { grid-template-columns: 1fr; }
  .toolbar input[type=search] { max-width: none; }
  .toolbar select { flex: 1; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .table th:nth-child(3), .table td:nth-child(3),
  .table th:nth-child(4), .table td:nth-child(4),
  .table th:nth-child(5), .table td:nth-child(5),
  .table th:nth-child(6), .table td:nth-child(6) { display: none; }
}

/* Sign-in: alumni call to action */
.divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.alumni-cta {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  white-space: normal; line-height: 1.35; padding: 12px 14px; font-weight: 600;
  background: var(--bar); color: var(--on-bg); border: 2px solid var(--primary);
}
.alumni-cta:hover { background: var(--bg); }
.alumni-cta .arrow { color: var(--primary); font-size: 18px; transition: transform .15s; }
.alumni-cta:hover .arrow { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) { .alumni-cta .arrow { transition: none; } }
.link-btn { border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; padding: 4px; }
.link-btn:hover { color: var(--text); }

/* Public alumni sign-up */
.register {
  min-height: 100vh; display: flex; justify-content: center; align-items: flex-start;
  padding-block: 32px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.register-card {
  width: 100%; max-width: 640px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow); overflow: hidden;
}
.register-head {
  display: flex; align-items: center; gap: 16px; padding: 20px 24px;
  background: var(--bar); color: var(--on-bg); border-bottom: 3px solid var(--primary);
}
.register-head img { width: 72px; height: 72px; object-fit: contain; flex: none; }
.register-head .login-school { color: var(--primary); margin: 0 0 2px !important; }
.register-head h1 { color: var(--on-bg); }
.reg-step { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.reg-step > p { margin: 0; }
.reg-question { font-size: 20px; margin: 0; text-wrap: balance; }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.choice {
  display: flex; flex-direction: column; gap: 4px; text-align: left; font: inherit; color: var(--text);
  background: var(--surface); border: 2px solid var(--border); border-radius: 12px; padding: 18px; cursor: pointer;
}
.choice strong { font-size: 16px; }
.choice span { font-size: 13px; color: var(--muted); }
.choice:hover { border-color: var(--primary); background: var(--primary-soft); }
.choice:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
#regYes { border-color: var(--primary); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.consent input { width: auto; margin-top: 3px; }
.reg-actions { display: flex; justify-content: space-between; gap: 8px; }
.reg-step .btn { align-self: flex-start; }
.reg-actions .btn { align-self: auto; }
.register-foot { padding: 12px 24px; border-top: 1px solid var(--border); text-align: center; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Review banner */
.review-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--primary-soft); color: var(--text); border: 1px solid var(--primary);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px;
}
.pill.review { background: var(--primary-soft); color: var(--accent); }

@media (max-width: 560px) {
  .choice-row { grid-template-columns: 1fr; }
  .register { padding-block: 16px; }
  .register-head { padding: 16px; }
  .register-head img { width: 56px; height: 56px; }
  .reg-step { padding: 18px 16px; }
}

/* Sign-in panes */
.login-pane { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.login-pane .field { margin: 6px 0 0; }
.login-pane .divider { margin: 6px 0; }
.login-pane .link-btn { align-self: center; margin-top: 4px; }
.hint-box { font-size: 12px; background: var(--primary-soft); color: var(--text); border-radius: 8px; padding: 8px 10px; text-align: left; }

/* Alumni portal */
.portal-main { max-width: 960px; }
.welcome { color: var(--on-bg); padding: 8px 0 20px; }
.welcome h1 { font-size: clamp(24px, 4vw, 34px); text-wrap: balance; }
.welcome p { margin: 6px 0 0; color: var(--on-bg-muted); }
.welcome .eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--primary); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tile {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; row-gap: 2px;
  align-items: center; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--surface); border: 2px solid transparent; border-radius: 14px; padding: 20px; box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.tile:hover { border-color: var(--primary); transform: translateY(-2px); }
.tile:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.tile-icon {
  grid-row: span 2; width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center;
  background: var(--bar); color: var(--primary);
}
.tile strong { font-size: 17px; }
.tile-sub { font-size: 13px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back-btn {
  border: 0; background: none; font: inherit; font-weight: 600; color: var(--primary); cursor: pointer; padding: 4px 0; margin-bottom: 8px;
}
.back-btn:hover { text-decoration: underline; }
.p-title { color: var(--on-bg); font-size: 22px; margin-bottom: 16px; }
.feed { display: flex; flex-direction: column; gap: 12px; }
.feed-item {
  display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.feed-item > div:not(.date-chip) { min-width: 0; flex: 1; }
.feed-item h3 { margin: 0 0 4px; font-size: 16px; }
.feed-item .meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.feed-item .body { white-space: pre-line; margin: 0; }
.feed-item .actions { display: flex; gap: 8px; margin-top: 10px; }
.date-chip {
  flex: none; width: 58px; text-align: center; border-radius: 10px; overflow: hidden; align-self: flex-start;
  background: var(--surface-2); border: 1px solid var(--border);
}
.date-chip .m { display: block; background: var(--bar); color: var(--primary); font-size: 11px; font-weight: 700; letter-spacing: .08em; padding: 3px 0; text-transform: uppercase; }
.date-chip .d { display: block; font-size: 22px; font-weight: 700; padding: 2px 0 0; font-variant-numeric: tabular-nums; }
.date-chip .y { display: block; font-size: 11px; color: var(--muted); padding-bottom: 4px; }
.feed-empty { color: var(--on-bg-muted); text-align: center; padding: 32px 0; }
.profile-card { display: flex; flex-direction: column; gap: 12px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 6px; }
.facts div { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.facts dt { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } .tile:hover { transform: none; } }
@media (max-width: 560px) {
  .tiles { grid-template-columns: 1fr; }
  .tile { padding: 16px; }
}
@media (max-width: 760px) {
  .app .tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .app .tab { padding: 8px 4px; font-size: 13px; }
}
@media (max-width: 480px) {
  .app .tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.portal .topbar .spacer { display: none; }
.portal .brand { flex: 1; }

/* Welcome page action buttons */
.on-bg-note { color: var(--on-bg-muted); font-size: 13px; margin: 0 0 14px; max-width: 70ch; }
.on-bg-note strong { color: var(--on-bg); }
.icon-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-opt { position: relative; cursor: pointer; }
.icon-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.icon-opt span {
  width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted); border: 2px solid transparent;
}
.icon-opt input:checked + span { background: var(--bar); color: var(--primary); border-color: var(--primary); }
.icon-opt input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.action-row { align-items: center; }
.action-row .tile-icon { width: 44px; height: 44px; flex: none; }
.action-row .order { display: flex; flex-direction: column; gap: 4px; }
.action-row .order .btn { padding: 2px 10px; line-height: 1.2; }
.action-card .actions .btn { text-decoration: none; }
@media (max-width: 760px) {
  .app .tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .app .tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.tile-wide { grid-column: 1 / -1; background: var(--bar); color: var(--on-bg); border-color: var(--primary); }
.tile-wide .tile-icon { background: var(--primary); color: var(--primary-ink); }
.tile-wide .tile-sub { color: var(--on-bg-muted); }
.action-card .tile-icon { width: 48px; height: 48px; flex: none; }
.action-row > div.order { flex: none; }

/* Photos */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; object-fit: cover;
  display: inline-grid; place-items: center; overflow: hidden;
  background: var(--primary-soft); color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: .02em;
}
.avatar.lg { width: 84px; height: 84px; font-size: 26px; border: 3px solid var(--primary); }
.avatar.xl { width: 76px; height: 76px; font-size: 26px; border: 3px solid var(--primary); }
.photo-field { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.photo-actions { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.photo-label { font-size: 12px; font-weight: 500; color: var(--muted); }
.photo-label em { font-style: normal; opacity: .8; }
.photo-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-buttons label.btn { cursor: pointer; }
.photo-field .hint { font-size: 11px; color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.photo-buttons:focus-within label.btn { outline: 2px solid var(--primary); outline-offset: 2px; }
.name-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.welcome { display: flex; align-items: center; gap: 18px; }
.welcome #pAvatar:empty { display: none; }
.attend-row .avatar { width: 30px; height: 30px; font-size: 11px; }

/* Actions tab: Announcements / Upcoming / Past switcher */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin-bottom: 14px; background: var(--bar); border-radius: 10px; }
.seg { border: 0; background: transparent; color: var(--on-bg-muted); font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 8px; cursor: pointer; }
.seg:hover { color: var(--on-bg); }
.seg.active { background: var(--primary); color: var(--primary-ink); }
.seg-count { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: rgba(255, 255, 255, .12); margin-left: 4px; }
.seg.active .seg-count { background: rgba(0, 0, 0, .12); }
@media (max-width: 560px) { .segmented { display: flex; } .seg { flex: 1; padding: 8px 6px; font-size: 13px; } }

/* Achievements */
.opt { font-style: normal; font-weight: 400; opacity: .8; }
.consent + .form-grid, fieldset > .consent { margin-bottom: 12px; }
.star { color: var(--primary); font-size: 14px; cursor: help; }

/* Record status box (admin edit form) */
.status-box {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-radius: 10px; padding: 12px 14px; margin-bottom: 16px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.status-box p { margin: 2px 0 0; font-size: 12px; color: var(--muted); max-width: 46ch; }
.status-box .field { margin: 0; min-width: 190px; }
.status-box.review { background: var(--primary-soft); border-color: var(--primary); }
.status-box.review strong { color: var(--accent); }
.status-box.verified strong { color: var(--ok); }
.verify-btn { background: var(--ok); border-color: var(--ok); color: #fff; }
.pill.verified { color: var(--ok); }
@media (max-width: 560px) { .status-box .field { min-width: 0; width: 100%; } }
.form-section { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin: 6px 0 -4px; }
.reg-actions .muted.tiny { align-self: center; }

/* Active filters */
.toolbar .filter-on { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; background: var(--primary-soft); }
#countLine { color: var(--on-bg); }
.link-btn.inline { color: var(--primary); font-size: inherit; padding: 0; }
