@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;1,500&display=swap');

:root {
  --portal-ink: #20161a;
  --portal-muted: #75666b;
  --portal-ivory: #fbf7f1;
  --portal-paper: #fffdf9;
  --portal-blush: #f7dfe5;
  --portal-blush-deep: #eab5c3;
  --portal-burgundy: #7b203b;
  --portal-burgundy-dark: #581329;
  --portal-gold: #bd9960;
  --portal-green: #2f7257;
  --portal-amber: #9a641a;
  --portal-red: #a33a3a;
  --portal-line: #eadfd8;
  --portal-shadow: 0 22px 60px rgba(74, 38, 48, 0.09);
  --portal-radius: 22px;
  --portal-sidebar: 264px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--portal-ink);
  background:
    radial-gradient(circle at 88% 4%, rgba(247, 223, 229, 0.88), transparent 28rem),
    linear-gradient(145deg, #fffdf9 0%, var(--portal-ivory) 52%, #f7eee8 100%);
  font-family: 'Inter', sans-serif;
  line-height: 1.55;
}

body.portal-locked { overflow: hidden; }

button, input, textarea, select { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

a { color: inherit; }

img { max-width: 100%; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.portal-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--portal-sidebar) minmax(0, 1fr);
}

.portal-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--portal-sidebar);
  display: flex;
  flex-direction: column;
  padding: max(30px, env(safe-area-inset-top)) 20px max(22px, env(safe-area-inset-bottom));
  overflow-y: auto;
  color: #fff;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.12), transparent 18rem),
    linear-gradient(180deg, #74213b 0%, #501225 100%);
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 28px;
  text-decoration: none;
}

.portal-brand img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 50%;
  background: #fff;
}

.portal-brand strong {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  letter-spacing: 0.02em;
}

.portal-brand small {
  display: block;
  color: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.portal-nav {
  display: grid;
  gap: 5px;
}

.portal-nav-label {
  margin: 18px 12px 8px;
  color: rgba(255, 255, 255, 0.46);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.portal-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 43px;
  padding: 9px 12px;
  color: rgba(255, 255, 255, 0.78);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: 160ms ease;
}

.portal-nav a:hover,
.portal-nav a[aria-current='page'] {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(2px);
}

.portal-nav svg { width: 18px; height: 18px; stroke-width: 1.8; }

.portal-sidebar-foot {
  margin-top: auto;
  padding: 18px 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.portal-user {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.portal-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: var(--portal-burgundy);
  background: var(--portal-blush);
  font-weight: 700;
}

.portal-avatar img { width: 100%; height: 100%; object-fit: cover; }

.portal-user strong,
.portal-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.portal-user strong { font-size: 12px; }
.portal-user small { color: rgba(255, 255, 255, 0.58); font-size: 10px; }

.portal-main {
  grid-column: 2;
  min-width: 0;
  padding: max(28px, env(safe-area-inset-top)) clamp(20px, 4vw, 58px) max(58px, env(safe-area-inset-bottom));
}

.portal-topbar {
  min-height: 54px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}

.portal-kicker {
  margin: 0 0 4px;
  color: var(--portal-burgundy);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.portal-page-title {
  margin: 0;
  font-family: 'Playfair Display', serif;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 600;
  line-height: 1.1;
}

.portal-page-title em { color: var(--portal-burgundy); font-weight: 500; }

.portal-subtitle {
  max-width: 660px;
  margin: 10px 0 0;
  color: var(--portal-muted);
  font-size: 14px;
}

.portal-top-actions { display: flex; align-items: center; gap: 10px; }

.portal-icon-button,
.portal-menu-button {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--portal-line);
  border-radius: 50%;
  color: var(--portal-burgundy);
  background: rgba(255, 253, 249, 0.75);
  cursor: pointer;
}

.portal-menu-button { display: none; }
.portal-icon-button svg, .portal-menu-button svg { width: 19px; }

.mock-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 14px;
  margin-bottom: 22px;
  border: 1px solid #e5c98e;
  border-radius: 13px;
  color: #79501e;
  background: #fff8e9;
  font-size: 12px;
}

.mock-banner strong { color: #5f3a0e; }

.portal-grid { display: grid; gap: 20px; }
.portal-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.portal-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.portal-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.portal-span-2 { grid-column: span 2; }
.portal-span-full { grid-column: 1 / -1; }

.portal-card {
  min-width: 0;
  padding: 24px;
  border: 1px solid rgba(219, 197, 190, 0.7);
  border-radius: var(--portal-radius);
  background: rgba(255, 253, 249, 0.9);
  box-shadow: var(--portal-shadow);
}

.portal-card.rose {
  background:
    radial-gradient(circle at 90% 5%, rgba(255, 255, 255, 0.5), transparent 15rem),
    linear-gradient(135deg, #f8e4e9, #f1ccd6);
}

.portal-card.burgundy {
  color: #fff;
  border: 0;
  background:
    radial-gradient(circle at 86% 10%, rgba(255, 255, 255, 0.12), transparent 14rem),
    linear-gradient(135deg, #812540, #591329);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.card-head h2,
.card-head h3 { margin: 0; font-family: 'Playfair Display', serif; line-height: 1.25; }
.card-head h2 { font-size: 24px; }
.card-head h3 { font-size: 20px; }
.card-head p { margin: 5px 0 0; color: var(--portal-muted); font-size: 12px; }
.portal-card.burgundy .card-head p { color: rgba(255, 255, 255, 0.68); }

.metric-card { min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; }
.metric-label { color: var(--portal-muted); font-size: 10px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; }
.metric-value { margin-top: 12px; font-family: 'Playfair Display', serif; font-size: 34px; line-height: 1; }
.metric-note { margin-top: 8px; color: var(--portal-muted); font-size: 11px; }
.metric-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--portal-burgundy); background: var(--portal-blush); }

.points-hero {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 30px;
  align-items: center;
}

.progress-ring {
  --value: 85;
  position: relative;
  width: 164px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--portal-burgundy) calc(var(--value) * 1%), rgba(123, 32, 59, 0.12) 0);
}

.progress-ring::before {
  content: '';
  position: absolute;
  inset: 13px;
  border-radius: inherit;
  background: #fae8ec;
}

.progress-ring-value { position: relative; z-index: 1; text-align: center; }
.progress-ring-value strong { display: block; font-family: 'Playfair Display', serif; font-size: 42px; line-height: 1; }
.progress-ring-value span { color: var(--portal-muted); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }

.points-copy h2 { margin: 0 0 8px; font-family: 'Playfair Display', serif; font-size: clamp(26px, 3.5vw, 38px); line-height: 1.15; }
.points-copy p { margin: 0; color: var(--portal-muted); }
.points-copy .points-balance { color: var(--portal-burgundy); }

.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.portal-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #fff;
  background: var(--portal-burgundy);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: 160ms ease;
}

.portal-button:hover { background: var(--portal-burgundy-dark); transform: translateY(-1px); }
.portal-button.secondary { color: var(--portal-burgundy); border-color: var(--portal-blush-deep); background: transparent; }
.portal-button.secondary:hover { background: var(--portal-blush); }
.portal-button.light { color: var(--portal-burgundy); background: #fff; }
.portal-button.danger { background: var(--portal-red); }
.portal-button.small { min-height: 34px; padding: 7px 12px; font-size: 11px; }
.portal-button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.portal-button svg { width: 16px; height: 16px; }

.portal-install-link {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 10px;
  padding: 8px;
  border: 0;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.portal-install-link:hover { color: #fff; }
.portal-install-link svg { width: 14px; }

.quick-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.quick-action {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid var(--portal-line);
  border-radius: 16px;
  color: var(--portal-ink);
  background: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  transition: 160ms ease;
}
.quick-action:hover { border-color: var(--portal-blush-deep); transform: translateY(-2px); box-shadow: 0 12px 26px rgba(92, 37, 53, 0.08); }
.quick-action svg { width: 21px; color: var(--portal-burgundy); }
.quick-action strong { display: block; font-family: 'Playfair Display', serif; font-size: 16px; }
.quick-action span { display: block; margin-top: 2px; color: var(--portal-muted); font-size: 10px; }

.activity-list { display: grid; gap: 4px; }
.activity-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 4px;
  border-bottom: 1px solid var(--portal-line);
}
.activity-row:last-child { border-bottom: 0; }
.activity-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--portal-burgundy); background: var(--portal-blush); }
.activity-icon svg { width: 16px; }
.activity-copy strong, .activity-copy small { display: block; }
.activity-copy strong { font-size: 12px; }
.activity-copy small { color: var(--portal-muted); font-size: 10px; }
.activity-points { color: var(--portal-green); font-size: 13px; font-weight: 700; white-space: nowrap; }
.activity-points.negative { color: var(--portal-red); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--portal-muted);
  background: #f1ece8;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.status-pill.active, .status-pill.approved, .status-pill.qualified, .status-pill.fulfilled, .status-pill.rewarded { color: var(--portal-green); background: #e4f2eb; }
.status-pill.pending, .status-pill.requested, .status-pill.scheduled, .status-pill.captured { color: var(--portal-amber); background: #fff1d8; }
.status-pill.rejected, .status-pill.invalid, .status-pill.suspended, .status-pill.cancelled { color: var(--portal-red); background: #fbe3e3; }

.portal-table-wrap { width: 100%; overflow-x: auto; }
.portal-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.portal-table th { padding: 10px 12px; color: var(--portal-muted); border-bottom: 1px solid var(--portal-line); font-size: 9px; letter-spacing: 0.12em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.portal-table td { padding: 14px 12px; border-bottom: 1px solid var(--portal-line); vertical-align: middle; }
.portal-table tr:last-child td { border-bottom: 0; }
.portal-table .points-positive { color: var(--portal-green); font-weight: 700; }
.portal-table .points-negative { color: var(--portal-red); font-weight: 700; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-chip { padding: 7px 11px; border: 1px solid var(--portal-line); border-radius: 999px; color: var(--portal-muted); background: transparent; font-size: 10px; font-weight: 700; cursor: pointer; }
.filter-chip.active, .filter-chip:hover { color: #fff; border-color: var(--portal-burgundy); background: var(--portal-burgundy); }

.portal-input,
.portal-select,
.portal-textarea {
  width: 100%;
  min-height: 45px;
  padding: 11px 13px;
  border: 1px solid var(--portal-line);
  border-radius: 12px;
  outline: 0;
  color: var(--portal-ink);
  background: rgba(255, 255, 255, 0.75);
  transition: 160ms ease;
}
.portal-textarea { min-height: 112px; resize: vertical; }
.portal-input:focus, .portal-select:focus, .portal-textarea:focus { border-color: var(--portal-burgundy); box-shadow: 0 0 0 3px rgba(123, 32, 59, 0.09); }
.portal-field { display: grid; gap: 7px; }
.portal-field label { font-size: 10px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.portal-field small { color: var(--portal-muted); font-size: 10px; }
.portal-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.search-field { position: relative; width: min(100%, 330px); }
.search-field svg { position: absolute; left: 13px; top: 50%; width: 16px; color: var(--portal-muted); transform: translateY(-50%); }
.search-field .portal-input { padding-left: 40px; }

.password-field { position: relative; }
.password-field .portal-input { padding-right: 48px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--portal-muted);
  cursor: pointer;
}
.password-toggle:hover, .password-toggle:focus-visible { color: var(--portal-burgundy); }
.password-toggle svg { width: 17px; height: 17px; pointer-events: none; }
.password-toggle .icon-hide { display: none; }
.password-toggle[aria-pressed="true"] .icon-show { display: none; }
.password-toggle[aria-pressed="true"] .icon-hide { display: inline-flex; }

.earn-grid, .reward-grid, .member-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.earn-card, .reward-card, .member-card { overflow: hidden; border: 1px solid var(--portal-line); border-radius: 18px; background: rgba(255, 255, 255, 0.7); }
.earn-card { display: flex; flex-direction: column; padding: 20px; }
.earn-value { width: fit-content; padding: 6px 10px; border-radius: 999px; color: var(--portal-burgundy); background: var(--portal-blush); font-size: 11px; font-weight: 700; }
.earn-card h3, .reward-card h3, .member-card h3 { margin: 18px 0 7px; font-family: 'Playfair Display', serif; font-size: 20px; }
.earn-card p, .reward-card p, .member-card p { margin: 0; color: var(--portal-muted); font-size: 11px; }
.earn-card .portal-button { margin-top: auto; align-self: flex-start; }

.member-card { padding: 18px; }
.member-photo { width: 74px; height: 74px; overflow: hidden; display: grid; place-items: center; border-radius: 50%; color: var(--portal-burgundy); background: var(--portal-blush); font-family: 'Playfair Display', serif; font-size: 25px; }
.member-photo img { width: 100%; height: 100%; object-fit: cover; }
.member-card h3 { margin-top: 14px; }
.member-meta { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.member-meta span { padding: 5px 8px; border-radius: 999px; color: var(--portal-burgundy); background: #f9edf0; font-size: 9px; font-weight: 700; }

.reward-card { display: flex; flex-direction: column; min-height: 280px; padding: 24px; }
.reward-card .reward-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; color: var(--portal-burgundy); background: var(--portal-blush); }
.reward-card .reward-cost { margin: 12px 0 18px; color: var(--portal-burgundy); font-weight: 700; }
.reward-card .portal-button { margin-top: auto; }

.referral-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; padding: 9px; border: 1px solid var(--portal-blush-deep); border-radius: 14px; background: rgba(255, 255, 255, 0.64); }
.referral-box code { min-width: 0; padding: 10px; overflow: hidden; color: var(--portal-burgundy); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.empty-state { padding: 34px 18px; color: var(--portal-muted); text-align: center; }
.empty-state svg { width: 28px; margin-bottom: 8px; color: var(--portal-blush-deep); }
.empty-state h3 { margin: 0 0 5px; color: var(--portal-ink); font-family: 'Playfair Display', serif; }
.empty-state p { margin: 0; font-size: 11px; }

.admin-alert {
  padding: 13px 15px;
  border-left: 3px solid var(--portal-gold);
  border-radius: 0 12px 12px 0;
  color: var(--portal-muted);
  background: #fff8eb;
  font-size: 11px;
}

.portal-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(32, 22, 26, 0.5);
}
.portal-modal { width: min(calc(100vw - 32px), 600px); max-height: min(92vh, 760px); overflow: auto; padding: 26px; border-radius: 22px; color: var(--portal-ink); background: var(--portal-paper); box-shadow: 0 30px 90px rgba(30, 14, 20, 0.3); }
.portal-modal::backdrop { background: rgba(32, 22, 26, 0.55); }
.portal-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.portal-modal-head h2 { margin: 0; font-family: 'Playfair Display', serif; }
.portal-modal-close { border: 0; background: transparent; cursor: pointer; }

.toast-region { position: fixed; z-index: 100; right: 18px; bottom: 18px; display: grid; gap: 10px; }
.portal-toast { min-width: min(330px, calc(100vw - 36px)); padding: 13px 15px; border-radius: 13px; color: #fff; background: var(--portal-burgundy); box-shadow: 0 18px 42px rgba(56, 18, 30, 0.24); font-size: 12px; animation: toast-in 180ms ease; }
.portal-toast.error { background: var(--portal-red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(430px, 0.75fr);
}
.auth-story {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(30px, 6vw, 80px);
  color: #fff;
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.17), transparent 20rem),
    linear-gradient(145deg, #8b2c48, #501225);
}
.auth-story::after { content: ''; position: absolute; width: 380px; height: 380px; right: -120px; bottom: -140px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 50%; box-shadow: 0 0 0 55px rgba(255, 255, 255, 0.035), 0 0 0 110px rgba(255, 255, 255, 0.025); }
.auth-story .portal-brand { padding: 0; position: relative; z-index: 1; }
.auth-quote { position: relative; z-index: 1; max-width: 700px; }
.auth-quote p { margin: 0; font-family: 'Playfair Display', serif; font-size: clamp(36px, 5vw, 64px); line-height: 1.1; }
.auth-quote span { display: block; margin-top: 18px; color: rgba(255, 255, 255, 0.72); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.auth-panel { display: grid; place-items: center; padding: 30px; }
.auth-card { width: min(100%, 420px); }
.auth-card h1 { margin: 0; font-family: 'Playfair Display', serif; font-size: 42px; }
.auth-card > p { margin: 9px 0 28px; color: var(--portal-muted); font-size: 13px; }
.auth-form { display: grid; gap: 16px; }
.auth-links { display: flex; justify-content: space-between; gap: 14px; margin-top: 18px; font-size: 11px; }
.auth-links a { color: var(--portal-burgundy); font-weight: 700; }
.auth-card .portal-button { width: 100%; margin-top: 4px; }
.auth-note { margin-top: 22px; padding: 12px; border: 1px solid var(--portal-line); border-radius: 12px; color: var(--portal-muted); background: rgba(255, 255, 255, 0.55); font-size: 10px; }
.auth-membership-cta { display: grid; gap: 7px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--portal-line); }
.auth-membership-cta span { color: var(--portal-burgundy); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.auth-membership-cta strong { font-family: 'Playfair Display', serif; font-size: 17px; line-height: 1.35; }
.auth-membership-cta .portal-button { margin-top: 6px; }
.pwa-install-button { margin-top: 10px !important; }
.pwa-install-button svg { width: 15px; height: 15px; margin-right: 6px; vertical-align: -2px; }
.auth-install { display: grid; gap: 6px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--portal-line); }
.auth-install small { color: var(--portal-muted); font-size: 10px; line-height: 1.5; }
.pwa-steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; color: var(--portal-ink); font-size: 12px; line-height: 1.55; }
.pwa-steps li::marker { color: var(--portal-burgundy); font-weight: 700; }

:focus-visible { outline: 3px solid rgba(189, 153, 96, .65); outline-offset: 3px; }

.mobile-overlay { display: none; }

@media (max-width: 1100px) {
  .portal-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .earn-grid, .reward-grid, .member-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .portal-shell { grid-template-columns: 1fr; }
  .portal-sidebar { width: min(86vw, 320px); transform: translateX(-105%); transition: transform 190ms ease; }
  body.portal-nav-open .portal-sidebar { transform: translateX(0); }
  body.portal-nav-open { overflow: hidden; }
  .portal-main { grid-column: 1; padding: max(20px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(44px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); }
  .portal-menu-button { display: inline-grid; }
  .mobile-overlay { position: fixed; inset: 0; z-index: 35; background: rgba(32, 22, 26, 0.38); }
  body.portal-nav-open .mobile-overlay { display: block; }
  .portal-grid-3 { grid-template-columns: 1fr; }
  .portal-span-2 { grid-column: auto; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-story { min-height: 230px; padding: max(28px, env(safe-area-inset-top)) 28px 28px; }
  .auth-quote p { font-size: 34px; }
  .auth-panel { padding: 42px 20px; }
}

@media (max-width: 620px) {
  .portal-topbar { align-items: flex-start; margin-bottom: 24px; }
  .portal-page-title { font-size: 31px; }
  .portal-card { padding: 19px; border-radius: 18px; }
  .portal-grid-2, .portal-grid-4, .portal-form-grid, .earn-grid, .reward-grid, .member-grid { grid-template-columns: 1fr; }
  .points-hero { grid-template-columns: 1fr; text-align: center; }
  .progress-ring { width: 144px; margin: 0 auto; }
  .button-row { justify-content: center; }
  .quick-actions { grid-template-columns: 1fr; }
  .quick-action { min-height: 92px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .portal-table { min-width: 620px; }
  .portal-top-actions .portal-icon-button { display: none; }
  .portal-input, .portal-select, .portal-textarea { font-size: 16px; }
  .portal-button { min-height: 48px; }
  .auth-story { min-height: 170px; padding: max(20px, env(safe-area-inset-top)) 20px 20px; }
  .auth-story .portal-brand { padding-bottom: 20px; }
  .auth-quote p { font-size: 27px; }
  .auth-quote span { font-size: 9px; }
  .auth-card h1 { font-size: 35px; }
  .auth-panel { padding: 32px 18px max(36px, env(safe-area-inset-bottom)); place-items: start center; }
  .auth-links { align-items: flex-start; flex-direction: column; }
}

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