/* =========================================================
   PCDA portals – member login, member dashboard, staff portal
   (loaded only on pages that call pcda_page_start with 'portal' => true)
   ========================================================= */

/* the hidden attribute must always win over display rules below (filtered rows, swatch groups, steps) */
.is-portal [hidden] { display: none !important; }

/* let modals (z 80) and the row menu sit above the sticky header: no stacking context on main in portals */
.is-portal main { z-index: auto; }

body.is-app { background: #F6F7FA; }
.portal-cta { gap: 10px; }
.portal-cta .btn { min-height: 44px; }
.hdr-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--text); text-decoration: none; padding: 10px 6px; }
.hdr-link:hover { color: var(--ink); }
.avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; background: var(--ink); color: var(--gold); text-transform: uppercase; }
.avatar-lg { width: 52px; height: 52px; font-size: 17px; }
@media (max-width: 640px) { .hide-sm { display: none !important; } }

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); }
.panel-pad { padding: clamp(20px, 3vw, 28px); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-title { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.panel-sub { font-size: 13px; color: var(--muted); font-weight: 600; }
.status-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.status-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-active { background: var(--green-soft); color: var(--green-ink); }
.st-pending { background: var(--yellow-soft); color: var(--yellow-ink); }
.st-revoked { background: var(--red-soft); color: var(--red-ink); }
.btn-chip { min-height: 40px; padding: 9px 16px; font-size: 14px; }
.btn-danger { background: var(--red-soft); color: var(--red-ink); }
.btn-danger:hover { color: var(--red-ink); background: #FBD9DD; }
.btn-success { background: var(--green-soft); color: var(--green-ink); }
.btn-success:hover { color: var(--green-ink); background: #D3EFE1; }

/* ---------- 6-digit code boxes ---------- */
.otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.otp input {
  width: 100%; height: 62px; min-width: 0; padding: 0; text-align: center; font-size: 26px; font-weight: 800; color: var(--ink);
  border: 1.5px solid #D9DEE7; border-radius: var(--radius-sm); background: var(--surface); transition: border-color .2s, box-shadow .2s, transform .2s;
}
.otp input:focus { outline: none; border-color: #C8963E; box-shadow: 0 0 0 4px rgba(224, 178, 94, .22); transform: translateY(-1px); }
.otp.is-error input { border-color: var(--red-ink); animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@media (max-width: 380px) { .otp { gap: 6px; } .otp input { height: 54px; font-size: 22px; } }

/* ---------- toggle switch ---------- */
.switch { position: relative; width: 52px; height: 30px; flex: none; border: 0; border-radius: 999px; background: #C9CFDA; cursor: pointer; transition: background .3s; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: left .3s var(--ease); }
.switch[aria-checked="true"] { background: var(--green-ink); }
.switch[aria-checked="true"]::after { left: 25px; }
.switch:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ---------- modals (centred on desktop, bottom sheet on phones) ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(15, 27, 51, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fadein .25s ease both; }
.modal[hidden] { display: none; }
.modal-panel { position: relative; width: 100%; max-width: 560px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border-radius: 28px; padding: clamp(24px, 4vw, 36px); box-shadow: 0 40px 80px rgba(0, 0, 0, .25); animation: popin .35s var(--ease) both; }
.modal-panel.sm { max-width: 440px; }
.modal-panel.lg { max-width: 720px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.modal-head h2 { font-size: 24px; letter-spacing: -.01em; }
.modal-head p { margin-top: 6px; color: var(--muted); font-size: 14px; }
.modal-x { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; background: var(--soft); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; margin: -6px -6px 0 0; }
.modal-x:hover { background: var(--line); }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.modal .stack { gap: 18px; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes popin { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes sheetin { from { transform: translateY(100%); } to { transform: none; } }
@media (max-width: 640px) {
  .modal { align-items: flex-end; padding: 0; }
  .modal-panel, .modal-panel.sm, .modal-panel.lg { max-width: none; border-radius: 24px 24px 0 0; max-height: 92vh; max-height: 92dvh; padding-bottom: max(24px, env(safe-area-inset-bottom)); animation: sheetin .4s var(--ease) both; }
  .modal-panel::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 5px; background: var(--line); margin: -8px auto 16px; }
  .modal-actions .btn { flex: 1 1 auto; }
}
html.modal-open { overflow: hidden; }

/* ---------- login screens (member + staff) ---------- */
.auth-main { min-height: calc(100vh - var(--header-h)); min-height: calc(100dvh - var(--header-h)); display: flex; align-items: center; justify-content: center; padding: clamp(24px, 5vw, 56px) 16px; }
.auth-shell { width: 100%; max-width: 1080px; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border-radius: 32px; overflow: hidden; box-shadow: 0 30px 70px rgba(19, 33, 60, .12); }
.auth-side { position: relative; overflow: hidden; background: var(--ink-deep); color: #fff; padding: clamp(32px, 4vw, 52px); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; min-height: 580px; }
.auth-side h1 { color: #fff; font-size: clamp(30px, 3.2vw, 38px); line-height: 1.12; }
.auth-side p { color: #C9D1DE; font-size: 16px; line-height: 1.65; max-width: 380px; }
.auth-side .orb { position: absolute; border-radius: 50%; pointer-events: none; animation: orb 9s ease-in-out infinite; }
@keyframes orb { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(8px, -12px); } }
.auth-cards { position: relative; height: 250px; }
.auth-cards .mcard-wrap { position: absolute; }
.auth-cards .back-card { left: 150px; top: 8px; width: 300px; opacity: .85; animation: float2 8s ease-in-out infinite; }
.auth-cards .front-card { left: 20px; top: 40px; width: 350px; animation: float1 7s ease-in-out infinite; }
@keyframes float1 { 0%, 100% { transform: rotate(-6deg) translateY(0); } 50% { transform: rotate(-4deg) translateY(-14px); } }
@keyframes float2 { 0%, 100% { transform: rotate(5deg) translateY(0); } 50% { transform: rotate(7deg) translateY(-10px); } }
.auth-form { padding: clamp(28px, 5vw, 56px); display: flex; flex-direction: column; justify-content: center; }
.auth-inner { width: 100%; max-width: 400px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.auth-bars { display: flex; gap: 6px; }
.auth-bars span { flex: 1; height: 5px; border-radius: 999px; background: var(--line-soft); transition: background .4s; }
.auth-bars span.on { background: var(--gold); }
.auth-step { display: flex; flex-direction: column; gap: 20px; }
.auth-step[hidden] { display: none; }
.auth-step.enter { animation: stepin .45s var(--ease) both; }
@keyframes stepin { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.auth-step h2 { font-size: clamp(26px, 3vw, 32px); letter-spacing: -.01em; }
.auth-step .sub { color: var(--muted); font-size: 16px; line-height: 1.6; margin-top: 8px; }
.auth-step .btn-block { width: 100%; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.link-btn { background: none; border: 0; padding: 10px 2px; min-height: 44px; font-weight: 600; font-size: 14px; color: var(--text); cursor: pointer; }
.link-btn:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 56px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; border-radius: 10px; }
.pw-toggle:hover { color: var(--ink); }
.pw-meter { height: 5px; border-radius: 5px; background: var(--line-soft); overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 0; background: var(--red); transition: width .3s var(--ease), background .3s; }
.email-pill { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 8px 14px; border-radius: 999px; background: var(--soft); font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; max-width: 560px; }
  .auth-side { min-height: 0; padding-bottom: 28px; }
  .auth-cards { height: 200px; }
  .auth-cards .front-card { width: 290px; left: 50%; margin-left: -170px; top: 26px; }
  .auth-cards .back-card { width: 250px; left: 50%; margin-left: -60px; top: 0; }
}
@media (max-width: 480px) {
  .auth-main { padding: 0; align-items: stretch; }
  .auth-shell { border-radius: 0; box-shadow: none; }
  .auth-side { padding: 28px 20px 24px; }
  .auth-cards { height: 170px; }
  .auth-cards .front-card { width: 250px; margin-left: -140px; }
  .auth-cards .back-card { width: 210px; margin-left: -40px; }
  .auth-form { padding: 28px 20px 40px; }
}

/* =========================================================
   MEMBER CARD (12 designs, faithful to the original plugin)
   Sizes use container units so the card scales perfectly.
   ========================================================= */
.mcard-wrap { container-type: inline-size; width: 100%; }
.mcard { position: relative; width: 100%; aspect-ratio: 7 / 4; border-radius: 4.2cqw; overflow: hidden; font-family: 'Montserrat', sans-serif; box-shadow: 0 2px 4px rgba(19, 33, 60, .08), 0 20px 40px -14px rgba(19, 33, 60, .38), 0 44px 80px -34px rgba(19, 33, 60, .4); }
.mcard .lay { position: absolute; inset: 0; display: none; }
.mcard[data-layout="d1"] .lay-d1, .mcard[data-layout="d2"] .lay-d2, .mcard[data-layout="d3"] .lay-d3,
.mcard[data-layout="d4"] .lay-d4, .mcard[data-layout="pastel"] .lay-pastel, .mcard[data-layout="matte"] .lay-matte { display: flex; animation: swapin .45s var(--ease) both; }
@keyframes swapin { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.mcard img.logo { object-fit: contain; }
/* original mapping: theme-design1 uses Design-4.png, design2 -> Design-3, design3 -> Design-1, design4 -> Design-2 */
.bg-theme-design1 { background: #F6EADC url('../img/cards/Design-4.jpg') center / cover no-repeat; }
.bg-theme-design2 { background: #7681A6 url('../img/cards/Design-3.jpg') center / cover no-repeat; }
.bg-theme-design3 { background: #E9E4F0 url('../img/cards/Design-1.jpg') center / cover no-repeat; }
.bg-theme-design4 { background: #042E1F url('../img/cards/Design-2.png') center / cover no-repeat; }
.bg-theme-pastel-mint { background: linear-gradient(135deg, #e0f7ef, #a8e6cf); }
.bg-theme-pastel-blush { background: linear-gradient(135deg, #ffeadd, #fad0c4); }
.bg-theme-pastel-lavender { background: linear-gradient(135deg, #e3dcf5, #c5b9cd); }
.bg-theme-pastel-blue { background: linear-gradient(135deg, #dcf0f9, #b8e1f0); }
/* Premium Matte: flat, non-reflective colours (no gradients, no sheen) + fine grain */
.bg-theme-matte-black { background: #222326; --m-fg: #ECE8E1; --m-sub: rgba(236, 232, 225, .62); --m-rule: rgba(236, 232, 225, .16); --m-logo: brightness(0) invert(.92); }
.bg-theme-matte-gold { background: #D3B987; --m-fg: #2A2216; --m-sub: rgba(42, 34, 22, .62); --m-rule: rgba(42, 34, 22, .16); --m-logo: none; }
.bg-theme-matte-bronze { background: #8A5A35; --m-fg: #F4EADF; --m-sub: rgba(244, 234, 223, .66); --m-rule: rgba(244, 234, 223, .18); --m-logo: brightness(0) invert(.94); }
.bg-theme-matte-silver { background: #C8CCD0; --m-fg: #1F2328; --m-sub: rgba(31, 35, 40, .6); --m-rule: rgba(31, 35, 40, .14); --m-logo: none; }

.mc-pill { position: relative; display: inline-flex; align-items: center; gap: 1cqw; color: #fff; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; border-radius: 999px; line-height: 1; background: #087F3F; font-size: 1.85cqw; padding: 1.35cqw 4cqw; animation: pillglow 3s ease-in-out infinite; font-family: 'Montserrat', sans-serif; }
.mc-pill .pdot { width: 1.15cqw; height: 1.15cqw; border-radius: 50%; background: #fff; flex: none; animation: ping 2s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .85); } 80%, 100% { box-shadow: 0 0 0 1.5cqw rgba(255, 255, 255, 0); } }
@keyframes pillglow { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.12); } }
.mc-vbox { background: #fff; width: 37cqw; padding: 1.15cqw 1.5cqw; font-size: 2.35cqw; letter-spacing: .13em; text-align: center; color: #000; font-weight: 500; line-height: 1.2; box-shadow: 0 .4cqw 1.4cqw rgba(120, 90, 40, .14); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-lbl { font-size: 2cqw; letter-spacing: .14em; font-weight: 500; color: #333; }
.mc-d2b { background: #050B3E; color: #fff; padding: 2.4cqw; text-align: center; font-weight: 600; font-size: 1.95cqw; letter-spacing: .07em; line-height: 1.2; box-shadow: 0 .9cqw 2.2cqw rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .1); }
.mc-blob { position: absolute; width: 14cqw; height: 6.6cqw; border-radius: 999px; animation: blobwob 4s ease-in-out infinite; }
@keyframes blobwob { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(.6cqw, -.4cqw); } }
.mc-sheen { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .55) 47%, rgba(255, 255, 255, .18) 52%, transparent 62%); background-size: 320% 100%; mix-blend-mode: soft-light; animation: sheen 7s cubic-bezier(.45, 0, .2, 1) infinite; }
@keyframes sheen { 0% { background-position: 100% 0; } 45%, 100% { background-position: 0% 0; } }
.mc-holo { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(125deg, transparent 15%, rgba(255, 0, 170, .16) 35%, rgba(0, 230, 255, .18) 50%, rgba(255, 230, 0, .14) 65%, transparent 85%); mix-blend-mode: overlay; animation: holo 9s linear infinite; }
@keyframes holo { to { filter: hue-rotate(360deg); } }
.mc-brush { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 3px); }
.mc-edge { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 0 0 1px rgba(255, 255, 255, .16); }

/* layout: Design 1 */
.lay-d1 { justify-content: space-between; padding: 5.5cqw; color: #000; }
.lay-d1 .col-l { width: 33%; display: flex; flex-direction: column; align-items: flex-start; gap: 5.5cqw; }
.lay-d1 .col-l .logo { width: 12.5cqw; height: 12.5cqw; }
.lay-d1 .mc-pill { box-shadow: -.7cqw .7cqw 0 rgba(184, 150, 100, .75); font-weight: 600; }
.lay-d1 .col-r { width: 62%; display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 1.1cqw; }
.lay-d1 .org { color: #98711E; font-size: 2.3cqw; font-weight: 800; line-height: 1.35; letter-spacing: .02em; margin-bottom: 1.4cqw; }
/* layout: Design 2 */
.lay-d2 { flex-direction: column; align-items: center; padding: 5.5cqw 6cqw 5cqw; color: #fff; }
.lay-d2 .logo { position: absolute; right: 4.5cqw; top: 4.5cqw; width: 9cqw; height: 9cqw; }
.lay-d2 .org { font-family: 'Playfair Display', serif; font-weight: 800; font-size: 2.55cqw; letter-spacing: .06em; line-height: 1.3; text-align: center; text-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
.lay-d2 .role { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.9cqw; letter-spacing: .3em; margin-top: 1cqw; text-shadow: 0 1px 2px rgba(0, 0, 0, .45); }
.lay-d2 .rule { width: 62cqw; height: 2px; background: #fff; margin: 2.2cqw 0 3.4cqw; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.lay-d2 .rows { display: flex; flex-direction: column; gap: 2.4cqw; width: 58cqw; }
.lay-d2 .mc-d2-name { font-size: 2.7cqw; font-weight: 700; letter-spacing: .14em; padding: 2.6cqw 2.4cqw; }
.lay-d2 .d2-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.4cqw; }
.lay-d2 .d2-pair .mc-d2b { display: flex; flex-direction: column; gap: .7cqw; padding: 1.8cqw 1.6cqw; font-size: 2.05cqw; letter-spacing: .06em; }
.lay-d2 .d2-pair small { font-size: 1.3cqw; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; opacity: .72; }
/* layout: Design 3 */
.lay-d3 { flex-direction: column; padding: 5.5cqw 6cqw 6cqw; color: #111; }
.lay-d3 .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 3cqw; }
.lay-d3 .org { font-weight: 700; font-size: 2.3cqw; line-height: 1.35; letter-spacing: .03em; }
.lay-d3 .logo { width: 11cqw; height: 11cqw; flex: none; margin-top: -1cqw; }
.lay-d3 .meta { display: flex; flex-direction: column; margin-top: 1cqw; line-height: 1.3; }
.lay-d3 .meta small { color: #5C84B4; font-size: 1.7cqw; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; margin-bottom: 1.4cqw; }
.lay-d3 .meta .lbl { color: #5C84B4; font-size: 1.45cqw; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.lay-d3 .meta b { color: #1B2A4A; font-size: 2.4cqw; font-weight: 800; letter-spacing: .06em; margin-top: .3cqw; }
.lay-d3 .mc-pill { align-self: flex-start; margin-top: 2.4cqw; box-shadow: .4cqw .7cqw 2cqw rgba(59, 77, 250, .4); padding: 1.4cqw 3.8cqw; }
.lay-d3 .foot { margin-top: auto; display: flex; gap: 3cqw; align-items: stretch; }
.lay-d3 .namebox { flex: 2.4; border: .45cqw solid #111; border-radius: .9cqw; padding: 2.2cqw 2.8cqw; color: #5C84B4; font-weight: 800; font-size: 3.6cqw; letter-spacing: .05em; display: flex; align-items: center; background: rgba(255, 255, 255, .28); min-width: 0; overflow: hidden; }
.lay-d3 .datebox { flex: 1; border: .45cqw solid #111; border-radius: .9cqw; padding: 1.6cqw; text-align: center; display: flex; flex-direction: column; justify-content: center; gap: .6cqw; background: rgba(255, 255, 255, .28); }
.lay-d3 .datebox b { font-size: 1.75cqw; font-weight: 800; }
.lay-d3 .datebox span { font-size: 3.3cqw; font-weight: 900; letter-spacing: .04em; }
/* layout: Design 4 */
.lay-d4 { flex-direction: column; }
.lay-d4 .top { flex: 1; padding: 5.5cqw 7cqw 3.5cqw; color: #fff; display: flex; flex-direction: column; }
.lay-d4 .org { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 2.25cqw; letter-spacing: .16em; line-height: 1.3; }
.lay-d4 .role { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 2.3cqw; margin-top: .8cqw; }
.lay-d4 .pillwrap { position: relative; align-self: flex-start; margin: 3.4cqw 0 0 1.2cqw; isolation: isolate; }
.lay-d4 .mc-pill { padding: 1.5cqw 3.4cqw; }
/* the two colour layers sit exactly behind the pill, offset like a print misregistration */
.lay-d4 .mc-blob { inset: 0; width: auto; height: auto; z-index: -1; animation: none; }
.lay-d4 .mc-blob.b1 { background: #00E5FF; transform: translate(-1cqw, -.9cqw); }
.lay-d4 .mc-blob.b2 { background: #FF2BD6; transform: translate(1cqw, .9cqw); }
.lay-d4 .grid2 { margin-top: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4cqw; line-height: 1.3; }
.lay-d4 .grid2 > span { display: flex; flex-direction: column; gap: .5cqw; }
.lay-d4 .grid2 small { font-family: 'Playfair Display', serif; font-size: 1.55cqw; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; opacity: .75; }
.lay-d4 .grid2 b { font-family: 'Alegreya', serif; font-size: 2.8cqw; font-weight: 700; letter-spacing: .04em; }
.lay-d4 .bottom { background: #fff; height: 16cqw; padding: 0 7cqw; display: flex; align-items: center; justify-content: space-between; gap: 3cqw; }
.lay-d4 .bottom b { font-family: 'Alegreya', serif; font-weight: 700; font-size: 4.4cqw; color: #042E1F; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lay-d4 .logo { width: 10cqw; height: 10cqw; }
/* layout: Soft Pastels */
.lay-pastel { color: #2C3E50; flex-direction: column; align-items: center; justify-content: space-between; text-align: center; padding: 4.5cqw 6cqw 5cqw; }
.lay-pastel .logo { width: 9.5cqw; height: 9.5cqw; }
.lay-pastel .mc-pill { font-size: 1.8cqw; padding: 1.3cqw 3.4cqw; box-shadow: 0 .6cqw 1.6cqw rgba(8, 127, 63, .3); }
.lay-pastel .name { font-size: 4.2cqw; font-weight: 800; letter-spacing: .06em; line-height: 1.1; }
.lay-pastel .org { font-size: 1.75cqw; font-weight: 700; opacity: .8; letter-spacing: .07em; }
.lay-pastel .meta { display: flex; align-items: center; justify-content: center; gap: 4.5cqw; width: 100%; background: rgba(255, 255, 255, .5); border-radius: 1.6cqw; padding: 1.8cqw 2cqw; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 .6cqw 1.8cqw rgba(44, 62, 80, .08); }
.lay-pastel .meta > span { display: flex; flex-direction: column; align-items: center; gap: .4cqw; }
.lay-pastel .meta > i { width: 1px; align-self: stretch; background: rgba(44, 62, 80, .18); }
.lay-pastel .meta small { font-size: 1.3cqw; font-weight: 700; opacity: .65; letter-spacing: .18em; text-transform: uppercase; }
.lay-pastel .meta b { font-size: 2.3cqw; font-weight: 700; letter-spacing: .05em; }
/* layout: Premium Matte */
.lay-matte { flex-direction: column; padding: 6cqw 6.5cqw 5.8cqw; color: var(--m-fg, #ECE8E1); }
.lay-matte .logo-row { position: relative; display: flex; justify-content: flex-end; }
.lay-matte .logo { width: 8.5cqw; height: 8.5cqw; filter: var(--m-logo, none); }
.lay-matte .mid { position: relative; margin-top: auto; margin-bottom: 3.2cqw; display: flex; flex-direction: column; align-items: flex-start; gap: 1.8cqw; }
/* flat outline status label: no gloss, no glow */
.lay-matte .mc-pill { font-size: 1.7cqw; padding: 1.15cqw 2.8cqw; background: transparent; color: var(--m-fg); border: max(1px, .22cqw) solid var(--m-rule); animation: none; box-shadow: none; font-weight: 600; }
.lay-matte .mc-pill .pdot { background: #3DBE7A; animation: none; }
.lay-matte .org { font-size: 1.8cqw; font-weight: 600; letter-spacing: .22em; color: var(--m-sub); }
.lay-matte .foot { position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: 3cqw; border-top: max(1px, .2cqw) solid var(--m-rule); padding-top: 3cqw; }
.lay-matte .name { font-size: 3.6cqw; font-weight: 600; letter-spacing: .12em; line-height: 1.2; max-width: 60%; }
.lay-matte .ids { display: grid; grid-template-columns: auto auto; column-gap: 2.6cqw; row-gap: .5cqw; text-align: right; align-items: baseline; }
.lay-matte .ids small { font-size: 1.5cqw; font-weight: 600; color: var(--m-sub); letter-spacing: .16em; }
.lay-matte .ids b { font-family: 'Roboto Mono', monospace; font-size: 2.05cqw; font-weight: 500; letter-spacing: .04em; }
.mcard:not([data-layout="matte"]) .mc-brush, .mcard:not([data-layout="matte"]) .mc-grain { display: none; }
/* matte surface: remove every reflective effect, add a fine powder-coat grain */
.mcard[data-layout="matte"] { box-shadow: 0 2px 4px rgba(19, 33, 60, .08), 0 18px 34px -16px rgba(19, 33, 60, .4); }
.mcard[data-layout="matte"] .mc-sheen, .mcard[data-layout="matte"] .mc-edge, .mcard[data-layout="matte"] .mc-holo { display: none; }
.mc-grain { position: absolute; inset: 0; pointer-events: none; opacity: .22; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.mcard[data-layout="matte"] .mc-brush { display: none; }
.mcard.bg-theme-matte-silver .mc-brush { display: block; background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .022) 0 1px, transparent 1px 3px); }

/* flip + float + tilt */
.card-panel-head { margin-bottom: 22px; }
.card-stage { padding: 4px 0 18px; perspective: 1600px; }
@media (hover: hover) { .card-stage:hover .card-tilt { transform: rotateX(4deg) rotateY(-6deg) translateY(-4px); } }
.card-btn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; perspective: 1600px; text-align: left; border-radius: 4.2cqw; }
.card-float { animation: cardfloat 6s ease-in-out infinite; }
@keyframes cardfloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.card-tilt { transition: transform .7s var(--ease); transform-style: preserve-3d; }
@media (hover: hover) { .card-btn:hover .card-tilt { transform: rotateX(5deg) rotateY(-7deg) translateY(-4px); } }
.flipper { position: relative; width: 100%; aspect-ratio: 7 / 4; transition: transform 1s cubic-bezier(.3, 1.25, .45, 1); transform-style: preserve-3d; }
.flipper.is-flipped { transform: rotateY(180deg); }
.flipper .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flipper .face-back { transform: rotateY(180deg); }
.card-back { position: absolute; inset: 0; background: #fff; border-radius: 4.2cqw; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 6cqw; padding: 5cqw 7cqw; font-family: 'Montserrat', sans-serif; box-shadow: 0 2px 4px rgba(19, 33, 60, .08), 0 20px 40px -14px rgba(19, 33, 60, .38); }
.card-back .blob1 { position: absolute; right: -8cqw; top: -8cqw; width: 26cqw; height: 26cqw; border-radius: 50%; background: #FFF4D6; }
.card-back .blob2 { position: absolute; left: -5cqw; bottom: -6cqw; width: 16cqw; height: 16cqw; border-radius: 50%; background: #E6F0FE; }
.qr-frame { position: relative; width: 34cqw; flex: none; padding: 2.2cqw; border-radius: 2cqw; background: #fff; box-shadow: 0 .8cqw 2.4cqw rgba(19, 33, 60, .12); }
.qr-frame::before, .qr-frame::after { content: ""; position: absolute; width: 5cqw; height: 5cqw; }
.qr-frame::before { left: -.6cqw; top: -.6cqw; border-left: .6cqw solid var(--gold); border-top: .6cqw solid var(--gold); border-top-left-radius: 1.6cqw; }
.qr-frame::after { right: -.6cqw; bottom: -.6cqw; border-right: .6cqw solid var(--gold); border-bottom: .6cqw solid var(--gold); border-bottom-right-radius: 1.6cqw; }
.qr-box { aspect-ratio: 1; width: 100%; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.card-back .txt { position: relative; display: flex; flex-direction: column; gap: 1.4cqw; color: #2C3E50; }
.card-back .txt img { width: 8cqw; height: 8cqw; object-fit: contain; }
.card-back .txt b { font-size: 3.4cqw; font-weight: 800; letter-spacing: .04em; line-height: 1.15; }
.card-back .txt code { font-family: 'Roboto Mono', monospace; font-size: 2.2cqw; color: var(--muted); letter-spacing: .08em; }
.card-back .txt small { font-size: 1.9cqw; color: var(--text); line-height: 1.5; max-width: 30cqw; }

/* design picker */
.fam-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--soft); padding: 4px; border-radius: 999px; }
.fam-tabs button { border: 0; background: transparent; color: var(--text); border-radius: 999px; padding: 10px 16px; min-height: 40px; font-weight: 700; font-size: 13px; cursor: pointer; transition: background .25s, color .25s; }
.fam-tabs button[aria-selected="true"] { background: var(--ink); color: #fff; }
.swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.swatch { border: 0; background: none; padding: 0; cursor: pointer; display: flex; flex-direction: column; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; }
.swatch .prev { display: block; width: 100%; aspect-ratio: 7 / 4; border-radius: 10px; box-shadow: 0 0 0 1px rgba(19, 33, 60, .1), 0 4px 10px rgba(19, 33, 60, .08); transition: transform .3s var(--ease), box-shadow .3s; }
.swatch:hover .prev { transform: translateY(-3px); }
.swatch[aria-checked="true"] { color: var(--ink); }
.swatch[aria-checked="true"] .prev { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--gold), 0 8px 18px rgba(19, 33, 60, .18); }
@media (max-width: 480px) { .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* =========================================================
   MEMBER DASHBOARD
   ========================================================= */
.dash { padding-top: clamp(24px, 4vw, 40px); padding-bottom: 72px; display: flex; flex-direction: column; gap: 24px; }
.dash-hello { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; }
.dash-hello h1 { font-size: clamp(30px, 4vw, 42px); margin-top: 10px; }
.dash-hello .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); font-weight: 600; }
.badge-rank { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-ink); font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
@media (max-width: 980px) { .dash-grid { grid-template-columns: 1fr; } }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat { padding: 20px 22px; display: flex; flex-direction: column; gap: 4px; }
.stat small { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat strong { font-size: clamp(26px, 3vw, 34px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.stat em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--red-ink); }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr 1fr; } .stats .stat:last-child { grid-column: 1 / -1; } }
.kv { margin: 0; display: flex; flex-direction: column; }
.kv > div { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid #F0F2F5; }
.kv dt { font-size: 14px; color: var(--muted); font-weight: 600; flex: none; }
.kv dd { margin: 0; font-size: 15px; font-weight: 700; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.kv .inline-btn { margin-left: 10px; }
.optin { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 18px; background: var(--soft); border-radius: 16px; }
.optin b { display: block; font-size: 15px; }
.optin small { display: block; font-size: 13px; color: var(--muted); }
.ev-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ev-list li { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid #F0F2F5; }
.ev-date { width: 54px; height: 54px; flex: none; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; }
.ev-date b { font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.ev-date span { font-size: 15px; font-weight: 800; }
.ev-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ev-title strong { font-size: 15px; overflow-wrap: anywhere; }
.ev-title small { font-size: 13px; color: var(--muted); }
.ev-list .empty-row { justify-content: center; color: var(--muted); padding: 28px 0; text-align: center; }
.ev-list.collapsed li:nth-child(n+6) { display: none; }
.perks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 520px) { .perks { grid-template-columns: 1fr; } }
.perk { padding: 22px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink); transition: transform .35s var(--ease), box-shadow .35s, border-color .3s; }
.perk:hover { color: var(--ink); border-color: var(--gold); }
@media (hover: hover) { .perk:hover { transform: translateY(-5px); box-shadow: 0 18px 36px rgba(19, 33, 60, .1); } }
.perk .ic-tile { width: 44px; height: 44px; border-radius: 14px; }
.perk strong { font-size: 16px; }
.perk small { font-size: 14px; line-height: 1.55; color: var(--text); }
.perk .go { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--gold-ink); margin-top: auto; }
.dir-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.search { position: relative; flex: 0 1 300px; min-width: 200px; }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 42px; min-height: 46px; }
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 14px; }
.dir-card { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 18px; background: var(--soft); min-width: 0; }
.dir-card .avatar { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line-soft); }
.dir-card div { min-width: 0; }
.dir-card strong { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-card small { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-big { width: min(280px, 70vw); margin: 8px auto 0; padding: 16px; border-radius: 22px; background: #fff; box-shadow: 0 10px 30px rgba(19, 33, 60, .12); }
.qr-big svg { width: 100%; height: auto; display: block; }

/* =========================================================
   STAFF PORTAL
   ========================================================= */
.staff-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - var(--header-h)); background: linear-gradient(90deg, var(--ink-deep) 250px, transparent 250px); }
.staff-side { background: var(--ink-deep); color: #fff; padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); }
.side-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; font-weight: 600; font-size: 14px; color: #C9D1DE; text-decoration: none; background: none; border: 0; cursor: pointer; text-align: left; width: 100%; min-height: 46px; transition: background .2s, color .2s; }
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-link.on { background: rgba(224, 178, 94, .14); color: var(--gold); }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .05); }
.side-foot .avatar { background: var(--gold); color: var(--ink); width: 36px; height: 36px; font-size: 13px; }
.side-foot small { display: block; color: #93A0B5; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.side-foot b { display: block; font-size: 14px; }
.staff-main { padding: clamp(20px, 3vw, 32px); display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.staff-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.staff-top h1 { font-size: clamp(28px, 3vw, 34px); }
.staff-top p { color: var(--muted); margin-top: 6px; }
.staff-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.staff-stats .stat small { display: flex; align-items: center; gap: 8px; }
.staff-stats .stat small i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
@media (max-width: 1100px) { .staff-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.staff-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.checkin-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; padding: 18px 22px; }
.checkin-bar .ci-text { flex: 1 1 260px; }
.ci-form { display: flex; gap: 10px; flex: 1 1 380px; }
.ci-form .input { flex: 1; min-width: 0; min-height: 48px; }
.checkin-bar .reader { flex: 1 1 100%; max-width: 460px; }
.filters { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--soft); padding: 4px; border-radius: 999px; }
.filters button { border: 0; background: transparent; color: var(--text); border-radius: 999px; padding: 9px 14px; min-height: 40px; font-weight: 700; font-size: 13px; cursor: pointer; }
.filters button span { opacity: .65; margin-left: 4px; }
.filters button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.table-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 18px 18px 14px; }
.table-box { overflow-x: auto; -webkit-overflow-scrolling: touch; position: relative; /* keeps hidden screen-reader labels inside the box, so the page itself never scrolls sideways */ }
.mtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.mtable th { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 12px 14px; white-space: nowrap; background: #FBFBFD; border-top: 1px solid var(--line-soft); }
.mtable td { padding: 14px 12px; border-top: 1px solid #F0F2F5; vertical-align: middle; }
.mtable tbody tr { transition: background .2s; }
.mtable tbody tr:hover { background: #FAFBFC; }
.m-who { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.m-dates b { display: block; font-size: 14px; font-weight: 600; }
.m-dates small { display: block; font-size: 12px; color: var(--muted); }
.m-who .avatar { width: 38px; height: 38px; font-size: 13px; color: #fff; }
.m-who strong { display: block; font-size: 14px; }
.m-who small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.m-who > div { min-width: 0; }
.m-id { font-family: 'Roboto Mono', ui-monospace, monospace; font-weight: 700; font-size: 13px; white-space: nowrap; text-decoration: none; color: var(--ink); }
.m-id:hover { color: var(--gold-ink); text-decoration: underline; }
.nowrap { white-space: nowrap; }
.consent { display: inline-flex; flex: none; width: max-content; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.consent.yes { background: var(--green-soft); color: var(--green-ink); }
.consent.no { background: var(--soft); color: var(--muted); }
/* Block-level flex + max-content pills: the pill always wraps its own text, even if the
   browser sized the table before the web font loaded (seen live 19 Nov: "WhatsApp" spilling out). */
.comms { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.mtable td[data-label="Comms"] { min-width: 136px; }
.m-promo { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.m-promo > * { flex: none; max-width: max-content; }
.m-promo small { font-size: 12px; color: var(--muted); white-space: nowrap; }
.promo-chip { font-family: 'Roboto Mono', ui-monospace, monospace; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 8px; background: var(--gold-soft); color: var(--gold-ink); white-space: nowrap; }
.tag-swda { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .04em; background: var(--blue-soft); color: var(--blue-ink); vertical-align: 1px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }
.menu { position: absolute; z-index: 40; min-width: 210px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 16px; box-shadow: 0 20px 50px rgba(19, 33, 60, .18); padding: 6px; display: flex; flex-direction: column; animation: popin .2s var(--ease) both; }
.menu[hidden] { display: none; }
.menu button { display: flex; align-items: center; gap: 10px; border: 0; background: none; text-align: left; padding: 11px 12px; min-height: 44px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--ink); cursor: pointer; }
.menu button:hover { background: var(--soft); }
.menu button.danger { color: var(--red-ink); }
.menu hr { border: 0; border-top: 1px solid var(--line-soft); margin: 4px 6px; }
.no-results { padding: 40px 20px; text-align: center; color: var(--muted); }
.checkin { padding: 22px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--header-h) + 20px); }
.or-rule { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .1em; }
.or-rule::before, .or-rule::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.reader { width: 100%; border-radius: 16px; overflow: hidden; background: #0F1B33; }
.reader[hidden] { display: none; }
.reader video { width: 100% !important; }
.ev-types { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line-soft); border-radius: 16px; max-height: 260px; overflow-y: auto; }
.ev-types li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line-soft); font-weight: 700; font-size: 15px; }
.ev-types li:first-child { border-top: 0; }
.ev-types .empty { padding: 20px; color: var(--muted); font-weight: 500; justify-content: center; }
.focus-card { max-width: 560px; margin: clamp(24px, 6vw, 64px) auto; padding: clamp(28px, 5vw, 44px); text-align: center; display: flex; flex-direction: column; gap: 18px; align-items: center; }
.focus-card h1 { font-size: clamp(26px, 3.4vw, 34px); }
.focus-card .ok-badge { width: 76px; height: 76px; border-radius: 50%; background: var(--green-soft); color: var(--green-ink); display: flex; align-items: center; justify-content: center; animation: pop .6s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
.focus-card .stack { width: 100%; text-align: left; }
.focus-card .btn { width: 100%; }
.focus-card .warn { width: 100%; }
.big-id { font-family: 'Roboto Mono', ui-monospace, monospace; font-size: 18px; letter-spacing: .06em; color: var(--muted); }

@media (max-width: 900px) {
  .staff-shell { grid-template-columns: 1fr; background: none; }
  .staff-side { position: sticky; top: var(--header-offset); transition: top .4s var(--ease); z-index: 20; height: auto; flex-direction: row; gap: 6px; overflow-x: auto; padding: 10px 12px; scrollbar-width: none; }
  .staff-side::-webkit-scrollbar { display: none; }
  .staff-side .side-label { display: none; }
  .side-link { width: auto; flex: none; white-space: nowrap; padding: 10px 14px; }
  .side-foot { display: none; }
  .checkin-bar > .btn { flex: 1 1 100%; }
}
/* staff table -> cards on phones */
@media (max-width: 760px) {
  .mtable thead { display: none; }
  .mtable, .mtable tbody, .mtable tr, .mtable td { display: block; width: 100%; }
  .mtable tr { position: relative; padding: 16px 16px 12px; border-top: 1px solid var(--line-soft); }
  .mtable td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; font-size: 14px; text-align: right; }
  .mtable td.td-who { text-align: left; }
  .m-dates small { text-align: right; }
  .comms, .m-promo { align-items: flex-end; }
  .mtable td[data-label]::before { content: attr(data-label); color: var(--muted); font-weight: 600; font-size: 13px; flex: none; }
  .mtable td.td-who { padding-right: 52px; }
  .mtable td.td-who::before { display: none; }
  .mtable td.td-actions { position: absolute; top: 14px; right: 12px; width: auto; padding: 0; }
  .m-who { min-width: 0; }
  .m-who small { max-width: none; white-space: normal; overflow-wrap: anywhere; }
  .table-tools .search { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .card-float, .mc-pill, .mc-pill .pdot, .mc-sheen, .mc-holo, .mc-blob, .auth-cards .mcard-wrap, .auth-side .orb { animation: none !important; }
  .flipper, .card-tilt { transition: none; }
}

/* =========================================================
   Card motion clean-up (owner feedback 2 Nov): the card stays still and crisp.
   No light sweep, no constant float, no 3D tilt, no glow/ping on the status dot.
   Design changes use one quick whole-card fade (portal.js).
   ========================================================= */
.mcard .mc-sheen, .mcard .mc-holo { display: none !important; }
.mcard .mc-edge { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.card-float { animation: none !important; }
.card-tilt, .card-stage:hover .card-tilt { transform: none !important; transition: none; }
.mc-pill, .mc-pill .pdot, .mc-blob { animation: none !important; }
.mc-pill .pdot { box-shadow: none; }
.mcard .lay { animation: none !important; }
.mcard.is-swapping { animation: cardswap .35s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes cardswap { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* =========================================================
   Staff Portal > Articles / Events
   ========================================================= */
.side-label { margin: 14px 14px 4px; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #6F7C92; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; text-decoration: none; color: var(--muted); margin-bottom: 8px; }
.back-link:hover { color: var(--ink); }

.c-list { list-style: none; margin: 0; padding: 0 18px 10px; }
.c-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.c-row:first-child { border-top: 0; }
.c-row[hidden] { display: none; }
.c-thumb { width: 64px; height: 48px; border-radius: 10px; overflow: hidden; background: var(--soft); color: var(--muted); display: flex; align-items: center; justify-content: center; }
.c-thumb img { width: 100%; height: 100%; object-fit: cover; }
.c-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.c-title { font-weight: 700; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-title:hover { color: var(--gold-ink); }
.c-main small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-upd { color: #8A94A3 !important; font-size: 12px !important; }
.c-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 760px) {
  .c-row { grid-template-columns: 56px minmax(0, 1fr); row-gap: 10px; }
  .c-row .chip { grid-column: 2; justify-self: start; }
  .c-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .c-actions .btn span { display: none; }
}

.c-editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.c-col-side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: calc(var(--header-h) + 20px); }
.c-col-side .btn { width: 100%; }
@media (max-width: 1100px) { .c-editor { grid-template-columns: minmax(0, 1fr); } .c-col-side { position: static; } }
.input-lg { font-size: 22px; font-weight: 700; min-height: 60px; }
.pub-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--soft); padding: 4px; border-radius: 14px; }
.pub-toggle label { position: relative; cursor: pointer; }
.pub-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pub-toggle span { display: flex; align-items: center; justify-content: center; min-height: 42px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--text); transition: background .2s, color .2s; }
.pub-toggle input:checked + span { background: var(--ink); color: #fff; }
.pub-toggle input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.cover { position: relative; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: var(--soft); border: 1.5px dashed var(--line); display: flex; align-items: center; justify-content: center; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 14px; }

/* the formatting editor */
.editor-wrap { border: 1.5px solid #D9DEE7; border-radius: 14px; overflow: hidden; overflow: clip; background: #fff; } /* clip (not hidden) so the toolbar can stay stuck at the top */
.editor-wrap:focus-within { border-color: #C8963E; box-shadow: 0 0 0 4px rgba(224, 178, 94, .22); }
.editor-wrap .ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid var(--line-soft); background: var(--soft); padding: 10px; font-family: var(--font); position: sticky; top: 0; z-index: 2; }
.editor-wrap .ql-container.ql-snow { border: 0; font-family: var(--font); font-size: 17px; }
.editor-wrap .ql-editor { min-height: 420px; line-height: 1.75; color: var(--text); padding: 22px 24px; overflow-wrap: anywhere; }
.editor-wrap .ql-editor h2, .editor-wrap .ql-editor h3 { color: var(--ink); margin: 1em 0 .4em; }
.editor-wrap .ql-editor img { border-radius: 12px; margin: .6em 0; }
.editor-wrap .ql-editor.ql-blank::before { color: #8A94A3; font-style: normal; left: 24px; }
.editor-wrap textarea.textarea { border: 0; border-radius: 0; min-height: 420px; }
@media (max-width: 600px) { .editor-wrap .ql-editor { min-height: 300px; padding: 16px; } }

/* ---------- staff sidebar: hide / show (desktop) ---------- */
.side-toggle { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 10px 14px; margin-bottom: 10px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; background: transparent; color: #93A0B5; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.side-toggle:hover { color: #fff; background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .22); }
.side-toggle .ic { transition: transform .35s var(--ease); }
.staff-shell { transition: grid-template-columns .35s var(--ease); }
.staff-side .side-txt { white-space: nowrap; overflow: hidden; transition: opacity .2s; }
.staff-shell.side-collapsed { grid-template-columns: 78px minmax(0, 1fr); background: linear-gradient(90deg, var(--ink-deep) 78px, transparent 78px); }
.staff-shell.side-collapsed .staff-side { padding-left: 12px; padding-right: 12px; align-items: center; }
.staff-shell.side-collapsed .side-txt { opacity: 0; width: 0; position: absolute; pointer-events: none; }
.staff-shell.side-collapsed .side-label { font-size: 0; line-height: 0; height: 0; margin: 10px 0; padding: 0; border-top: 1px solid rgba(255, 255, 255, .12); width: 52px; }
.staff-shell.side-collapsed .side-link, .staff-shell.side-collapsed .side-toggle { justify-content: center; padding: 12px 0; width: 52px; }
.staff-shell.side-collapsed .side-toggle .ic { transform: scaleX(-1); }
.staff-shell.side-collapsed .side-foot { padding: 8px; justify-content: center; width: 52px; }
.staff-shell.no-anim, .staff-shell.no-anim * { transition: none !important; }
@media (max-width: 900px) { .side-toggle { display: none; } }
@media (prefers-reduced-motion: reduce) { .staff-shell { transition: none; } }

/* ===================== Staff tools: promo codes, renewals, staff accounts ===================== */
.tick-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tick-list li { position: relative; padding-left: 26px; font-size: 15px; line-height: 1.6; color: var(--text); }
.tick-list li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 14px; height: 8px; border-left: 2.5px solid var(--green); border-bottom: 2.5px solid var(--green); transform: rotate(-45deg); }
.promo-help { display: flex; flex-direction: column; gap: 14px; }
.promo-empty { padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.promo-empty p { max-width: 460px; }
.promo-code { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 160px; }
.promo-code small { color: var(--muted); font-size: 13px; }
.promo-pill { font: 800 14px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em; color: var(--ink); background: var(--gold-soft); border: 1.5px dashed #D9B36A; border-radius: 10px; padding: 9px 12px; cursor: pointer; transition: background .2s; }
.promo-pill:hover { background: #FDEFD3; }
.promo-use { display: flex; flex-direction: column; gap: 5px; min-width: 110px; }
.promo-use b { font-size: 14px; }
.promo-use small { font-size: 12px; color: var(--muted); }
.promo-bar { display: block; width: 110px; height: 6px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.promo-bar i { display: block; height: 100%; border-radius: inherit; background: var(--gold); }
.promo-plans { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; padding: 14px 16px; border-radius: 14px; background: var(--soft); }
.promo-plans[hidden] { display: none; }
.promo-input { text-transform: uppercase; letter-spacing: .05em; }
.promo-input::placeholder { text-transform: none; letter-spacing: 0; }
.promo-preview { font-size: 13px; color: var(--muted); }
.promo-preview:empty { display: none; }
.promo-form .field-error[hidden] { display: none; }
.renew-auto { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.renew-steps { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.6; }
.txt-red { color: var(--red-ink) !important; font-weight: 700; }
.txt-gold { color: var(--yellow-ink) !important; font-weight: 700; }
.m-dates b .ic { vertical-align: -2px; color: var(--green-ink); }
.mtable tbody tr[hidden] { display: none; }
@media (max-width: 900px) {
  .promo-table td.td-actions { position: static; padding-top: 8px; }
  .promo-table td.td-who { padding-right: 0; }
  .promo-table .row-actions { justify-content: flex-start; flex-wrap: wrap; }
  .promo-code { min-width: 0; }
}

/* ===================== Promo code box (renewal page) ===================== */
.promo-field .input-action .btn { min-width: 96px; }
.promo-msg { font-size: 14px; font-weight: 600; line-height: 1.5; }
.promo-msg.is-ok { color: var(--green-ink); }
.promo-msg.is-err { color: var(--red-ink); }
.promo-field.is-applied .promo-input { border-color: var(--green-ink); background: var(--green-soft); }
.input-action { display: flex; gap: 10px; }
.input-action .input { flex: 1; min-width: 0; }
.input-action .btn { flex: none; }

/* ===================== Renewal page (/renew/) ===================== */
.renew-main { padding: clamp(28px, 5vw, 64px) 16px 80px; }
.renew-wrap { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.renew-head { display: flex; flex-direction: column; gap: 10px; }
.renew-head h1 { font-size: clamp(30px, 4.5vw, 44px); letter-spacing: -.02em; line-height: 1.1; }
.renew-head p { color: var(--muted); font-size: 17px; }
.renew-member { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 14px; padding: 20px 22px; }
.renew-member div { display: flex; flex-direction: column; gap: 2px; }
.renew-member small { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.renew-member b { font-size: 16px; }
.renew-step-h { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 800; }
.renew-step-h span { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; flex: none; }
.renew-plans { display: grid; gap: 12px; }
.renew-plan { position: relative; display: block; cursor: pointer; }
.renew-plan input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.renew-plan .rp-box { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border: 1.5px solid var(--line-soft); border-radius: 18px; background: #fff; transition: border-color .2s, box-shadow .2s, background .2s; }
.renew-plan .rp-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #C5CCD6; flex: none; position: relative; transition: border-color .2s; }
.renew-plan input:checked + .rp-box { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(19, 33, 60, .08); }
.renew-plan input:checked + .rp-box .rp-dot { border-color: var(--ink); }
.renew-plan input:checked + .rp-box .rp-dot::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--ink); }
.renew-plan input:focus-visible + .rp-box { outline: 3px solid var(--gold); outline-offset: 2px; }
.renew-plan .rp-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.renew-plan .rp-text strong { font-size: 16px; }
.renew-plan .rp-text small { color: var(--muted); font-size: 14px; }
.renew-plan .rp-price { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.renew-plan .rp-flag { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: var(--gold-soft); color: var(--gold-ink); border-radius: 99px; padding: 3px 9px; margin-left: 6px; vertical-align: 2px; }
.renew-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px 20px; border-radius: 16px; background: var(--ink); color: #fff; }
.renew-total span { font-weight: 600; color: #C9D1DE; }
.renew-total strong { font-size: 30px; letter-spacing: -.02em; color: #fff; }
.renew-total s { color: #93A0B5; font-size: 16px; margin-right: 8px; font-weight: 600; }
.pay-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.pay-box { border: 1px solid var(--line-soft); border-radius: 18px; padding: 20px; background: var(--soft); display: flex; flex-direction: column; gap: 12px; }
.pay-h { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pay-box dl { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.pay-box dl div { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.pay-box dt { color: var(--muted); }
.pay-box dd { margin: 0; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; text-align: right; }
.pay-uen { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 22px; font-weight: 800; letter-spacing: .03em; }
.pay-intro { font-size: 15px; color: var(--text); }
.copy-btn { border: 0; background: #fff; color: var(--ink); font-family: inherit; font-weight: 700; font-size: 12px; line-height: 1; padding: 7px 10px; border-radius: 8px; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line-soft); }
.copy-btn:hover { background: var(--gold-soft); }
.renew-done { text-align: center; align-items: center; padding: clamp(28px, 5vw, 48px); display: flex; flex-direction: column; gap: 14px; }
.renew-done .done-check { width: 72px; height: 72px; border-radius: 50%; background: var(--green-soft); color: var(--green-ink); display: inline-flex; align-items: center; justify-content: center; }
.renew-done p { max-width: 520px; color: var(--muted); }
.renew-done .pay-steps { width: 100%; text-align: left; }
.renew-msg { text-align: center; padding: clamp(28px, 5vw, 48px); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.renew-msg p { max-width: 480px; color: var(--muted); }
.renew-form .field-error[hidden] { display: none; }
.stat-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; font-weight: 800; color: var(--ink); text-decoration: none; }
.stat-link:hover { color: var(--gold-ink); }
.mtable .status-chip { white-space: nowrap; }
.m-dates b.with-ic { display: inline-flex; align-items: center; gap: 5px; }
.promo-terms-edit { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 16px; background: var(--soft); }
.promo-terms-edit .field { margin: 0; }
.promo-terms-edit textarea { min-height: 160px; }

/* Staff sidebar on shorter windows (seen 19 Nov: the "Staff" card at the bottom spilled out below the
   dark panel). The panel is as tall as the window, so its contents scroll inside it when they don't fit,
   and the spacing tightens a little on short windows so they usually do fit. */
@media (min-width: 901px) {
  .staff-side { overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent; }
  .staff-side > * { flex-shrink: 0; }
}
@media (min-width: 901px) and (max-height: 820px) {
  .staff-side { padding-top: 14px; padding-bottom: 14px; gap: 2px; }
  .side-link { min-height: 40px; padding-top: 9px; padding-bottom: 9px; }
  .side-label { margin-top: 10px; }
  .side-toggle { min-height: 38px; margin-bottom: 6px; }
  .side-foot { padding: 10px 12px; }
}

/* Article / event editor toolbar (asked 19 Nov): bigger buttons, and it stays at the top of the screen
   while you scroll through a long text - just under the header, or under the staff menu bar on smaller
   screens (portal.js measures that bar into --staff-bar-h). */
.editor-wrap .ql-toolbar.ql-snow { top: calc(var(--header-offset) + var(--staff-bar-h, 0px)); transition: top .4s var(--ease); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 7px 10px; box-shadow: 0 6px 14px -10px rgba(19, 33, 60, .35); }
.editor-wrap .ql-toolbar.ql-snow .ql-formats { display: inline-flex; align-items: center; gap: 0; margin-right: 0; padding-right: 6px; border-right: 1px solid var(--line-soft); }
.editor-wrap .ql-toolbar.ql-snow .ql-formats:last-child { border-right: 0; padding-right: 0; }
.editor-wrap .ql-snow.ql-toolbar button { width: 40px; height: 40px; padding: 9px; border-radius: 10px; }
.editor-wrap .ql-snow.ql-toolbar button:hover, .editor-wrap .ql-snow.ql-toolbar button:focus-visible { background: rgba(19, 33, 60, .07); }
.editor-wrap .ql-snow.ql-toolbar button.ql-active { background: rgba(6, 108, 222, .1); }
.editor-wrap .ql-snow .ql-picker { height: 40px; font-size: 15px; }
.editor-wrap .ql-snow .ql-picker.ql-header { width: 118px; }
.editor-wrap .ql-snow .ql-picker-label { display: flex; align-items: center; padding-left: 10px; border-radius: 10px; }
.editor-wrap .ql-snow .ql-picker-label:hover { background: rgba(19, 33, 60, .07); }
.editor-wrap .ql-snow .ql-picker-options { padding: 6px 10px; border-radius: 10px; }
.editor-wrap .ql-snow .ql-picker.ql-expanded .ql-picker-options { top: 44px; }
@media (max-width: 600px) {
  .editor-wrap .ql-toolbar.ql-snow { padding: 4px 6px; gap: 2px 3px; }
  .editor-wrap .ql-snow.ql-toolbar button { width: 36px; height: 38px; padding: 9px 8px; }
  .editor-wrap .ql-snow .ql-picker { height: 38px; }
  .editor-wrap .ql-snow .ql-picker.ql-header { width: 100px; }
  .editor-wrap .ql-snow .ql-picker-label { padding-left: 6px; }
  .editor-wrap .ql-toolbar.ql-snow .ql-formats { padding-right: 4px; }
}
