/* WISON Members — shared brand system for the member portal and admin console. */
:root {
  --green: #22772f;
  --green-mid: #2a8a3a;
  --moss: #1a4a24;
  --forest: #0d1f14;
  --night: #08140c;
  --gold: #c9a227;
  --gold-soft: #e8d48a;
  --cream: #f4efe4;
  --paper: #ebe4d4;
  --ink: #142018;
  --muted: #5d6a5f;
  --line: rgba(20, 32, 24, .1);
  --line-gold: rgba(201, 162, 39, .3);
  --white: #fff;
  --danger: #b3261e;
  --danger-bg: #fbe9e7;
  --warning: #8a5a00;
  --warning-bg: #fdf3d7;
  --info: #1d5c8f;
  --info-bg: #e5f0f8;
  --success: #1c6b2a;
  --success-bg: #e3f2e1;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(13, 31, 20, .05), 0 12px 32px -18px rgba(13, 31, 20, .28);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --sidebar: 272px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  font-family: Outfit, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  overflow-x: hidden;
}
/* Admin shell: keep page scroll on the main pane so mouse-wheel works reliably. */
html:has(body.admin-body-root),
body.admin-body-root {
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
}
/* Fallback when :has() is unavailable */
body.admin-body-root {
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
}
body.nav-open { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--moss); }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, .serif {
  font-family: Fraunces, Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -.02em;
}
h1 { font-size: clamp(30px, 4.6vw, 46px); }
h2 { font-size: clamp(22px, 3vw, 28px); }
h3 { font-size: 20px; }
h4 { font-size: 17px; }
p + p { margin-top: .75em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .92em; letter-spacing: 0; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--gold);
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; }
.wrap { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.stack > * + * { margin-top: 20px; }
.stack-sm > * + * { margin-top: 10px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.list-plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.list-plain li { display: flex; flex-direction: column; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.list-plain li:last-child { border-bottom: 0; padding-bottom: 0; }

.staff-portals { margin-top: 8px; }
.staff-portal-card {
  display: flex; flex-direction: column; gap: 8px; min-height: 148px;
  padding: 24px; text-decoration: none; color: inherit;
  transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
}
.staff-portal-card h2 { margin: 0; font-size: 1.25rem; color: var(--ink); }
.staff-portal-card p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.staff-portal-roles { margin-top: auto; color: var(--green); font-weight: 600; }
.staff-portal-card:hover, .staff-portal-card:focus-visible {
  transform: translateY(-2px); border-color: rgba(34, 119, 47, .28);
  box-shadow: 0 12px 28px -18px rgba(13, 31, 20, .35); color: inherit;
}
.split { display: grid; gap: 24px; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }
@media (min-width: 981px) { .sticky-aside { position: sticky; top: 100px; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border-radius: 999px; border: 0;
  font-weight: 600; font-size: 15px; letter-spacing: .03em; line-height: 1.2;
  cursor: pointer; text-align: center;
  transition: transform .3s var(--ease), background .25s, color .25s, box-shadow .25s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--moss); color: #fff; }
.btn-gold { background: var(--gold); color: var(--night); }
.btn-gold:hover { background: var(--gold-soft); color: var(--night); }
.btn-dark { background: var(--forest); color: var(--cream); }
.btn-dark:hover { background: var(--night); color: var(--gold-soft); }
.btn-outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(20, 32, 24, .22); }
.btn-outline:hover { color: var(--green); box-shadow: inset 0 0 0 1.5px var(--green); }
.btn-ghost { background: transparent; color: var(--cream); box-shadow: inset 0 0 0 1px rgba(244, 239, 228, .45); }
.btn-ghost:hover { color: var(--gold-soft); box-shadow: inset 0 0 0 1px var(--gold-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8c1d17; color: #fff; }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 13.5px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--green); font-weight: 600; cursor: pointer; }
.link-btn:hover { color: var(--moss); text-decoration: underline; }
.link-danger { color: var(--danger); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .02em; line-height: 1.4; white-space: nowrap;
  background: var(--paper); color: var(--muted);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: #ecebe6; color: #6b6f6a; }
.badge-gold { background: rgba(201, 162, 39, .16); color: #7a5f0b; }
.badge-plain::before { display: none; }

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  min-width: 0;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush .card-head { padding: 22px 24px 0; }
.card-tint { background: linear-gradient(160deg, #fbf8f1, #f2ecdd); }
.card-dark { background: var(--forest); color: var(--cream); border-color: transparent; }
.card-dark .muted { color: rgba(244, 239, 228, .7); }
.card-gold { border-color: var(--line-gold); background: linear-gradient(160deg, #fffdf6, #f8f0d8); }
.divider { height: 1px; background: var(--line); margin: 22px 0; border: 0; }

/* ---------- Stats ---------- */
.stat {
  position: relative; overflow: hidden;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow); min-width: 0;
}
.stat::after {
  content: ""; position: absolute; right: -24px; top: -24px; width: 88px; height: 88px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 162, 39, .16), transparent 70%);
}
.stat-label { font-size: 12.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.stat-value { font-family: Fraunces, Georgia, serif; font-size: clamp(26px, 3.2vw, 34px); line-height: 1.1; margin-top: 8px; color: var(--ink); word-break: break-word; }
.stat-note { font-size: 13px; color: var(--muted); margin-top: 6px; }
.stat-green { background: var(--green); color: #fff; border-color: transparent; }
.stat-green .stat-label, .stat-green .stat-note { color: rgba(255, 255, 255, .78); }
.stat-green .stat-value { color: #fff; }
a.stat { display: block; color: inherit; transition: transform .3s var(--ease), box-shadow .3s; }
a.stat:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -20px rgba(13, 31, 20, .4); }

/* ---------- Alerts ---------- */
.alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-size: 15px;
}
.alert svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: rgba(28, 107, 42, .18); }
.alert-danger { background: var(--danger-bg); color: var(--danger); border-color: rgba(179, 38, 30, .18); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: rgba(138, 90, 0, .18); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: rgba(29, 92, 143, .16); }
.alert ul { list-style: disc; padding-left: 18px; }
.alert strong { display: block; }
.alert .row-between { flex: 1; gap: 14px; }
.flash-stack { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 96px; outline: none; }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 18px 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .label { font-size: 14px; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 13px; color: var(--muted); }
.field .error { font-size: 13px; color: var(--danger); font-weight: 500; }
.req { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; min-height: 50px; padding: 12px 16px;
  background: #fffdf9; border: 1.5px solid rgba(20, 32, 24, .16); border-radius: 14px;
  font-size: 16px; transition: border-color .2s, box-shadow .2s, background .2s;
  appearance: none;
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.select {
  padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2322772f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.input:hover, .select:hover, .textarea:hover { border-color: rgba(20, 32, 24, .3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--green); background: #fff; box-shadow: 0 0 0 4px rgba(34, 119, 47, .14); }
.has-error .input, .has-error .select, .has-error .textarea { border-color: var(--danger); }
.input[type="file"] { padding: 10px 12px; cursor: pointer; }
.input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 8px 16px; border: 0; border-radius: 999px;
  background: var(--forest); color: var(--cream); font-weight: 600; cursor: pointer;
}
.input-group { position: relative; }
.input-group .input { padding-right: 52px; }
.input-group .reveal-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer;
  display: grid; place-items: center;
}
.input-group .reveal-btn:hover { background: var(--paper); color: var(--green); }
.input-group .reveal-btn svg { width: 20px; height: 20px; }
.check { display: flex; align-items: flex-start; gap: 12px; font-size: 15px; cursor: pointer; line-height: 1.5; }
.check input {
  appearance: none; flex-shrink: 0; width: 22px; height: 22px; margin-top: 1px;
  border: 1.5px solid rgba(20, 32, 24, .3); border-radius: 7px; background: #fff; cursor: pointer;
  display: grid; place-items: center; transition: background .2s, border-color .2s;
}
.check input::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); opacity: 0; }
.check input:checked { background: var(--green); border-color: var(--green); }
.check input:checked::after { opacity: 1; }
.check input[type="radio"] { border-radius: 50%; }
.check input[type="radio"]::after { width: 10px; height: 10px; border: 0; border-radius: 50%; background: #fff; transform: none; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.switch input { appearance: none; flex-shrink: 0; width: 50px; height: 28px; border-radius: 999px; background: #cfd3cc; position: relative; cursor: pointer; transition: background .25s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .25s var(--ease); }
.switch input:checked { background: var(--green); }
.switch input:checked::after { transform: translateX(22px); }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
fieldset { border: 0; min-width: 0; }
legend { font-family: Fraunces, Georgia, serif; font-size: 20px; margin-bottom: 14px; }

/* Category picker */
.choice-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-body {
  height: 100%; display: flex; flex-direction: column; gap: 8px;
  padding: 20px; border-radius: 18px; background: #fffdf9;
  border: 1.5px solid rgba(20, 32, 24, .14);
  transition: border-color .2s, box-shadow .2s, transform .25s var(--ease);
}
.choice:hover .choice-body { border-color: rgba(34, 119, 47, .5); }
.choice input:checked + .choice-body { border-color: var(--green); box-shadow: 0 0 0 4px rgba(34, 119, 47, .14); background: #fff; }
.choice input:focus-visible + .choice-body { outline: 3px solid var(--gold); outline-offset: 2px; }
.choice-title { font-family: Fraunces, Georgia, serif; font-size: 19px; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.choice-price { font-family: Outfit, sans-serif; font-weight: 600; color: var(--green); font-size: 17px; white-space: nowrap; }
.choice-desc { font-size: 14px; color: var(--muted); }
.choice-tag { font-size: 12.5px; color: var(--warning); font-weight: 600; }
.choice-check {
  position: absolute; top: 14px; right: 14px; width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid rgba(20, 32, 24, .2); background: #fff; display: grid; place-items: center; transition: .2s;
}
.choice input:checked ~ .choice-check { background: var(--green); border-color: var(--green); }
.choice input:checked ~ .choice-check::after { content: ""; width: 6px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.choice-body .choice-title { padding-right: 30px; }

/* ---------- Tables ---------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
  cursor: grab;
}
.table-wrap.is-dragging,
.table-wrap.is-dragging * { cursor: grabbing !important; user-select: none; }
.admin-main .table-wrap {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--admin-accent, var(--green)) 55%, transparent) transparent;
}
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  padding: 14px 18px; background: #faf7f0; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 15px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: #fcfaf5; }
.table .cell-main { font-weight: 600; color: var(--ink); }
.table .cell-sub { font-size: 13px; color: var(--muted); }
.table a.cell-main:hover { color: var(--green); }
.table-actions { text-align: right; white-space: nowrap; }
.table-compact td, .table-compact th { padding: 11px 14px; }

/* ---------- Definition lists ---------- */
.dl { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 0; }
.dl dt, .dl dd { padding: 11px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.dl dt { color: var(--muted); padding-right: 16px; }
.dl dd { font-weight: 500; word-break: break-word; }
.dl dt:last-of-type, .dl dd:last-of-type { border-bottom: 0; }

/* ---------- Invoice lines ---------- */
.lines { width: 100%; border-collapse: collapse; }
.lines td { padding: 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.lines td:first-child { padding-right: 12px; word-break: break-word; }
.lines td:last-child { text-align: right; font-weight: 600; white-space: nowrap; padding-left: 16px; }
.lines tr.total td { border-bottom: 0; padding-top: 16px; font-size: 19px; font-family: Fraunces, Georgia, serif; }
.lines tr.total td:last-child { color: var(--green); }

/* ---------- Filters / chips ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters .input, .filters .select { min-height: 44px; width: auto; flex: 1 1 180px; font-size: 15px; padding-top: 9px; padding-bottom: 9px; }
.filters .btn { min-height: 44px; }
.chips {
  display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; padding-bottom: 6px;
  overscroll-behavior-x: contain; overscroll-behavior-y: auto;
  scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--admin-accent, var(--green)) 55%, transparent) transparent;
}
/* Prefer vertical page scroll over trapping the wheel on chip/table strips. */
.admin-main .chips,
.admin-main .table-wrap {
  overscroll-behavior-y: auto;
}
.chips::-webkit-scrollbar { height: 6px; }
.chips::-webkit-scrollbar-track { background: transparent; }
.chips::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--admin-accent, var(--green)) 55%, transparent);
  border-radius: 999px;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 500;
  background: var(--white); color: var(--ink); border: 1px solid var(--line); white-space: nowrap;
}
.chip:hover { border-color: var(--green); color: var(--green); }
.chip.active { background: var(--forest); color: var(--cream); border-color: var(--forest); }
.chip .count { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--paper); color: var(--muted); }
.chip.active .count { background: rgba(244, 239, 228, .16); color: var(--gold-soft); }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--paper); }
.timeline li { position: relative; padding-bottom: 18px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -26px; top: 5px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--white); border: 3px solid var(--gold);
}
.timeline li.done::before { border-color: var(--green); background: var(--green); }
.timeline li.current::before { border-color: var(--green); box-shadow: 0 0 0 5px rgba(34, 119, 47, .15); }
.timeline .t-title { font-weight: 600; }
.timeline .t-meta { font-size: 13px; color: var(--muted); }
.timeline .t-body { font-size: 14.5px; margin-top: 4px; }

/* ---------- Progress steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; counter-reset: step; }
.step { position: relative; text-align: center; font-size: 13px; color: var(--muted); padding-top: 42px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--white); border: 2px solid var(--paper); font-weight: 600; color: var(--muted); z-index: 1;
}
.step::after { content: ""; position: absolute; top: 16px; left: calc(-50% + 20px); right: calc(50% + 20px); height: 2px; background: var(--paper); }
.step:first-child::after { display: none; }
.step.done { color: var(--ink); }
.step.done::before { content: "✓"; background: var(--green); border-color: var(--green); color: #fff; }
.step.done::after, .step.current::after { background: var(--green); }
.step.current { color: var(--ink); font-weight: 600; }
.step.current::before { border-color: var(--green); color: var(--green); box-shadow: 0 0 0 5px rgba(34, 119, 47, .14); }

/* ---------- Membership card ---------- */
.member-card {
  position: relative; overflow: hidden; isolation: isolate;
  box-sizing: border-box;
  aspect-ratio: 1.6 / 1; width: 100%; max-width: min(460px, 100%);
  border-radius: 24px; padding: clamp(16px, 4vw, 28px);
  color: var(--cream);
  background:
    radial-gradient(circle at 100% 0%, rgba(201, 162, 39, .35), transparent 45%),
    radial-gradient(circle at 0% 100%, rgba(42, 138, 58, .55), transparent 55%),
    linear-gradient(140deg, var(--moss), var(--forest) 60%, var(--night));
  box-shadow: 0 30px 60px -30px rgba(8, 20, 12, .65);
  display: flex; flex-direction: column; justify-content: space-between;
  min-width: 0;
}
.member-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .14;
  background: url("../images/hero-lion.webp") center / cover; mix-blend-mode: luminosity;
}
.member-card::after { content: ""; position: absolute; inset: 10px; border-radius: 18px; border: 1px solid rgba(232, 212, 138, .28); pointer-events: none; }
.mc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.mc-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; letter-spacing: .08em; font-size: 12px; min-width: 0; }
.mc-brand img { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--gold); object-fit: cover; flex: none; }
.mc-name { font-family: Fraunces, Georgia, serif; font-size: clamp(18px, 5vw, 28px); line-height: 1.15; overflow-wrap: anywhere; }
.mc-number {
  font-family: ui-monospace, Consolas, monospace;
  letter-spacing: .06em; color: var(--gold-soft);
  font-size: clamp(12px, 3.2vw, 16px); margin-top: 6px;
  overflow-wrap: anywhere; word-break: break-word;
}
.mc-foot {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  min-width: 0;
}
.mc-foot > span { min-width: 0; flex: 1; }
.mc-foot strong {
  display: block; font-size: clamp(12px, 3.4vw, 14px);
  letter-spacing: .02em; text-transform: none; color: #fff; font-weight: 600;
  overflow-wrap: anywhere;
}
.member-card.is-inactive { filter: grayscale(.85); }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty-icon {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center; background: var(--paper); color: var(--green);
}
.empty-icon svg { width: 28px; height: 28px; }
.empty h3 { color: var(--ink); margin-bottom: 6px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-top: 1px solid var(--line); font-size: 14px; }
.pagination .pages { display: flex; gap: 6px; flex-wrap: wrap; }
.pagination a, .pagination span.page {
  min-width: 38px; height: 38px; padding: 0 12px; border-radius: 999px;
  display: inline-grid; place-items: center; font-weight: 600; color: var(--ink); border: 1px solid var(--line); background: var(--white);
}
.pagination a:hover { border-color: var(--green); color: var(--green); }
.pagination .current { background: var(--forest); color: var(--cream); border-color: var(--forest); }
.pagination .disabled { opacity: .4; }

/* ---------- Collapsible action panels ---------- */
.action-panel { border: 1px solid var(--line); border-radius: 16px; background: #fffdf9; }
.action-panel + .action-panel { margin-top: 12px; }
.action-panel summary {
  list-style: none; cursor: pointer; padding: 16px 18px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.action-panel summary::-webkit-details-marker { display: none; }
.action-panel summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--green); transition: transform .25s; }
.action-panel[open] summary::after { transform: rotate(45deg); }
.action-panel .panel-body { padding: 0 18px 18px; }
.action-panel.tone-danger summary { color: var(--danger); }
.action-panel.tone-danger summary::after { color: var(--danger); }

/* ---------- Files ---------- */
.file-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.file-list li:last-child { border-bottom: 0; }
.file-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--paper); color: var(--green); flex-shrink: 0; }
.file-icon svg { width: 20px; height: 20px; }
.file-meta { min-width: 0; flex: 1; }
.file-meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* ---------- Avatar ---------- */
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 600; font-size: 14px; letter-spacing: .04em;
  background: linear-gradient(140deg, var(--gold), #a9861a); color: var(--night);
  overflow: hidden;
}
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-photo { background: var(--paper); padding: 0; }
.avatar-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person-text { min-width: 0; }
.person-text strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =========================================================
   Guest / auth shell
   ========================================================= */
.auth {
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.auth-visual {
  position: relative; overflow: hidden; color: var(--cream);
  background: var(--forest) url("../images/hero-lion.webp") center / cover;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px clamp(28px, 4vw, 56px);
}
.auth-visual.elephant { background-image: url("../images/institute-elephant.webp"); }
.auth-visual::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8, 20, 12, .55) 0%, rgba(8, 20, 12, .2) 40%, rgba(8, 20, 12, .92) 100%);
}
.auth-visual > * { position: relative; }
.auth-visual h1 { font-size: clamp(34px, 4.4vw, 58px); max-width: 13ch; margin: 18px 0 14px; color: #fff; }
.auth-visual p { max-width: 42ch; color: rgba(244, 239, 228, .85); font-size: 17px; }
.auth-points { display: grid; gap: 10px; margin-top: 24px; }
.auth-points li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: rgba(244, 239, 228, .9); }
.auth-points svg { width: 20px; height: 20px; color: var(--gold); flex-shrink: 0; margin-top: 2px; }
.auth-visual-also { margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(244, 239, 228, .16); color: rgba(244, 239, 228, .7); }
.auth-steps { display: flex; gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; }
.auth-steps li { display: flex; flex: 1 1 0; align-items: center; gap: 8px; padding-top: 10px; border-top: 3px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 500; }
.auth-steps li span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(20, 32, 24, .06); font-size: 12px; font-weight: 700; }
.auth-steps li.is-current { border-color: var(--green); color: var(--ink); }
.auth-steps li.is-current span { background: var(--green); color: #fff; }
.auth-steps li.is-done { border-color: var(--green); color: var(--ink); }
.auth-steps li.is-done span { background: var(--gold); color: var(--ink); }
.auth-main { display: flex; flex-direction: column; padding: 32px clamp(20px, 5vw, 72px); }
.auth-main-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }
.auth-form { width: 100%; max-width: 460px; margin: auto; padding: 40px 0; }
.auth-form h2 { font-size: clamp(28px, 3.4vw, 38px); margin-bottom: 8px; }
.auth-form .lead { color: var(--muted); margin-bottom: 28px; }
.auth-form.wide { max-width: 640px; }
.auth-back-mobile { display: none; }
.auth-foot { font-size: 13px; color: var(--muted); text-align: center; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; }
.brand:hover { color: inherit; }
.brand img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); }
.brand-text { font-weight: 600; letter-spacing: .04em; line-height: 1.2; }
.brand-text small { display: block; font-size: 10.5px; font-weight: 400; letter-spacing: .2em; text-transform: uppercase; opacity: .75; margin-top: 2px; }
.or { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; margin: 6px 0; }
.or::before, .or::after { content: ""; height: 1px; flex: 1; background: var(--line); }

/* =========================================================
   Member portal shell
   ========================================================= */
.portal-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(13, 31, 20, .97); color: var(--cream);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(201, 162, 39, .2);
}
.portal-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; }
.portal-nav { display: flex; align-items: center; gap: 4px; }
.portal-nav a {
  color: rgba(244, 239, 228, .78); font-size: 14px; font-weight: 500; letter-spacing: .04em;
  padding: 9px 16px; border-radius: 999px; transition: background .2s, color .2s;
}
.portal-nav a:hover { color: #fff; background: rgba(244, 239, 228, .08); }
.portal-nav a.active { color: var(--night); background: var(--gold); }
.portal-user { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.user-menu { position: relative; }
.user-menu summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 4px 6px 4px 4px; border-radius: 999px; transition: background .2s;
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: rgba(244, 239, 228, .08); }
.portal-header .user-menu .avatar {
  width: 36px; height: 36px; border: 2px solid rgba(201, 162, 39, .85);
  box-shadow: 0 0 0 2px rgba(244, 239, 228, .12);
}
.user-menu .caret { width: 16px; height: 16px; opacity: .7; }
.user-menu-name { font-size: 14px; font-weight: 500; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 70;
  min-width: 240px; padding: 8px; border-radius: 18px;
  background: var(--white); color: var(--ink); border: 1px solid var(--line);
  box-shadow: 0 24px 48px -20px rgba(8, 20, 12, .45);
}
.menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head strong { display: block; }
.menu-head span { font-size: 13px; color: var(--muted); word-break: break-all; }
.menu a, .menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: 12px; border: 0; background: none; text-align: left;
  color: var(--ink); font-size: 15px; cursor: pointer;
}
.menu a:hover, .menu button:hover { background: var(--cream); color: var(--green); }
.menu svg { width: 18px; height: 18px; color: var(--muted); }
.nav-toggle {
  display: none; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(244, 239, 228, .08); color: var(--cream); place-items: center;
}
.nav-toggle svg { width: 22px; height: 22px; }
.portal-hero {
  position: relative; overflow: hidden; color: var(--cream);
  background: linear-gradient(120deg, rgba(8, 20, 12, .94), rgba(13, 31, 20, .82)), url("../images/hero-lion.webp") center 35% / cover;
  padding: 44px 0 92px;
}
.portal-hero h1 { color: #fff; margin-top: 10px; }
.portal-hero p { color: rgba(244, 239, 228, .78); max-width: 60ch; margin-top: 10px; }
.portal-main { position: relative; margin-top: -56px; padding-bottom: 72px; }
.portal-main.plain { margin-top: 32px; }
.portal-footer { background: var(--night); color: rgba(197, 210, 200, .8); padding: 28px 0; font-size: 14px; }
.portal-footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.portal-footer a { color: var(--gold-soft); }
.portal-bottom { display: none; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: rgba(244, 239, 228, .75); font-weight: 500; }
.back-link:hover { color: var(--gold-soft); }
.back-link svg { width: 16px; height: 16px; }

/* =========================================================
   Admin console shell — section accents stay clear and distinct
   WISON = gold, Community = green, Journal = blue
   ========================================================= */
.admin {
  --admin-accent: var(--gold);
  --admin-accent-soft: var(--gold-soft);
  --admin-accent-ink: #6b5310;
  --admin-surface: #f3efe6;
  --admin-panel: #fffdf8;
  display: flex;
  height: 100%;
  max-height: 100dvh;
  min-height: 0;
  background: var(--admin-surface);
  overflow: hidden;
}
.admin[data-section="community"] {
  --admin-accent: #2a8a3a;
  --admin-accent-soft: #9fd4a8;
  --admin-accent-ink: #145220;
  --admin-surface: #eef5ef;
  --admin-panel: #f7fbf7;
}
.admin[data-section="journal"] {
  --admin-accent: #1d5c8f;
  --admin-accent-soft: #9ec5e8;
  --admin-accent-ink: #0f3a5c;
  --admin-surface: #eef3f7;
  --admin-panel: #f7fafc;
}
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 90; width: var(--sidebar);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--forest), var(--night));
  color: rgba(244, 239, 228, .82);
  border-right: 1px solid color-mix(in srgb, var(--admin-accent) 28%, transparent);
  transition: transform .35s var(--ease);
}
.admin[data-section="community"] .sidebar {
  background: linear-gradient(180deg, #0f2416, #08140c);
}
.admin[data-section="journal"] .sidebar {
  background: linear-gradient(180deg, #0e1c28, #081018);
}
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 22px 20px 12px; border-bottom: 0; }
.sidebar-brand .brand { color: var(--cream); min-width: 0; }
.sidebar-brand .brand img { width: 42px; height: 42px; }
.sidebar-section-badge {
  margin: 0 16px 14px; padding: 7px 12px; border-radius: 999px; font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; text-align: center;
  border: 1px solid color-mix(in srgb, var(--admin-accent) 45%, transparent);
  color: var(--admin-accent-soft); background: color-mix(in srgb, var(--admin-accent) 16%, transparent);
}
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.section-switch-btn,
.section-switcher summary.section-switch-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1.5px solid color-mix(in srgb, var(--admin-accent) 45%, var(--line));
  background: var(--white); color: var(--admin-accent-ink); font-size: 14px; font-weight: 700;
  letter-spacing: .01em; text-decoration: none; cursor: pointer; list-style: none;
  box-shadow: 0 1px 2px rgba(13, 31, 20, .06); white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.section-switcher summary.section-switch-btn::-webkit-details-marker { display: none; }
.section-switch-btn:hover,
.section-switcher summary.section-switch-btn:hover {
  background: color-mix(in srgb, var(--admin-accent) 10%, var(--white));
  border-color: var(--admin-accent); color: var(--admin-accent-ink);
}
.section-switch-btn:focus-visible,
.section-switcher summary.section-switch-btn:focus-visible {
  outline: 3px solid var(--admin-accent); outline-offset: 2px;
}
.section-switch-btn svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--admin-accent); }
.section-switch-btn .caret { width: 16px; height: 16px; opacity: .75; color: inherit; }
.section-switch-label { display: inline-flex; align-items: center; line-height: 1.2; }
.section-switch-label-short { display: none; }
.section-switcher { position: relative; }
.section-switcher .menu {
  min-width: min(280px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
}
.section-switcher .menu a.active { color: var(--admin-accent-ink); font-weight: 700; background: color-mix(in srgb, var(--admin-accent) 12%, transparent); }
.section-switch-link { position: relative; }
.section-switch-link[data-section="wison"] svg { color: #c9a227; }
.section-switch-link[data-section="community"] svg { color: #2a8a3a; }
.section-switch-link[data-section="journal"] svg { color: #1d5c8f; }
.section-switch-current {
  margin-left: auto; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--admin-accent-ink); background: color-mix(in srgb, var(--admin-accent) 16%, transparent);
  padding: 3px 8px; border-radius: 999px;
}
.section-switch-chooser {
  margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px !important;
  font-weight: 600; color: var(--admin-accent-ink) !important;
}
.sidebar-close { display: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(244, 239, 228, .08); color: var(--cream); cursor: pointer; place-items: center; flex-shrink: 0; }
.sidebar-close svg { width: 20px; height: 20px; }
.sidebar-nav {
  flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 12px 24px; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--admin-accent, var(--gold)) 45%, transparent) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 8px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--admin-accent, var(--gold)) 45%, transparent);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--admin-accent, var(--gold)) 70%, transparent);
  background-clip: padding-box;
}
.table-wrap {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--admin-accent, var(--green)) 40%, transparent) transparent;
}
.table-wrap::-webkit-scrollbar { height: 8px; width: 8px; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }
.table-wrap::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--admin-accent, var(--green)) 40%, transparent);
  border-radius: 999px;
}
.admin-main, .admin-body > main {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--admin-accent, var(--green)) 35%, transparent) transparent;
}
.admin-main::-webkit-scrollbar,
.admin-body > main::-webkit-scrollbar { width: 10px; }
.admin-main::-webkit-scrollbar-track,
.admin-body > main::-webkit-scrollbar-track { background: transparent; }
.admin-main::-webkit-scrollbar-thumb,
.admin-body > main::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--admin-accent, var(--green)) 40%, transparent);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.nav-label {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: rgba(232, 212, 138, .65);
  padding: 16px 12px 8px; border: 0; background: transparent; cursor: pointer; text-align: left; font-family: inherit;
}
.nav-label:first-child { padding-top: 4px; }
.nav-label:hover { color: var(--admin-accent-soft); }
.nav-label .nav-fold-caret { width: 14px; height: 14px; opacity: .7; transition: transform .15s; flex-shrink: 0; }
.nav-label[aria-expanded="false"] .nav-fold-caret { transform: rotate(-90deg); }
.sidebar-nav .side-link.is-nav-hidden { display: none; }
.side-link {
  display: flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 10px 14px; border-radius: 12px; margin-bottom: 2px;
  color: rgba(244, 239, 228, .78); font-size: 15px; font-weight: 500;
  transition: background .2s, color .2s;
}
.side-link svg { width: 20px; height: 20px; flex-shrink: 0; opacity: .8; }
.side-link:hover { background: rgba(244, 239, 228, .07); color: #fff; }
.side-link.active {
  background: color-mix(in srgb, var(--admin-accent) 18%, transparent);
  color: var(--admin-accent-soft);
  box-shadow: inset 3px 0 0 var(--admin-accent);
}
.side-link.active svg { opacity: 1; color: var(--admin-accent); }
.side-link .pill {
  margin-left: auto; font-size: 12px; font-weight: 600; min-width: 24px; padding: 1px 8px;
  border-radius: 999px; background: var(--admin-accent); color: var(--night); text-align: center;
}
.sidebar-foot {
  display: grid; gap: 8px; padding: 14px 16px 20px;
  border-top: 1px solid color-mix(in srgb, var(--admin-accent) 18%, transparent); font-size: 13px;
}
.sidebar-foot-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px;
  padding: 8px 10px; border-radius: 10px; color: var(--admin-accent-soft); font-weight: 600;
}
.sidebar-foot-link:hover { background: rgba(244, 239, 228, .06); color: #fff; }
.admin-body {
  flex: 1; min-width: 0; min-height: 0; margin-left: var(--sidebar);
  display: flex; flex-direction: column; background: transparent; overflow: hidden;
}
.topbar {
  position: sticky; top: 0; z-index: 50; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 72px; padding: 12px clamp(14px, 3vw, 36px);
  background: color-mix(in srgb, var(--admin-panel) 92%, transparent); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.topbar-copy { min-width: 0; }
.topbar-title .crumb { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb-section { color: var(--admin-accent-ink); font-weight: 600; }
.topbar-title strong {
  display: block; font-family: Fraunces, Georgia, serif; font-weight: 500; font-size: clamp(17px, 2.4vw, 20px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar .nav-toggle {
  display: none; width: 44px; height: 44px; flex-shrink: 0;
  background: var(--white); color: var(--ink); border: 1px solid var(--line); border-radius: 12px;
}
.topbar .user-menu summary:hover { background: rgba(20, 32, 24, .05); }
.admin-main {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  padding: clamp(16px, 3vw, 36px);
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}
.topbar .avatar-photo {
  width: 40px;
  height: 40px;
  background: var(--white);
  border: 1px solid var(--line);
}
.topbar .avatar-photo img {
  object-fit: contain;
  padding: 4px;
}
.admin-main > * + * { margin-top: 24px; }
.admin .card, .admin .stat { background: var(--admin-panel); }
.admin .eyebrow { color: var(--admin-accent-ink); }
.admin .btn-green { background: var(--admin-accent-ink); }
.admin .btn-green:hover { filter: brightness(1.08); }
.admin .stat-green {
  background: var(--admin-panel);
  color: inherit;
  border-color: color-mix(in srgb, var(--admin-accent) 35%, var(--line));
}
.admin .stat-green .stat-label,
.admin .stat-green .stat-note { color: var(--muted); }
.admin .stat-green .stat-value { color: var(--admin-accent-ink); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(28px, 3.6vw, 38px); }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 70ch; }
.page-head .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.card-flush .filters { background: color-mix(in srgb, var(--admin-panel, var(--white)) 88%, var(--paper)); }
@media (max-width: 980px) {
  .post-admin-item .row { width: 100%; justify-content: flex-start !important; }
  .sticky-aside { position: static; }
}
.backdrop { display: none; position: fixed; inset: 0; z-index: 85; background: rgba(8, 20, 12, .55); backdrop-filter: blur(2px); }
.queue-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 24px; border-top: 1px solid var(--line); color: inherit; }
.queue-item:hover { background: #fcfaf5; color: inherit; }
.queue-item .right { text-align: right; flex-shrink: 0; }
.activity li { display: flex; gap: 12px; padding: 12px 24px; border-top: 1px solid var(--line); font-size: 14.5px; }
.activity .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); margin-top: 8px; flex-shrink: 0; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { font-weight: 600; text-align: right; }
.secret-field { display: flex; gap: 10px; align-items: center; }
.copy-field { display: flex; gap: 8px; align-items: stretch; }
.copy-field code { flex: 1; min-width: 0; padding: 12px 14px; border-radius: 12px; background: var(--paper); font-size: 13.5px; overflow-x: auto; white-space: nowrap; }
.inline-form { display: inline; }

/* =========================================================
   Blog (public)
   ========================================================= */
.blog-hero { padding-bottom: 40px; }
.blog-hero .chips { margin-top: 22px; }
.blog-hero .chip { background: rgba(255, 255, 255, .08); border-color: rgba(244, 239, 228, .22); color: var(--cream); }
.blog-hero .chip:hover { border-color: var(--gold); color: var(--gold-soft); }
.blog-hero .chip.active { background: var(--gold); border-color: var(--gold); color: var(--night); }
.blog-list { display: grid; gap: 20px; }
.blog-row {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 0;
  background: var(--white); border: 1px solid var(--line); border-radius: 24px; overflow: hidden;
  box-shadow: var(--shadow); color: inherit;
  transition: transform .35s var(--ease), box-shadow .35s;
}
.blog-row:hover { transform: translateY(-3px); box-shadow: 0 24px 48px -26px rgba(13, 31, 20, .45); color: inherit; }
.blog-row-media { position: relative; min-height: 260px; background: var(--forest); overflow: hidden; }
.blog-row-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.blog-row:hover .blog-row-media img { transform: scale(1.04); }
.blog-row-placeholder { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(140deg, var(--moss), var(--night)); }
.blog-row-placeholder img { position: static; width: 84px; height: 84px; border-radius: 50%; border: 2px solid var(--gold); }
.blog-row-copy { display: flex; flex-direction: column; gap: 10px; padding: clamp(22px, 3vw, 36px); }
.blog-row-copy h2 { font-size: clamp(22px, 2.6vw, 30px); }
.blog-row-copy p { color: var(--muted); }
.blog-meta { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.go { margin-top: auto; padding-top: 6px; font-weight: 600; color: var(--green); }

.article-hero {
  position: relative; color: var(--cream); padding: clamp(40px, 7vw, 88px) 0 clamp(48px, 7vw, 80px);
  background: linear-gradient(180deg, rgba(8, 20, 12, .82), rgba(8, 20, 12, .94)), var(--cover, url("../images/hero-lion.webp")) center / cover;
}
.article-wrap { max-width: 780px; }
.article-hero .eyebrow { display: flex; }
.article-hero h1 { color: #fff; font-size: clamp(32px, 5.4vw, 56px); margin-top: 12px; }
.article-lead { font-size: clamp(17px, 2vw, 20px); color: rgba(244, 239, 228, .85); margin-top: 16px; }
.article-byline { display: flex; align-items: center; gap: 12px; margin-top: 26px; font-size: 14px; }
.article-byline img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--gold); }
.article-byline strong { display: block; color: #fff; }
.article-byline span span { color: rgba(244, 239, 228, .7); }
.article-body { padding: 44px 0 64px; font-size: 18px; line-height: 1.75; }
.article-body > * + * { margin-top: 1.1em; }
.article-body h2 { font-size: clamp(24px, 3vw, 30px); margin-top: 1.6em; }
.article-body ul { list-style: none; display: grid; gap: 8px; }
.article-body li { position: relative; padding-left: 26px; }
.article-body li::before { content: ""; position: absolute; left: 4px; top: .7em; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
.article-cover { margin: -84px 0 36px; position: relative; }
.article-cover img { width: 100%; border-radius: 22px; box-shadow: 0 30px 60px -30px rgba(8, 20, 12, .6); aspect-ratio: 16 / 9; object-fit: cover; }
.article-share { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 24px; border-top: 1px solid var(--line); margin-top: 40px !important; }
.related { background: var(--paper); padding: 56px 0 72px; }
.related-card { display: flex; flex-direction: column; gap: 8px; background: var(--white); border-radius: 20px; overflow: hidden; color: inherit; box-shadow: var(--shadow); padding-bottom: 20px; }
.related-card img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.related-card .blog-meta, .related-card strong { padding: 0 20px; }
.related-card .blog-meta { margin-top: 12px; }
.related-card strong { font-family: Fraunces, Georgia, serif; font-weight: 500; font-size: 19px; line-height: 1.25; }
.related-card:hover { color: var(--green); }
.preview-bar {
  position: sticky; top: 76px; z-index: 40; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap;
  padding: 10px 16px; background: var(--gold); color: var(--night); font-size: 14px; font-weight: 600;
}
.preview-bar a { color: var(--night); text-decoration: underline; }

/* Blog (admin) */
.post-admin-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.post-admin-row:last-child { border-bottom: 0; }
.post-admin-item { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 0; padding: 14px 12px 14px 20px; color: inherit; }
.post-admin-item:hover { background: #fcfaf5; color: inherit; }
.post-admin-actions { display: flex; align-items: center; padding: 14px 20px 14px 8px; }
.post-admin-delete { color: var(--danger); border-color: rgba(176, 45, 30, .28); }
.post-admin-delete:hover { background: rgba(176, 45, 30, .08); color: var(--danger); }
.post-admin-thumb { width: 92px; height: 64px; border-radius: 12px; overflow: hidden; flex-shrink: 0; background: var(--paper); display: grid; place-items: center; color: var(--green); }
.post-admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-admin-thumb svg { width: 24px; height: 24px; }
.post-admin-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.post-admin-body > strong { font-family: Fraunces, Georgia, serif; font-weight: 500; font-size: 18px; line-height: 1.25; }
.editor { font-size: 16px; line-height: 1.7; min-height: 380px; }
.cover-preview { display: grid; gap: 10px; }
.cover-preview img { width: 100%; max-height: 300px; object-fit: cover; border-radius: 16px; border: 1px solid var(--line); }

/* Community moderation (admin) */
.mod-list { list-style: none; margin: 0; padding: 0; }
.mod-row { display: flex; align-items: center; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.mod-row:last-child { border-bottom: 0; }
.mod-thumb { width: 72px; height: 56px; border-radius: 12px; overflow: hidden; flex-shrink: 0; background: var(--paper); display: grid; place-items: center; color: var(--green); }
.mod-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mod-thumb svg { width: 22px; height: 22px; }
.mod-row-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.mod-row-text { margin: 0; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.mod-row-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.mod-row-actions form { margin: 0; }
.mod-pop { position: relative; }
.mod-pop > summary { list-style: none; cursor: pointer; }
.mod-pop > summary::-webkit-details-marker { display: none; }
.mod-pop-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: min(300px, 86vw); padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 48px rgba(15, 33, 20, .16); }
.mod-item { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fcfaf5; }
.mod-body { font-size: 15.5px; line-height: 1.65; overflow-wrap: anywhere; }
.mod-body p { margin: 0 0 10px; }
.mod-body p:last-child { margin-bottom: 0; }
.mod-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.mod-media a { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--paper); }
.mod-media img { width: 100%; height: 100%; object-fit: cover; }
.mod-media .badge { position: absolute; left: 8px; bottom: 8px; }

@media (max-width: 720px) {
  .blog-row { grid-template-columns: 1fr; border-radius: 20px; }
  .blog-row-media { min-height: 0; aspect-ratio: 16 / 10; }
  .blog-row-copy { padding: 20px; }
  .article-body { font-size: 17px; padding-top: 28px; }
  .article-cover { margin: -56px 0 24px; }
  .preview-bar { top: 66px; }
  .post-admin-row { flex-wrap: wrap; }
  .post-admin-item { display: grid; grid-template-columns: 72px minmax(0, 1fr); padding: 14px 16px; gap: 6px 12px; align-items: start; }
  .post-admin-thumb { width: 72px; height: 54px; grid-row: span 2; }
  .post-admin-item .badge { grid-column: 2; justify-self: start; }
  .post-admin-actions { width: 100%; padding: 0 16px 14px; justify-content: flex-end; }
  .mod-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; padding: 14px 16px; gap: 10px 12px; }
  .mod-thumb { width: 56px; height: 48px; }
  .mod-row-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .mod-pop-panel { left: 0; right: auto; }
}

/* =========================================================
   Receipt (also print)
   ========================================================= */
.receipt { max-width: 760px; margin: 0 auto; }
.receipt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; padding-bottom: 22px; border-bottom: 2px solid var(--gold); margin-bottom: 22px; }
.receipt-stamp {
  display: inline-block; padding: 8px 18px; border: 2px solid var(--green); color: var(--green); border-radius: 12px;
  font-weight: 700; letter-spacing: .2em; text-transform: uppercase; font-size: 14px; transform: rotate(-4deg);
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid-3 { grid-template-columns: 1fr; }

  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-visual,
  .auth-visual.elephant { min-height: 0; padding: 14px 20px; background-image: none; }
  .auth-visual::before { display: none; }
  .auth-visual .auth-visual-copy,
  .auth-visual .auth-visual-foot { display: none; }
  .auth-main { padding: 8px 20px 28px; }
  .auth-main-top { display: none; }
  .auth-back-mobile { display: inline-flex !important; }
  .auth-form { padding: 28px 0 32px; }
  .auth-steps { flex-wrap: wrap; }
  .auth-steps li { flex: 1 1 calc(50% - 8px); min-width: 120px; }

  .nav-toggle { display: grid; }
  .portal-nav {
    position: fixed; inset: 0; z-index: 120;
    flex-direction: column; align-items: stretch; gap: 4px;
    width: 100%; height: 100dvh; max-height: 100dvh;
    padding: max(18px, env(safe-area-inset-top)) 20px max(22px, env(safe-area-inset-bottom));
    overflow-y: auto; overscroll-behavior: contain;
    background: var(--forest);
    border-bottom: 0;
    box-shadow: none;
    /* Closed menu sits just above the viewport: anything parked off the right edge
       becomes sideways-pannable on iOS even with overflow-x: hidden. */
    transform: translateY(-12px); opacity: 0; visibility: hidden;
    transition: transform .3s var(--ease), opacity .3s var(--ease), visibility 0s linear .3s;
  }
  .portal-nav a { padding: 14px 16px; font-size: 16px; border-radius: 14px; }
  body.nav-open .portal-nav { transform: none; opacity: 1; visibility: visible; transition: transform .3s var(--ease), opacity .3s var(--ease); }
  body.nav-open .portal-header .user-menu,
  body.nav-open .portal-header .brand { visibility: hidden; pointer-events: none; }
  body.nav-open .nav-toggle {
    position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 130;
    visibility: visible; pointer-events: auto;
  }
  .user-menu-name { display: none; }
  .portal-header .user-menu .caret { display: none; }

  /* Membership bottom navigation */
  body.has-portal-bottom .nav-toggle { display: none; }
  body.has-portal-bottom .portal-nav { display: none; }
  body.has-portal-bottom .portal-bottom {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; align-items: stretch;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding: 0 4px env(safe-area-inset-bottom, 0px);
    background: rgba(13, 31, 20, .97);
    backdrop-filter: blur(14px);
    border-top: 1px solid rgba(201, 162, 39, .22);
    box-shadow: 0 -12px 28px -18px rgba(8, 20, 12, .55);
  }
  body.has-portal-bottom .portal-bottom a {
    position: relative; display: grid; justify-items: center; align-content: center; gap: 3px;
    min-width: 0; padding: 8px 2px; color: rgba(244, 239, 228, .72);
    font-size: 11px; font-weight: 600; letter-spacing: .02em; text-align: center;
  }
  body.has-portal-bottom .portal-bottom a span {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  body.has-portal-bottom .portal-bottom a svg { width: 22px; height: 22px; }
  body.has-portal-bottom .portal-bottom a.active { color: var(--gold-soft); }
  body.has-portal-bottom .portal-bottom a.active::before {
    content: ""; position: absolute; top: 0; width: 28px; height: 3px;
    border-radius: 0 0 3px 3px; background: var(--gold);
  }
  body.has-portal-bottom .portal-main,
  body.has-portal-bottom .portal-footer {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
  body.has-portal-bottom .portal-footer { padding-top: 24px; }

  .admin .topbar .nav-toggle { display: grid; place-items: center; }
  .sidebar {
    transform: translateX(-105%); visibility: hidden;
    width: min(100vw, 320px); max-width: 100%; z-index: 120;
    transition: transform .25s ease, visibility .25s;
    padding-top: env(safe-area-inset-top, 0);
  }
  .sidebar-close { display: grid; }
  body.nav-open .sidebar { transform: none; visibility: visible; box-shadow: 16px 0 40px rgba(0, 0, 0, .35); }
  body.nav-open .backdrop {
    display: block; z-index: 110;
    background: rgba(8, 20, 12, .72); backdrop-filter: blur(2px);
  }
  .backdrop[hidden] { display: none !important; }
  body.nav-open .backdrop[hidden] { display: block !important; }
  body.nav-open .topbar { visibility: hidden; pointer-events: none; }
  .admin-body { margin-left: 0; }
  /* Keep Switch section text visible; only hide the account name on small screens. */
  .topbar .account-menu .user-menu-name { display: none; }
  .topbar .account-menu .caret { display: none; }
  .section-switch-btn,
  .section-switcher summary.section-switch-btn {
    min-height: 44px; padding: 0 12px; font-size: 13.5px;
  }
  .admin .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .wrap { width: calc(100% - 28px); }
  .grid-2, .grid-3, .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .staff-portal-card { min-height: 0; padding: 20px; }
  .staff-portal-card h2 { font-size: 1.15rem; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .choice-grid { grid-template-columns: 1fr; }
  .card { padding: 18px; border-radius: 18px; }
  .card-flush { padding: 0; }
  .card-flush .card-head { padding: 18px 18px 0; }
  .stat { padding: 16px; }
  .stat-label { font-size: 11px; letter-spacing: .08em; }
  .stat-value { font-size: 24px; }
  .portal-header .wrap { min-height: 66px; gap: 12px; }
  .portal-nav { inset: 0; }
  .brand img { width: 42px; height: 42px; }
  .brand-text small { display: none; }
  .portal-hero { padding: 28px 0 76px; }
  .portal-hero h1 { font-size: clamp(26px, 8vw, 34px); }
  .portal-hero p { font-size: 15px; }
  .portal-main { margin-top: -52px; }
  .portal-main.plain { margin-top: 22px; }
  .portal-footer .wrap { flex-direction: column; align-items: flex-start; gap: 8px; }
  .alert { flex-wrap: wrap; }
  .alert .row-between { width: 100%; flex-direction: column; align-items: stretch; gap: 12px; }
  .alert .row-between .btn { width: 100%; justify-content: center; }
  .row-between { align-items: stretch; }
  .service-head { gap: 12px; }
  .service-icon { width: 40px; height: 40px; }
  .kv { gap: 8px; }
  .kv span:last-child { text-align: right; word-break: break-word; }
  .file-list li { align-items: flex-start; }
  .file-list .badge { margin-top: 2px; }
  .admin-main { padding: 16px 12px max(40px, env(safe-area-inset-bottom)); }
  .topbar { padding: 10px 12px; min-height: 60px; gap: 8px; }
  .topbar-title { gap: 8px; }
  .topbar-title strong { font-size: 17px; }
  .topbar-title .crumb { font-size: 12px; }
  .topbar-actions { gap: 6px; }
  .section-switch-btn,
  .section-switcher summary.section-switch-btn {
    min-height: 42px; padding: 0 10px; gap: 6px; border-radius: 10px;
  }
  .section-switch-label-full { display: none; }
  .section-switch-label-short { display: inline; }
  .section-switcher .menu { right: 0; left: auto; }
  .page-head { align-items: stretch; }
  .page-head h1 { font-size: clamp(24px, 7vw, 32px); }
  .page-head .row { width: 100%; }
  .page-head .row .btn { flex: 1 1 auto; min-width: 0; justify-content: center; }
  .admin .grid-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .admin .stat { padding: 14px; }
  .admin .stat-value { font-size: 22px; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .btn { width: 100%; justify-content: center; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters .input, .filters .select, .filters .btn { flex: 1 1 100%; width: 100%; }
  .dl { grid-template-columns: 1fr; }
  .dl dt { padding-bottom: 0; border-bottom: 0; font-size: 13px; }
  .dl dd { padding-top: 2px; }
  .steps { gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .steps .step { font-size: 11.5px; flex: 0 0 auto; }
  .queue-item, .activity li { padding-left: 18px; padding-right: 18px; }
  .copy-field { flex-direction: column; align-items: stretch; }
  .menu { right: -8px; min-width: min(260px, calc(100vw - 24px)); }

  /* Tables become stacked cards */
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: 14px 18px; border-bottom: 1px solid var(--line); }
  .table-stack tbody tr:last-child { border-bottom: 0; }
  .table-stack td { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 6px 0; border: 0; text-align: right; }
  .table-stack td::before { content: attr(data-label); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: left; flex-shrink: 0; }
  .table-stack td.cell-primary { display: block; text-align: left; padding-bottom: 8px; }
  .table-stack td.cell-primary::before { display: none; }
  .table-stack td.table-actions { justify-content: flex-end; padding-top: 10px; }
  .table-stack td.table-actions::before { display: none; }
  .table-stack td:empty { display: none; }
  .pagination { justify-content: center; }

  /* iOS Safari zooms the page when a focused field's text is under 16px. */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea,
  .input, .select, .textarea, .filters .input, .filters .select { font-size: 16px; }
  .portal-footer a { display: inline-block; padding: 6px 0; }
  .back-link { min-height: 36px; display: inline-flex; align-items: center; }
}

@media (max-width: 420px) {
  .wrap { width: calc(100% - 24px); }
  .grid-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value { font-size: 21px; }
  .btn { padding: 0 16px; min-height: 44px; }
  .btn-sm { min-height: 38px; }
  .mc-foot { font-size: 10.5px; }
  /* Keep bottom-nav labels readable — icons-only was too cryptic on phones. */
  body.has-portal-bottom .portal-bottom a {
    padding: 8px 2px;
    font-size: 10px;
    letter-spacing: 0;
  }
  body.has-portal-bottom .portal-bottom a span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.has-portal-bottom .portal-bottom a svg { width: 20px; height: 20px; }
  .portal-footer { font-size: 13px; padding: 22px 0; }
  .portal-footer .wrap { gap: 6px; }
  .portal-header .brand-text { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .portal-header, .portal-footer, .portal-hero, .portal-bottom, .no-print, .sidebar, .topbar { display: none !important; }
  body { background: #fff; }
  .portal-main { margin: 0; padding: 0; }
  .card { box-shadow: none; border: 0; }
}

/* Member dashboard: journal and community service cards */
.service-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start; /* each card keeps its own height on desktop */
}
.service-card { display: flex; flex-direction: column; min-width: 0; height: auto; align-self: start; }
.service-card > .form-actions { margin-top: 16px; padding-top: 0; }
.service-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 12px; }
.service-head > div { flex: 1; min-width: 0; }
.service-head h3 { margin-top: 6px; }
.stat-sub { margin-top: 4px; color: var(--muted); font-size: 13px; font-weight: 600; }
.service-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.service-meta .eyebrow { white-space: nowrap; }
.service-icon { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: rgba(34, 119, 47, .1); color: var(--green); }
.service-icon svg { width: 22px; height: 22px; }
.service-request {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.service-request .form-actions {
  margin-top: 2px;
  padding-top: 0;
  position: static;
}
.service-request .textarea { min-height: 96px; }
@media (max-width: 1100px) { .service-grid { grid-template-columns: 1fr; } }

/* Member dashboard: keep everything inside the phone screen */
.dashboard-card-mobile { display: none; min-width: 0; max-width: 100%; }
.dashboard-card-desktop { min-width: 0; max-width: 100%; }
.dashboard-split,
.dashboard-main,
.dashboard-aside,
.dashboard-card-mobile,
.dashboard-card-desktop {
  min-width: 0;
  max-width: 100%;
}
.portal-main,
.portal-main > .wrap {
  max-width: 100%;
  overflow-x: clip;
}
.service-card,
.service-card p,
.service-request {
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .dashboard-split {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
  }
  .dashboard-card-mobile { display: block; width: 100%; }
  .dashboard-card-desktop { display: none; }
  .dashboard-main,
  .dashboard-aside {
    width: 100%;
  }
  .portal-main > .wrap,
  .portal-hero > .wrap,
  .portal-header > .wrap {
    width: min(100% - 24px, 1180px);
    max-width: 100%;
    box-sizing: border-box;
  }
  .portal-header .wrap {
    gap: 10px;
  }
  .portal-user .user-menu-name,
  .portal-user .caret {
    display: none;
  }
  .portal-user .avatar,
  .portal-user .avatar-photo {
    width: 36px;
    height: 36px;
    flex: none;
  }
  .member-card {
    max-width: 100%;
    width: 100%;
    aspect-ratio: auto;
    min-height: 0;
    height: auto;
    overflow: hidden;
    padding: 16px;
  }
  .mc-brand img { width: 32px; height: 32px; }
  .mc-top .badge {
    flex: none;
    font-size: 12px;
    padding-inline: 8px;
  }
  .mc-number { letter-spacing: .04em; }
  .mc-foot {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    align-items: end;
  }
  .mc-foot > span:last-child { text-align: right; }
  .service-grid { width: 100%; }
  .service-card > .form-actions,
  .service-request .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .service-card > .form-actions .btn,
  .service-request .form-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .kv {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .kv > span:last-child {
    text-align: left;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
  }
  .file-meta strong {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    overflow-wrap: anywhere;
  }
  .file-list li {
    flex-wrap: wrap;
    gap: 8px;
  }
}

@media (max-width: 380px) {
  .mc-foot {
    grid-template-columns: minmax(0, 1fr);
  }
  .mc-foot > span:last-child { text-align: left; }
}

/* Admin: website pages */
.site-pages-heading { font-size: 18px; display: flex; gap: 8px; align-items: baseline; }
.site-pages { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.site-page { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.site-page-thumb { position: relative; height: 170px; overflow: hidden; background: #ebe4d4; border-bottom: 1px solid var(--line); }
.site-page-thumb iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 850px; border: 0; transform: scale(.2); transform-origin: 0 0; pointer-events: none; }
.site-page-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.site-page-body h3 { font-size: 17px; }
.site-page-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 12px; }

/* Admin: very small phones and landscape */
@media (max-width: 360px) {
  .admin .grid-4 { grid-template-columns: 1fr; }
  .admin-main { padding-left: 10px; padding-right: 10px; }
  .sidebar { width: 100%; }
  .section-switch-btn,
  .section-switcher summary.section-switch-btn {
    min-width: 44px; padding: 0 10px; font-size: 13px;
  }
  .section-switch-btn .caret { display: none; }
  .page-head .row .btn { flex: 1 1 100%; }
}

@media (max-width: 980px) and (orientation: landscape) and (max-height: 500px) {
  .sidebar { width: min(100vw, 280px); }
  .sidebar-nav { padding-top: 6px; }
  .nav-label { padding-top: 10px; padding-bottom: 4px; }
  .side-link { min-height: 40px; padding-top: 8px; padding-bottom: 8px; }
  .topbar { min-height: 52px; }
  .admin-main { padding-top: 12px; }
}

@media (min-width: 981px) and (max-width: 1100px) {
  :root { --sidebar: 244px; }
  .side-link { font-size: 14px; gap: 10px; padding-inline: 12px; }
}

/* Admin: grant / change staff access */
.access-grant {
  padding: 28px 28px 24px;
  background:
    radial-gradient(circle at top right, rgba(201, 162, 39, .16), transparent 42%),
    linear-gradient(165deg, #fffef9 0%, var(--admin-panel, var(--white)) 48%, #f7f3ea 100%);
  border-color: color-mix(in srgb, var(--gold) 28%, var(--line));
}
.access-grant-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.access-grant-head h2 { margin-top: 6px; font-size: clamp(24px, 3vw, 30px); }
.access-grant-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.access-grant-steps span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--gold) 14%, var(--white));
  border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line));
  color: var(--moss);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .02em;
}
.access-email,
.access-identity {
  max-width: 520px;
  margin-bottom: 22px;
}
.access-identity {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .access-identity { grid-template-columns: 1fr 1fr; }
}
.access-desks {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}
.access-desk {
  margin: 0;
  padding: 16px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--white) 88%, var(--cream));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}
.access-desk-wison { border-top: 3px solid var(--green); }
.access-desk-community { border-top: 3px solid var(--info); }
.access-desk-journal { border-top: 3px solid var(--gold); }
.access-desk-legend {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  float: none;
  width: 100%;
  padding: 0;
}
.access-desk-legend strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.access-desk-legend .tiny { display: block; margin-top: 2px; line-height: 1.35; }
.access-desk-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--green) 12%, var(--white));
  color: var(--green);
}
.access-desk-community .access-desk-icon {
  background: color-mix(in srgb, var(--info) 12%, var(--white));
  color: var(--info);
}
.access-desk-journal .access-desk-icon {
  background: color-mix(in srgb, var(--gold) 18%, var(--white));
  color: #8a6a12;
}
.access-desk-icon svg { width: 18px; height: 18px; }
.role-pick-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}
.role-pick-grid-dense {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.role-pick {
  position: relative;
  display: block;
  margin: 0;
  cursor: pointer;
}
.role-pick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.role-pick-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 54px;
  padding: 10px 12px 10px 38px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--white);
  transition: border-color .2s, background .2s, box-shadow .2s, transform .2s var(--ease);
}
.role-pick-body::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 16px;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1.5px solid color-mix(in srgb, var(--ink) 22%, var(--line));
  background: var(--white);
}
.role-pick-body::after {
  content: "";
  position: absolute;
  left: 18px;
  top: 19px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
}
.role-pick-title {
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.3;
  color: var(--ink);
}
.role-pick-hint {
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}
.role-pick:hover .role-pick-body {
  border-color: color-mix(in srgb, var(--green) 35%, var(--line));
  transform: translateY(-1px);
}
.role-pick input:checked + .role-pick-body {
  border-color: color-mix(in srgb, var(--green) 55%, var(--line));
  background: color-mix(in srgb, var(--success-bg) 70%, var(--white));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 12%, transparent);
}
.role-pick input:checked + .role-pick-body::before {
  background: var(--green);
  border-color: var(--green);
}
.role-pick input:checked + .role-pick-body::after { opacity: 1; }
.role-pick-super .role-pick-body {
  background: linear-gradient(135deg, #fffdf4, #f8efd2);
  border-color: color-mix(in srgb, var(--gold) 40%, var(--line));
}
.role-pick-super input:checked + .role-pick-body {
  background: linear-gradient(135deg, #fff8df, #f3e4b8);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent);
}
.role-pick-super input:checked + .role-pick-body::before {
  background: #a88416;
  border-color: #a88416;
}
.access-grant-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
@media (max-width: 1180px) {
  .access-desks { grid-template-columns: 1fr; }
  .role-pick-grid-dense { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .access-grant { padding: 20px 16px; }
  .role-pick-grid-dense { grid-template-columns: 1fr; }
  .access-grant-actions { align-items: stretch; }
  .access-grant-actions .btn { width: 100%; }
}
