/* Portal styles. Extracted from portal.html on 2026-09-05: the three inline <style> blocks,
   in their original order, so the cascade is identical. Bump ?v= in portal.html on edit. */

/* ===== portal.html <style> block 1 of 3 (moved 2026-09-05; order preserved) ===== */
.portal-shell {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

.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-hero {
  text-align: center;
  margin-bottom: 2rem;
}

.portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(120, 12, 24, 0.08);
  color: var(--primary);
  font-weight: 800;
  margin-bottom: 1rem;
}

.portal-badge::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.portal-title {
  font-size: clamp(2.2rem, 5.5vw, 3.7rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary-dark), var(--accent));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.portal-subtitle {
  max-width: 700px;
  margin: 0 auto;
  color: var(--text-soft);
  line-height: 1.9;
  font-size: 1.05rem;
}

.auth-card,
.panel-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.82));
  border: 1px solid rgba(240, 233, 226, 0.95);
  border-radius: 24px;
  box-shadow: 0 18px 42px rgba(28, 8, 0, 0.08);
}

.auth-card {
  max-width: 660px;
  margin: 1.6rem auto 0;
  padding: clamp(1.25rem, 3vw, 1.65rem);
}

.auth-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 440px);
  gap: 0.35rem;
  padding: 0.35rem;
  border-radius: 999px;
  background: #fcfaf8;
  border: 1px solid #f6eee5;
  margin-bottom: 1.25rem;
}

.auth-tab {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 0.65rem 0.85rem;
  min-height: 44px;
  font-family: var(--site-font);
  font-weight: 800;
  color: var(--text-soft);
  cursor: pointer;
}

.auth-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 14px 28px rgba(120, 12, 24, 0.22);
}

.auth-trust-note {
  margin-top: 1rem;
  padding: 0.8rem 0.95rem;
  border-radius: 16px;
  border: 1px solid rgba(203, 164, 117, 0.14);
  background: rgba(120, 12, 24, 0.05);
  color: var(--primary-dark);
  font-weight: 800;
  line-height: 1.7;
}

#resetPasswordBtn {
  background: rgba(120, 12, 24, 0.04);
  border: 1px solid rgba(120, 12, 24, 0.1);
  color: var(--primary-dark);
  box-shadow: none;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 0.92rem;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid #f0e6db;
  background: #fffdfb;
  font-family: var(--site-font);
  /* Never below 1rem: iOS Safari zooms on focus for anything under 16px and does not
     zoom back, which put the login gate itself behind a panned layout. */
  font-size: 1rem;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(120, 12, 24, 0.08);
}

.field-control {
  position: relative;
}

.field .field-control input {
  padding-inline-start: 2.75rem;
}

.field .field-control.has-toggle input {
  padding-inline-end: 2.75rem;
}

.field-control .field-icon {
  position: absolute;
  inset-inline-start: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  width: 19px;
  height: 19px;
  color: #b8a794;
  pointer-events: none;
}

.field-control input:focus ~ .field-icon {
  color: var(--primary);
}

.field-toggle-password {
  position: absolute;
  inset-inline-end: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  color: #b8a794;
  padding: 0;
}

.field-toggle-password svg {
  width: 19px;
  height: 19px;
}

.field-toggle-password:hover,
.field-toggle-password:focus-visible {
  color: var(--primary);
  background: rgba(120, 12, 24, 0.06);
  outline: none;
}

.field-toggle-password:focus-visible {
  box-shadow: 0 0 0 3px rgba(120, 12, 24, 0.25);
}

.field-control.is-invalid input {
  border-color: #dc2626;
}

.field-control.is-valid input {
  border-color: #15803d;
}

.field-hint {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.field-hint-error {
  color: #dc2626;
}

.field-hint-success {
  color: #15803d;
}

.helper {
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.75;
}

#authMessage {
  margin-top: 1rem;
  font-weight: 700;
}

.auth-banner.is-active {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  background: color-mix(in srgb, currentColor 8%, transparent);
}

.auth-banner.is-active::before {
  content: "!";
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin-top: 0.1rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  color: #fff;
  background: currentColor;
}

.auth-banner.is-active.auth-banner-success::before {
  content: "\2713";
}

.panel-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.btn-portal {
  position: relative;
  border: none;
  border-radius: 18px;
  padding: 1rem 1.3rem;
  font-family: var(--site-font);
  font-weight: 800;
  cursor: pointer;
}

.btn-portal[aria-busy="true"] {
  color: transparent !important;
  pointer-events: none;
}

.btn-portal[aria-busy="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: btnSpin 0.7s linear infinite;
}

.btn-muted-portal[aria-busy="true"]::after {
  border-color: rgba(120, 12, 24, 0.2);
  border-top-color: var(--primary);
}

@keyframes btnSpin {
  to {
    transform: rotate(360deg);
  }
}

.btn-primary-portal {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 15px 30px rgba(120, 12, 24, 0.22);
}

.btn-muted-portal {
  background: #fbf5ee;
  color: var(--primary-dark);
}

.status-box {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: rgba(120, 12, 24, 0.05);
  border: 1px solid rgba(203, 164, 117, 0.14);
  color: var(--text-soft);
  line-height: 1.8;
}

.dashboard {
  display: grid;
  gap: 1.15rem;
}

.member-spotlight {
  --role-accent: var(--primary);
  --sadu-frame: 24px;
  position: relative;
  overflow: hidden;
  padding-block: 1rem;
  padding-inline-end: 1rem;
  padding-inline-start: calc(var(--sadu-frame) + 1rem);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(203, 164, 117, 0.16), transparent 28%),
    radial-gradient(circle at bottom left, rgba(203, 164, 117, 0.18), transparent 35%),
    linear-gradient(145deg, rgba(255, 252, 248, 0.98), rgba(255, 244, 231, 0.94));
  border: 1px solid rgba(254, 225, 191, 0.9);
  box-shadow: 0 16px 34px rgba(28, 8, 0, 0.07);
}

.member-spotlight::after {
  content: "";
  position: absolute;
  inset: auto -70px -70px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(203, 164, 117, 0.12), transparent 70%);
  pointer-events: none;
}

.member-avatar-shell {
  width: 84px;
  height: 84px;
  padding: 4px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(120, 12, 24, 0.2), rgba(203, 164, 117, 0.4));
  box-shadow: 0 16px 30px rgba(120, 12, 24, 0.16);
  flex-shrink: 0;
}

.member-avatar-shell img {
  width: 100%;
  height: 100%;
  border-radius: 20px;
  object-fit: cover;
  background: #fff;
  border: 1px solid rgba(240, 230, 219, 0.9);
}

.member-copy small {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  color: var(--role-accent, var(--primary));
  font-weight: 800;
  margin-bottom: 0.6rem;
}

.member-copy :is(h1, h2) {
  color: var(--primary-dark);
  line-height: 1.05;
  margin: 0 0 0.45rem;
}

.member-copy p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.75;
}

.member-welcome-message {
  margin: 0 0 0.35rem;
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.6;
}

.member-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.member-quick-links-minor {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.member-quick-links-minor .mini-action {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(240, 230, 219, 0.85);
  color: var(--text-muted);
  font-size: 0.82rem;
  min-height: 36px;
  padding: 0.5rem 0.8rem;
}

.member-action-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  min-height: 44px;
  text-decoration: none;
  border: 1px solid rgba(240, 230, 219, 0.95);
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 0.9rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.member-action-link:hover {
  border-color: rgba(156, 21, 36, 0.4);
}

.member-action-link:focus-visible,
.btn-portal:focus-visible,
.mini-action:focus-visible,
.summary-box:focus-visible,
.auth-tab:focus-visible,
.profile-tab:focus-visible,
.notification-tab:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}

.member-action-link span:last-child {
  color: var(--role-accent, var(--primary));
  font-size: 1rem;
}

.role-badges {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.role-chip {
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: rgba(120, 12, 24, 0.08);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.84rem;
}

.role-chip.volunteer {
  background: rgba(203, 164, 117, 0.18);
  color: #8A5A22;
}

.role-chip.hybrid {
  background: rgba(22, 163, 74, 0.1);
  color: #15803d;
}

.logout-action {
  display: block;
  width: 100%;
  margin-top: 0.7rem;
  min-height: 44px;
  padding: 0.7rem 0.9rem;
  background: rgba(252, 250, 248, 0.92);
  color: var(--text-muted);
  box-shadow: none;
  border: 1px solid rgba(225, 215, 203, 0.9);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr;
  gap: 1.5rem;
  align-items: start;
}

.dashboard-grid > #profileSection {
  grid-column: 1 / -1;
  position: relative;
  z-index: 2;
  background: #ffffff;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.summary-box {
}

a.summary-box {
  display: block;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

a.summary-box:hover {
  transform: translateY(-2px);
  border-color: rgba(156, 21, 36, 0.45);
  box-shadow: 0 14px 24px rgba(120, 12, 24, 0.08);
}

.summary-box span {
  display: block;
  color: #b8a794;
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 0.22rem;
}

.summary-box strong {
  color: var(--primary-dark);
}

.profile-progress {
  margin: 0 0 1.25rem;
  padding: 1rem 1.05rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(120, 12, 24, 0.06), rgba(203, 164, 117, 0.08));
  border: 1px solid rgba(203, 164, 117, 0.14);
}

.profile-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.7rem;
  flex-wrap: wrap;
}

.profile-progress-head strong {
  color: var(--primary-dark);
  font-size: 0.96rem;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(184, 167, 148, 0.18);
  overflow: hidden;
}

.progress-value {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  transition: width 0.25s ease;
}

.profile-photo-wrap {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.profile-photo {
  object-fit: cover;
  border: 1px solid #f0e6db;
  box-shadow: 0 14px 26px rgba(28, 8, 0, 0.1);
  background: white;
}

.portal-focus-card {
  border: 1px solid rgba(203, 164, 117, 0.18);
}

.portal-focus-card strong {
  display: block;
  color: var(--primary-dark);
  font-size: 1rem;
  margin-bottom: 0.45rem;
}

.portal-focus-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.8;
  font-size: 0.92rem;
}

.stack-list {
  display: grid;
  gap: 0.8rem;
  min-height: 96px;
}

.stack-list.is-loading {
  min-height: 220px;
}

.list-card {
  padding: 0.95rem 1rem;
  border: 1px solid #f8f0e6;
  animation: listCardEnter 0.28s ease both;
}

.stack-list .list-card:nth-child(2) {
  animation-delay: 45ms;
}

.stack-list .list-card:nth-child(3) {
  animation-delay: 90ms;
}

.stack-list .list-card:nth-child(n + 4) {
  animation-delay: 120ms;
}

.list-card :is(h3, h4) {
  color: var(--primary-dark);
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

.list-card p {
  color: var(--text-soft);
  line-height: 1.75;
  font-size: 0.92rem;
}

.certificate-card-preview {
  margin-bottom: 0.85rem;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #f5e9db;
  background: #ffffff;
  aspect-ratio: 16 / 9;
  max-height: 220px;
}

.certificate-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fcfaf8;
  display: block;
}

.notification-list {
  display: grid;
  gap: 0.85rem;
}

.notification-card {
  padding: 1rem 1.05rem;
  border: 1px solid rgba(203, 164, 117, 0.14);
  border-inline-start: 3px solid transparent;
}

.notification-card.unread {
  border-inline-start-color: var(--primary);
}

.notification-card.important {
  border-inline-start-color: #b45309;
}

.notification-card strong {
  display: block;
  color: var(--primary-dark);
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

.notification-card p {
  color: var(--text-soft);
  line-height: 1.8;
  font-size: 0.9rem;
  margin: 0;
}

.notification-time {
  display: inline-flex;
  margin-top: 0.6rem;
  padding: 0.34rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.34rem 0.6rem;
  border-radius: 999px;
  background: rgba(120, 12, 24, 0.08);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
}

.toolbar-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.toolbar-row input,
.toolbar-row select {
  flex: 1 1 220px;
  min-width: 0;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  border: 1px solid #f0e6db;
  background: #fffdfb;
  font-family: var(--site-font);
  font-size: 1rem;
}

.toolbar-row input:focus,
.toolbar-row select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(120, 12, 24, 0.08);
}

.empty-state {
  padding: 1.1rem;
  border-radius: 20px;
  background: #fcfaf8;
  border: 1px dashed #ece3d8;
  color: var(--text-soft);
  line-height: 1.8;
  animation: listCardEnter 0.22s ease both;
}

.loading-skeleton {
  display: grid;
  gap: 0.75rem;
}

.skeleton-card {
  min-height: 92px;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.98), rgba(255, 255, 255, 0.94));
  border: 1px solid rgba(240, 230, 219, 0.95);
  overflow: hidden;
}

.skeleton-line {
  display: block;
  height: 0.7rem;
  max-width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f8f0e6 0%, #fffcf8 45%, #f8f0e6 90%);
  background-size: 220% 100%;
  animation: skeletonPulse 1.1s ease-in-out infinite;
}

.skeleton-line + .skeleton-line {
  margin-top: 0.7rem;
}

.skeleton-line.short {
  width: 34%;
}

.skeleton-line.medium {
  width: 58%;
}

.skeleton-line.long {
  width: 82%;
}

.info-state {
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: rgba(120, 12, 24, 0.05);
  border: 1px solid rgba(203, 164, 117, 0.16);
  color: var(--text-soft);
  line-height: 1.75;
  font-size: 0.92rem;
}

.error-state {
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: rgba(220, 38, 38, 0.05);
  border: 1px solid rgba(220, 38, 38, 0.14);
  color: #b91c1c;
  line-height: 1.75;
  font-size: 0.92rem;
}

.member-copy {
  max-width: 620px;
  min-width: 0;
}

.member-copy small {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(254, 225, 191, 0.9);
  box-shadow: 0 12px 30px rgba(203, 164, 117, 0.08);
}

.member-copy :is(h1, h2) {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  margin-bottom: 0.45rem;
}

.member-copy p {
  font-size: 0.94rem;
  overflow-wrap: anywhere;
}

.member-quick-actions {
  gap: 0.55rem;
  align-content: start;
}

.member-action-link {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.member-action-link {
  padding: 0.72rem 0.82rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
}

.member-action-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(120, 12, 24, 0.08);
}

.dashboard-section-card {
  position: relative;
  overflow: hidden;
  padding: 1.15rem;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 252, 248, 0.94));
  border: 1px solid rgba(240, 230, 219, 0.95);
  box-shadow: none;
}

.dashboard-section-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 40%);
  pointer-events: none;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.95rem;
  position: relative;
  z-index: 1;
}

.section-heading small {
  display: block;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.section-heading :is(h2, h3) {
  color: var(--primary-dark);
  font-size: 1.2rem;
  margin: 0;
}

.section-heading p {
  margin: 0.35rem 0 0;
  color: var(--text-soft);
  line-height: 1.6;
  font-size: 0.86rem;
  max-width: 560px;
}

.section-heading.compact {
  margin-bottom: 1rem;
}

.dashboard-summary-grid {
  margin-bottom: 0.9rem;
}

.summary-box {
  padding: 0.85rem 0.9rem;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 249, 243, 0.92));
  border: 1px solid rgba(240, 230, 219, 0.95);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.summary-box strong {
  font-size: 0.98rem;
}

#participationCountValue,
#certificateCountValue,
#volunteerHoursValue {
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--primary);
}

.summary-box:has(#participationCountValue) {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 248, 239, 0.88));
}

.summary-box:has(#certificateCountValue) {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 253, 244, 0.88));
}

.summary-progress-track {
  margin-top: 0.5rem;
  height: 5px;
  border-radius: 999px;
  background: rgba(203, 164, 117, 0.18);
  overflow: hidden;
}

.summary-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.4s ease;
}

.summary-progress-caption {
  display: block;
  margin-top: 0.35rem;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.4;
}

.member-card-lite,
.featured-preview-card {
  border-radius: 18px;
  border: 1px solid rgba(240, 230, 219, 0.92);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 252, 248, 0.92));
}

.member-card-lite {
  position: relative;
  overflow: hidden;
  min-height: 178px;
  padding: 1rem;
  background:
    radial-gradient(circle at top right, rgba(203, 164, 117, 0.14), transparent 34%),
    linear-gradient(145deg, rgba(120, 12, 24, 0.95), rgba(203, 164, 117, 0.9));
  color: #ffffff;
}

.member-card-lite::after {
  content: "";
  position: absolute;
  inset: auto -42px -42px auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.member-card-lite-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.member-card-lite img {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.member-card-lite strong,
.member-card-lite span {
  position: relative;
  z-index: 1;
}

.member-card-lite strong {
  display: block;
  font-size: 1rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.member-card-lite span {
  display: block;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.member-card-lite-meta {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.member-card-lite-meta .status-pill {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 0.72rem;
}

.featured-preview-card {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 0.95rem;
  padding: 0.95rem;
}

.featured-preview-card strong {
  color: var(--primary-dark);
  font-size: 0.98rem;
}

.featured-preview-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.6;
  font-size: 0.86rem;
}

.featured-preview-card .card-actions {
  margin-top: 0.1rem;
}

.privacy-note-mini {
  margin: 0;
  padding: 0 0.2rem;
  color: var(--text-soft);
  font-size: 0.82rem;
  line-height: 1.6;
}

.privacy-note-mini a {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.privacy-note-mini a:hover {
  text-decoration: underline;
}

.dashboard-section-card {
  animation: sectionEnter 0.32s ease both;
}

.dashboard-grid > #profileSection {
  animation-delay: 110ms;
}

.profile-photo-wrap > div:last-child {
  flex: 1;
  min-width: 220px;
}

.profile-photo {
  width: 96px;
  height: 96px;
  border-radius: 28px;
}

.portal-focus-card {
  padding: 1rem 1.05rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(120, 12, 24, 0.1), rgba(203, 164, 117, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.portal-focus-card.account-ready {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.08), rgba(203, 164, 117, 0.09));
  border: 1px solid rgba(34, 197, 94, 0.14);
}

.toolbar-row {
  margin-bottom: 1.15rem;
}

.notification-card,
.list-card {
  position: relative;
  z-index: 1;
}

.notification-card,
.list-card {
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.98), rgba(255, 255, 255, 0.94));
}

.preview-list {
  min-height: 0;
}

.preview-list .list-card {
  padding: 0.9rem 0.95rem;
}

.preview-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(240, 230, 219, 0.85);
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 800;
}

/* Desktop-only: unguarded, this rule's higher specificity (.preview-footer .mini-action)
   would otherwise beat the @media(max-width:768px) .mini-action{min-height:44px} touch-
   target rule below regardless of source order, silently keeping this button under 44px
   on mobile. */
@media (min-width: 769px) {
  .preview-footer .mini-action {
    min-height: 42px;
  }
}

.preview-note {
  margin: 0;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.95rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(254, 225, 191, 0.9);
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 0.82rem;
}

.status-pill::before,
.notification-card::before {
  content: "";
}

.status-pill::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.status-pill.accepted,
.status-pill.approved,
.status-pill.active {
  background: rgba(22, 163, 74, 0.1);
  border-color: rgba(22, 163, 74, 0.22);
  color: #15803d;
}

.status-pill.accepted::before,
.status-pill.approved::before,
.status-pill.active::before {
  background: #15803d;
}

.status-pill.pending,
.status-pill.pending_review,
.status-pill.pending_verification,
.status-pill.pending_link {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.25);
  color: #b45309;
}

.status-pill.pending::before,
.status-pill.pending_review::before,
.status-pill.pending_verification::before,
.status-pill.pending_link::before {
  background: #b45309;
}

.status-pill.rejected {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.22);
  color: #b91c1c;
}

.status-pill.rejected::before {
  background: #b91c1c;
}

.portal-focus-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 0.9rem;
}

.mini-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0.65rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(203, 164, 117, 0.18);
  background: rgba(255, 255, 255, 0.82);
  color: var(--primary-dark);
  font-family: var(--site-font);
  font-weight: 800;
  font-size: 0.86rem;
  text-decoration: none;
  cursor: pointer;
}

.completion-missing-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.missing-chip {
  padding: 0.38rem 0.62rem;
  border-radius: 999px;
  background: rgba(203, 164, 117, 0.08);
  border: 1px solid rgba(203, 164, 117, 0.14);
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.profile-tabs,
.notification-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.profile-tab,
.notification-tab {
  min-height: 40px;
  border: 1px solid #f0e6db;
  background: #fffcf8;
  color: var(--text-soft);
  border-radius: 999px;
  padding: 0.6rem 0.85rem;
  font-family: var(--site-font);
  font-weight: 800;
  cursor: pointer;
}

.profile-tab.active,
.notification-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(120, 12, 24, 0.16);
}

.empty-state {
  display: grid;
  gap: 0.75rem;
}

.empty-state strong {
  display: block;
  color: var(--primary-dark);
  font-size: 1rem;
}

.empty-state p {
  margin: 0;
  color: var(--text-soft);
}

.empty-state .mini-action {
  width: fit-content;
}

.empty-state-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(120, 12, 24, 0.08);
  color: var(--primary);
}

.empty-state-icon svg {
  width: 22px;
  height: 22px;
}

.list-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.45rem;
}

.list-card-header :is(h3, h4) {
  margin: 0;
}

.status-chip {
  flex: 0 0 auto;
  padding: 0.38rem 0.62rem;
  border-radius: 999px;
  background: rgba(120, 12, 24, 0.08);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
}

.attachment-chip {
  background: rgba(203, 164, 117, 0.16);
  color: #8A5A22;
}

.attachment-chip.unavailable {
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
}

#dashboardName,
#dashboardEmail,
.list-card :is(h3, h4),
.list-card p,
.meta-chip {
  overflow-wrap: anywhere;
}

.meta-chip.team {
  font-weight: 800;
  color: var(--primary-dark);
  background: rgba(120, 12, 24, 0.08);
  border-color: rgba(120, 12, 24, 0.18);
}

.status-chip.accepted,
.status-chip.approved,
.status-chip.active {
  background: rgba(22, 163, 74, 0.1);
  color: #15803d;
}

.status-chip.pending,
.status-chip.pending_review,
.status-chip.pending_verification {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

.status-chip.rejected {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.85rem;
}

.notification-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
  position: relative;
  z-index: 1;
}

.notification-card {
  padding-inline-start: 1.25rem;
}

.notification-card::before {
  position: absolute;
  inset-inline-start: 0.85rem;
  top: 1.15rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(184, 167, 148, 0.7);
}

.notification-card.unread::before {
  background: var(--primary);
  box-shadow: 0 0 0 5px rgba(203, 164, 117, 0.08);
}

.notification-card.important {
  border-color: rgba(245, 158, 11, 0.22);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(255, 255, 255, 0.94));
}

.notification-card.read {
  opacity: 0.78;
}

.mobile-portal-nav {
  display: none;
}

@keyframes listCardEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sectionEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes skeletonPulse {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .list-card,
  .empty-state,
  .dashboard-section-card,
  .skeleton-line {
    animation: none !important;
  }

  a.summary-box,
  .member-action-link,
  .btn-portal,
  .mini-action {
    transition: none !important;
  }
}

@media (max-width: 900px) {
  .portal-shell {
    padding-inline: 1.1rem;
    padding-bottom: 6rem;
  }

  .portal-hero {
    margin-bottom: 1.7rem;
  }

  .dashboard-grid, .form-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-photo-wrap {
    justify-content: flex-start;
  }

  .auth-card,
  .panel-card {
    border-radius: 24px;
  }

  .auth-card {
    margin-top: 1.4rem;
    padding: 1.55rem;
  }
}

@media (max-width: 768px) {
  .portal-shell {
    padding-inline: 1rem;
    padding-bottom: 6.25rem;
  }

  /* Touch targets: 40px/36px is comfortable for a cursor but under the
     44px minimum for a fingertip, so these grow on touch widths only.
     #photoInput is an unstyled native file picker, ~22px tall by default. */
  .profile-tab,
  .notification-tab,
  .member-quick-links-minor .mini-action,
  .mini-action,
  #photoInput {
    min-height: 44px;
  }

  .field-toggle-password {
    width: 44px;
    height: 44px;
  }

  .dashboard-grid {
    gap: 1rem;
  }

  .section-heading {
    margin-bottom: 0.8rem;
  }

  .stack-list.is-loading {
    min-height: 190px;
  }
}

@media (max-width: 640px) {
  body {
    padding-bottom: 86px;
  }

  .member-spotlight {
    --sadu-frame: 18px;
    padding-block: 0.85rem;
    padding-inline-end: 0.85rem;
    padding-inline-start: calc(var(--sadu-frame) + 0.85rem);
  }

  .dashboard-section-card {
    padding: 1.2rem;
    border-radius: 24px;
  }

  .member-avatar-shell {
    width: 74px;
    height: 74px;
  }

  .member-copy :is(h1, h2) {
    font-size: 1.5rem;
  }

  .member-action-link,
  .btn-portal {
    width: 100%;
    justify-content: center;
  }

  .member-quick-actions {
    grid-template-columns: 1fr;
    gap: 0.48rem;
  }

  .logout-action {
    margin-top: 0.15rem;
  }

      .portal-focus-actions,
      .card-actions,
      .notification-toolbar,
      .toolbar-row,
      .profile-tabs,
      .notification-tabs {
        display: grid;
        grid-template-columns: 1fr;
      }

      .auth-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
      }

      .auth-tab,
      .profile-tab,
      .notification-tab,
      .summary-box,
      .meta-chip,
      .status-pill {
        min-width: 0;
        overflow-wrap: anywhere;
      }

  .list-card-header {
    display: grid;
  }

  .meta-row {
    gap: 0.45rem;
  }

  .mobile-portal-nav {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
    padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.94);
    border-top: 1px solid rgba(240, 230, 219, 0.95);
    box-shadow: 0 -16px 34px rgba(28, 8, 0, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .mobile-portal-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-height: 52px;
    border-radius: 16px;
    background: #fffcf8;
    color: var(--primary-dark);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 800;
  }

  .mobile-portal-nav .nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-portal-nav .nav-icon svg {
    width: 100%;
    height: 100%;
  }

  .mobile-portal-nav a.active,
  .mobile-portal-nav a[aria-current="location"] {
    background: rgba(120, 12, 24, 0.1);
    color: var(--primary);
  }
}

@media (max-width: 430px) {
  .portal-shell {
    padding-inline: 0.9rem;
    padding-bottom: 6.5rem;
  }

  .portal-hero {
    margin-bottom: 1.15rem;
  }

  .portal-title {
    font-size: 2.15rem;
  }

  .member-spotlight {
    --sadu-frame: 14px;
    padding-block: 0.75rem;
    padding-inline-end: 0.75rem;
    padding-inline-start: calc(var(--sadu-frame) + 0.75rem);
    border-radius: 22px;
  }

  .member-copy small {
    margin-bottom: 0.45rem;
  }

  .member-action-link {
    padding: 0.68rem 0.62rem;
    font-size: 0.82rem;
  }

  .dashboard-section-card {
    padding: 1rem;
    border-radius: 20px;
  }

  .summary-grid {
    gap: 0.55rem;
  }

  .summary-box {
    padding: 0.72rem 0.75rem;
  }

  .empty-state {
    padding: 0.9rem;
    border-radius: 16px;
    gap: 0.55rem;
  }

  .preview-footer {
    display: grid;
    gap: 0.65rem;
  }

  .preview-footer .mini-action {
    width: 100%;
  }

  .member-card-lite {
    min-height: 154px;
  }

  .skeleton-card {
    min-height: 82px;
    padding: 0.82rem 0.9rem;
  }

  .stack-list.is-loading {
    min-height: 176px;
  }

  .member-action-link,
  .btn-portal {
    min-height: 44px;
  }
}

@media (max-width: 390px) {
  .summary-box span {
    font-size: 0.72rem;
  }

  .summary-box strong {
    font-size: 0.88rem;
  }

  .portal-shell {
    padding-bottom: 7rem;
  }

  .dashboard-grid, .stack-list {
    gap: 0.75rem;
  }

  .mobile-portal-nav {
    gap: 0.5rem;
    padding-inline: 0.55rem;
  }

  .mobile-portal-nav a {
    min-height: 46px;
    border-radius: 14px;
    font-size: 0.72rem;
  }
}

/* ===== portal.html <style> block 2 of 3 (moved 2026-09-05; order preserved) ===== */
/* ==== بوابة الدخول بالهوية العنابية ====
   تُطبق فقط قبل تسجيل الدخول (ما دامت بطاقة الدخول ظاهرة) عبر :has —
   بعد الدخول تختفي البطاقة فيرجع كل شيء لتصميم اللوحة كما هو.
   المتصفحات القديمة بلا :has تعرض التصميم الفاتح الحالي بلا كسر. */
body:has(#authCard:not([hidden])) {
  position: relative;
}

body:has(#authCard:not([hidden]))::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 520px;
  background: linear-gradient(160deg, #38040A 0%, #4E0710 42%, #780C18 82%, #8E1220 100%);
  z-index: 0;
}

/* المحتوى فوق الشريط العنابي — بدون لمس الناف بار الثابت (position: fixed من site.css) */
body:has(#authCard:not([hidden])) .portal-shell {
  position: relative;
  z-index: 1;
}

/* الناف بار الغامق فوق البوابة العنابية يأتي من site.css (.navbar:not(.over-light))؛
   سكربت البوابة يضيف .over-light عندما تختفي بطاقة الدخول. */

/* عنوان البوابة على الخلفية الغامقة */
body:has(#authCard:not([hidden])) .portal-badge {
  background: rgba(232, 199, 160, 0.12);
  border: 1px solid rgba(232, 199, 160, 0.3);
  color: var(--hx-gold);
}

body:has(#authCard:not([hidden])) .portal-badge::before {
  background: var(--hx-gold);
}

body:has(#authCard:not([hidden])) .portal-title {
  font-family: 'Amiri', 'Amiri Fallback', var(--font-ui, 'Tajawal'), serif !important;
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  color: var(--hx-cream) !important;
  -webkit-text-fill-color: var(--hx-cream) !important;
  text-shadow: 0 10px 36px rgba(0, 0, 0, 0.35);
  letter-spacing: 0 !important;
}

body:has(#authCard:not([hidden])) .portal-subtitle {
  color: var(--hx-cream-soft);
}

/* مزايا البوابة تحت بطاقة الدخول — تختفي مع البطاقة بعد الدخول */
#portalPerks {
  max-width: 660px;
  margin: 1rem auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

body:has(#authCard[hidden]) #portalPerks { display: none; }

.portal-perk {
  padding: 0.95rem 0.8rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(240, 233, 226, 0.95);
  box-shadow: 0 12px 30px -24px rgba(28, 8, 0, 0.35);
  text-align: center;
}

.portal-perk-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 0.5rem;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(120, 12, 24, 0.1), rgba(203, 164, 117, 0.1));
  color: var(--primary);
}

.portal-perk-icon svg {
  width: 20px;
  height: 20px;
}

.portal-perk :is(h2, h3) {
  margin: 0 0 0.2rem;
  color: var(--primary-dark);
  font-size: 0.92rem;
  font-weight: 900;
}

.portal-perk p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.78rem;
  line-height: 1.55;
  font-weight: 700;
}

@media (max-width: 640px) {
  #portalPerks {
    grid-template-columns: 1fr;
  }

  body:has(#authCard:not([hidden]))::before {
    height: 560px;
  }
}

/* ===== portal.html <style> block 3 of 3 (moved 2026-09-05; order preserved) ===== */
/* ==== الجولة الثانية: لوحة بهوية الموقع ==== */

/* في وضع اللوحة نخفي ترويسة الصفحة العلوية ونقرّب الشريط من شريط التنقل */
body:has(#dashboardPanel:not([hidden])) .portal-hero { display: none; }
body:has(#dashboardPanel:not([hidden])) { padding-top: 104px; }

section.dashboard { display: block; }

/* ==== الشريط العنابي ==== */
.dashboard .member-spotlight {
  margin-inline: calc(50% - 50vw);
  padding: 2.4rem clamp(1.1rem, 4vw, 2rem) 3.6rem;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  background:
    radial-gradient(circle at 16% -12%, rgba(232, 199, 160, 0.16), transparent 42%),
    radial-gradient(circle at 92% 118%, rgba(232, 199, 160, 0.09), transparent 40%),
    linear-gradient(160deg, #38040A 0%, #4E0710 42%, #780C18 82%, #8E1220 100%);
}

.dashboard .member-spotlight::after { content: none; }

.member-band-inner {
  width: min(100%, 1040px);
  margin: 0 auto;
  display: grid;
  gap: 1.7rem;
}

.member-id-row {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  flex-wrap: wrap;
}

.dashboard .member-avatar-shell {
  width: 86px;
  height: 86px;
  padding: 0;
  border-radius: 50%;
  background: #4E0710;
  overflow: hidden;
  border: 3px solid rgba(232, 199, 160, 0.85);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

.dashboard .member-avatar-shell img {
  border-radius: 50%;
  border: none;
}

.dashboard .member-copy { flex: 1; min-width: 230px; }

.dashboard .member-spotlight #dashboardModeLabel {
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 0.2rem;
  color: #E8C7A0;
  font-weight: 900;
  font-size: 0.84rem;
  letter-spacing: 0.03em;
}

.dashboard .member-spotlight #dashboardName {
  font-family: 'Amiri', 'Amiri Fallback', var(--font-ui, 'Tajawal'), serif;
  color: #FDF9F2;
  letter-spacing: 0;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.15;
  text-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
  margin: 0 0 0.3rem;
}

.dashboard .member-spotlight .member-welcome-message,
.dashboard .member-spotlight .helper { color: rgba(246, 236, 220, 0.78); }

.member-id-chips {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}

.dashboard .member-spotlight .role-chip {
  background: #E8C7A0;
  border: none;
  color: #4E0710;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.5);
}

.dashboard .member-spotlight .status-strip { margin: 0; }

.dashboard .member-spotlight .status-pill {
  background: rgba(253, 249, 242, 0.08);
  border: 1px solid rgba(232, 199, 160, 0.3);
  color: rgba(246, 236, 220, 0.85);
}

.dashboard .member-spotlight .status-pill.active {
  color: #B9F6CE;
  border-color: rgba(74, 222, 128, 0.4);
  background: rgba(74, 222, 128, 0.08);
}

.dashboard .member-spotlight .logout-action {
  margin-inline-start: auto;
  align-self: flex-start;
  width: auto;
  background: rgba(253, 249, 242, 0.08);
  border: 1px solid rgba(232, 199, 160, 0.3);
  color: rgba(246, 236, 220, 0.9);
}

/* أرقامك داخل الشريط */
.dashboard .member-spotlight .dashboard-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0;
}

/* قواعد قديمة تستهدف الصناديق بمعرّفات داخل :has فتتغلب بالأسبقية — نعادلها بنفس السلاح */
.dashboard .member-spotlight .summary-box,
.dashboard .member-spotlight .summary-box:has(#participationCountValue),
.dashboard .member-spotlight .summary-box:has(#certificateCountValue) {
  background: rgba(253, 249, 242, 0.07);
  border: 1px solid rgba(232, 199, 160, 0.22);
  border-radius: 18px;
  padding: 0.95rem 1.05rem;
  box-shadow: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dashboard .member-spotlight a.summary-box:hover {
  border-color: rgba(232, 199, 160, 0.5);
  background: rgba(253, 249, 242, 0.11);
  transform: translateY(-2px);
  box-shadow: none;
}

.dashboard .member-spotlight .summary-box span {
  color: rgba(246, 236, 220, 0.75);
  font-size: 0.78rem;
}

.dashboard .member-spotlight .summary-box strong {
  font-family: 'Amiri', 'Amiri Fallback', var(--font-ui, 'Tajawal'), serif;
  color: #E8C7A0 !important;
  font-size: 1.75rem;
  line-height: 1.1;
}

.dashboard .member-spotlight .summary-box #latestTrackValue { font-size: 1.3rem; }

.dashboard .member-spotlight .summary-progress-track { background: rgba(253, 249, 242, 0.15); }

.dashboard .member-spotlight .summary-progress-fill {
  background: linear-gradient(90deg, #CBA475, #E8C7A0);
}

.dashboard .member-spotlight .summary-progress-caption { color: rgba(246, 236, 220, 0.6); }

.summary-box[hidden] { display: none !important; }

/* ==== السكة اللاصقة ==== */
#portalSectionRail {
  position: sticky;
  top: 90px;
  z-index: 900;
  display: flex;
  gap: 0.35rem;
  width: fit-content;
  max-width: 100%;
  margin: -1.75rem auto 0;
  padding: 0.45rem;
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.92);
  border: 1px solid rgba(232, 199, 160, 0.45);
  box-shadow: 0 18px 40px -20px rgba(56, 4, 10, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#portalSectionRail a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.4rem 1.02rem;
  border-radius: 999px;
  color: var(--primary);
  font-size: 0.86rem;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

#portalSectionRail a:hover { background: rgba(120, 12, 24, 0.08); }

#portalSectionRail a.is-active {
  background: var(--primary);
  color: #fff;
}

/* ==== خطوتك التالية كشريط واحد ==== */
.dashboard > .portal-focus-card {
  display: flex;
  align-items: center;
  gap: 0.35rem 0.9rem;
  flex-wrap: wrap;
  margin: 1.35rem 0 0;
  padding: 0.85rem 1.15rem;
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(232, 199, 160, 0.22), rgba(232, 199, 160, 0.07));
  border: 1px solid rgba(203, 164, 117, 0.4);
}

.dashboard > .portal-focus-card strong {
  color: var(--primary-dark);
  font-size: 0.95rem;
  margin: 0;
}

.dashboard > .portal-focus-card p {
  flex: 1;
  min-width: 220px;
  margin: 0;
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.6;
}

.dashboard > .portal-focus-card .portal-focus-actions {
  margin-inline-start: auto;
  margin-top: 0;
}

.dashboard > .portal-focus-card.account-ready {
  border-inline-start: 4px solid #15803d;
}

/* ==== شبكة الأقسام ==== */
.dashboard .dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.3rem;
  margin-top: 1.3rem;
  align-items: start;
}

.dashboard .dashboard-grid > #certificatesSection,
.dashboard .dashboard-grid > #participationsSection,
.dashboard .dashboard-grid > #profileSection,
.dashboard .dashboard-grid > #requestsSection,
.dashboard .dashboard-grid > #journeySection,
.dashboard .dashboard-grid > .privacy-note-mini { grid-column: 1 / -1; }

.request-form { margin-bottom: 1.1rem; }
.request-form-actions { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.request-form-actions .helper { margin: 0; }

.request-reply {
  margin-top: 0.7rem;
  padding: 0.75rem 0.95rem;
  border-radius: 14px;
  background: rgba(21, 128, 61, 0.07);
  border: 1px solid rgba(21, 128, 61, 0.2);
  color: var(--text-main);
  font-size: 0.92rem;
  line-height: 1.7;
}
.request-reply strong { display: block; color: #15803d; font-size: 0.85rem; margin-bottom: 0.2rem; }

.journey-list { display: grid; gap: 0; position: relative; padding-inline-start: 1.4rem; }
.journey-list::before {
  content: ''; position: absolute; top: 0.6rem; bottom: 0.6rem; inset-inline-start: 0.42rem;
  width: 2px; background: rgba(120, 12, 24, 0.18);
}
.journey-item { position: relative; padding: 0.55rem 0 0.9rem; }
.journey-item::before {
  content: ''; position: absolute; inset-inline-start: -1.4rem; top: 0.95rem;
  width: 0.85rem; height: 0.85rem; border-radius: 50%;
  background: #fff; border: 3px solid var(--primary);
}
.journey-item.done::before { background: var(--primary); }
.journey-item strong { display: block; color: var(--primary-dark); font-size: 0.95rem; }
.journey-item p { margin: 0.15rem 0 0; color: var(--text-soft); font-size: 0.88rem; line-height: 1.6; }
.journey-item .journey-date { display: block; color: var(--text-muted); font-size: 0.78rem; font-weight: 750; margin-top: 0.2rem; }

.dashboard .dashboard-grid:not(:has(#portalUpcomingEvents)) > #notificationsSection { grid-column: 1 / -1; }

/* ==== بطاقات الأقسام ==== */
.dashboard .panel-card.dashboard-section-card {
  border-radius: 22px;
  border: 1px solid rgba(240, 233, 226, 0.95);
  background: #fff;
  box-shadow: 0 18px 42px -26px rgba(28, 8, 0, 0.16);
}

.dashboard .dashboard-section-card::before { content: none; }

.dashboard .section-heading { margin-bottom: 1.05rem; }

.dashboard .section-heading small {
  color: #B08D5F;
  font-weight: 900;
  font-size: 0.76rem;
  letter-spacing: 0.05em;
}

.dashboard .section-heading :is(h2, h3) {
  font-family: 'Amiri', 'Amiri Fallback', var(--font-ui, 'Tajawal'), serif;
  color: var(--primary-dark);
  font-size: 1.5rem;
  letter-spacing: 0;
  margin: 0.1rem 0 0;
}

.dashboard .section-heading p {
  color: var(--text-soft);
  font-size: 0.85rem;
  margin: 0.25rem 0 0;
}

/* أدوات وتكرارات ما عاد لها مكان — تبقى في الصفحة للكود، مخفية عن العين */
.dashboard .toolbar-row,
.dashboard #latestCertificatePreview,
.dashboard #latestParticipationPreview,
.dashboard .notification-tabs { display: none; }

#certificatesList .list-card > p,
#participationsList .list-card > p { display: none; }

/* الميتا سطر هادئ بدل رقع متراصة */
.dashboard .meta-row { gap: 0.3rem 0.9rem; }

.dashboard .meta-chip {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 750;
}

.dashboard .attachment-chip {
  background: rgba(232, 199, 160, 0.22);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  color: #8A5A22;
  font-weight: 900;
}

.dashboard .attachment-chip.unavailable {
  background: rgba(156, 21, 36, 0.08);
  color: var(--accent);
}

/* ==== جدار الشهادات ==== */
/* auto-fit + a max track, not auto-fill + 1fr. auto-fill kept three 375px columns alive even
   with one certificate in them, so a member holding a single certificate saw it pinned to the
   inline start with two thirds of the panel empty. auto-fit collapses the empty tracks and
   justify-content centres what is left, and the 420px cap stops one certificate from
   stretching across the whole panel. */
#certificatesList {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 420px));
  justify-content: center;
  gap: 0.9rem;
}

#certificatesList .list-card {
  position: relative;
  background: linear-gradient(180deg, #fffdf9, #fdf6ec);
  border: 1px solid rgba(203, 164, 117, 0.45);
  border-top: 4px solid var(--primary);
  border-radius: 18px;
  padding-top: 1.15rem;
  overflow: hidden;
}

/* الختم الذهبي */
#certificatesList .list-card::after {
  content: "";
  position: absolute;
  top: 0.85rem;
  inset-inline-end: 0.85rem;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #F3DCC0, #CBA475 70%);
  border: 2px solid rgba(120, 12, 24, 0.25);
  box-shadow: 0 4px 10px rgba(120, 12, 24, 0.25);
  pointer-events: none;
}

#certificatesList .list-card :is(h3, h4) {
  font-family: 'Amiri', 'Amiri Fallback', var(--font-ui, 'Tajawal'), serif;
  color: var(--primary-dark);
  font-size: 1.15rem;
}

/* رأس البطاقة ينزاح عن الختم حتى لا تتغطى شارة المرفق */
#certificatesList .list-card .list-card-header {
  margin-inline-end: 2.4rem;
}

#certificatesList .card-actions .mini-action:first-child {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ==== مشاركاتي كخط زمني ==== */
#participationsList {
  position: relative;
  padding-inline-start: 26px;
}

#participationsList::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  inset-inline-start: 8px;
  width: 2px;
  background: linear-gradient(180deg, rgba(120, 12, 24, 0.35), rgba(203, 164, 117, 0.35));
}

#participationsList .list-card {
  position: relative;
  background: #fffefb;
}

#participationsList .list-card::before {
  content: "";
  position: absolute;
  top: 1.15rem;
  inset-inline-start: -24px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--primary);
  box-shadow: 0 0 0 4px rgba(120, 12, 24, 0.1);
}

/* ==== فعاليات قادمة داخل اللوحة ==== */
#portalUpcomingEvents .pue-list {
  display: grid;
  gap: 0.6rem;
}

.pue-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.75rem 0.95rem;
  border-radius: 14px;
  background: #fffefb;
  border: 1px solid rgba(240, 233, 226, 0.95);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.pue-row:hover {
  border-color: rgba(120, 12, 24, 0.3);
  transform: translateY(-2px);
}

.pue-info { display: grid; gap: 0.1rem; min-width: 0; }

.pue-info strong {
  color: var(--primary-dark);
  font-size: 0.95rem;
  font-weight: 900;
}

.pue-info span {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.pue-countdown {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(56, 4, 10, 0.85);
  color: #E8C7A0;
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.pue-info { text-decoration: none; color: inherit; }
.pue-info:hover strong { color: var(--primary); }

.pue-action-slot { display: inline-flex; margin-inline-start: auto; }

.pue-register,
.pue-registered {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 36px;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.pue-register {
  color: #fff;
  background: var(--primary);
  border: 1px solid var(--primary);
  transition: background 0.2s ease;
}
.pue-register:hover { background: var(--primary-dark); }

.pue-closed {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-muted);
  background: rgba(28, 8, 0, 0.05);
  border: 1px solid rgba(28, 8, 0, 0.12);
  white-space: nowrap;
}

.pue-registered {
  color: #15803d;
  background: rgba(21, 128, 61, 0.1);
  border: 1px solid rgba(21, 128, 61, 0.25);
}

@media (max-width: 768px) {
  .pue-register, .pue-registered { min-height: 44px; }
}

/* ==== الإشعارات المدمجة ==== */
.dashboard .notification-toolbar {
  background: none;
  border: none;
  padding: 0;
  margin: -0.3rem 0 0.8rem;
  justify-content: flex-end;
}

.dashboard .notification-card {
  background: #fffefb;
  border: 1px solid rgba(240, 233, 226, 0.95);
  border-inline-start: 3px solid transparent;
  border-radius: 14px;
  padding: 0.75rem 0.95rem;
  box-shadow: none;
}

.dashboard .notification-card::before { content: none; }

.dashboard .notification-card.unread,
.dashboard .notification-card.important {
  background: #FFFAF3;
}

.dashboard .notification-card.unread { border-inline-start-color: var(--primary); }

.dashboard .notification-time {
  color: #B08D5F;
  font-weight: 900;
  font-size: 0.72rem;
}

/* ==== الملف الشخصي ==== */
.dashboard .profile-tabs {
  display: flex;
  gap: 1.3rem;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  border-bottom: 1.5px solid rgba(232, 199, 160, 0.4);
}

.dashboard .profile-tab {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0.55rem 0.1rem;
  margin-bottom: -1.5px;
  color: var(--text-soft);
  font-weight: 850;
  border-bottom: 2.5px solid transparent;
  box-shadow: none;
}

.dashboard .profile-tab.active {
  background: none;
  color: var(--primary);
  border-bottom-color: var(--primary);
  box-shadow: none;
}

.dashboard .profile-photo {
  border-radius: 22px;
  border: 3px solid rgba(203, 164, 117, 0.55);
}

.dashboard #photoInput {
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.dashboard #photoInput::file-selector-button {
  font-family: inherit;
  margin-inline-end: 0.6rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(120, 12, 24, 0.3);
  background: #fff;
  color: var(--primary);
  font-weight: 850;
  cursor: pointer;
}

.dashboard .privacy-note-mini {
  text-align: center;
  margin: 0.4rem 0 0;
}

#certificatesSection,
#participationsSection,
#notificationsSection,
#profileSection,
#portalUpcomingEvents {
  scroll-margin-top: 158px;
}

@media (max-width: 900px) {
  .dashboard .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  body:has(#dashboardPanel:not([hidden])) { padding-top: 92px; }

  .dashboard .member-spotlight { padding: 1.9rem 1.1rem 3.4rem; }

  .dashboard .member-spotlight .dashboard-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard .member-spotlight .logout-action {
    margin-inline-start: 0;
    order: 5;
  }

  .member-id-chips {
    flex-direction: row;
    flex-wrap: wrap;
  }

  #portalSectionRail {
    top: 78px;
    margin-top: -1.6rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  #portalSectionRail::-webkit-scrollbar { display: none; }

  #portalSectionRail a { min-height: 44px; }

  .dashboard .profile-tabs {
    gap: 0.9rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .dashboard .profile-tab { min-height: 44px; white-space: nowrap; }
}

/* ===== Mobile tab bar (added 2026-09-05) =====
   Shown only while the dashboard is on screen and the viewport is a phone; the desktop
   layout is untouched. The body gets bottom padding so the footer is never covered. */
.portal-tabbar { display: none; }
@media (max-width: 768px) {
  body:has(#dashboardPanel:not([hidden])) .portal-tabbar {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: rgba(253, 249, 242, 0.94);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-top: 1px solid rgba(203, 164, 117, 0.35);
    box-shadow: 0 -12px 30px -22px rgba(28, 8, 0, 0.35);
  }
  body:has(#dashboardPanel:not([hidden])) { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .portal-tabbar a {
    display: grid;
    justify-items: center;
    gap: 3px;
    min-height: 52px;
    padding: 6px 2px;
    border-radius: 14px;
    color: var(--text-muted, #77685A);
    font-size: 0.72rem;
    font-weight: 800;
    text-decoration: none;
  }
  .portal-tabbar a svg { width: 22px; height: 22px; }
  .portal-tabbar a[aria-current="true"] { color: var(--primary, #780C18); background: rgba(120, 12, 24, 0.08); }
  .portal-tabbar a:focus-visible { outline: var(--focus-ring, 3px solid rgba(120, 12, 24, 0.42)); outline-offset: -3px; }
}


/* Added with the tablist: every panel now spans the full grid, so a form that was sized by a
   narrow column suddenly ran the width of the page. */
#requestForm {
  max-width: 640px;
  margin-inline: auto;
}

/* The rail is sticky at top:90px and 56px tall; without this, focusing a panel or following a
   deep link scrolls its heading underneath the rail. */
#portalSectionRail ~ * [role="tabpanel"],
[role="tabpanel"] {
  scroll-margin-top: 160px;
}


/* The dashboard's profile tabs carry 0.1rem of inline padding, so short labels («النبذة»)
   measured 39x44 — under the 44px minimum at touch widths. Declared after the ≤768px block
   that sets min-width:0 on the same element, or that one wins. */
@media (max-width: 768px) {
  .profile-tab {
    min-width: 44px;
  }
}
