:root {
  --portal-black: #08090b;
  --portal-ink: #16181d;
  --portal-red: #d31524;
  --portal-red-dark: #b60f1b;
  --portal-blue: #1d4ed8;
  --portal-blue-dark: #153eac;
  --portal-border: #dadde3;
  --portal-soft-border: #e7e9ee;
  --portal-muted: #68707d;
  --portal-bg: #f6f7f9;
  --portal-white: #ffffff;
  --portal-shadow: 0 14px 36px rgba(16, 24, 40, 0.06);
  --portal-control-height: 38px;
  --portal-control-height-sm: 32px;
  --portal-control-height-lg: 42px;
  --portal-control-radius: 6px;
  --portal-control-font-size: 13px;
}

.portal-r2d-achievement-shell,
.portal-r2d-wallet-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.portal-r2d-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 260px);
  gap: 24px;
  align-items: end;
  overflow: hidden;
  min-height: 238px;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(211, 21, 36, 0.18), rgba(14, 165, 233, 0.10) 46%, rgba(255, 255, 255, 0.02)),
    radial-gradient(circle at 86% 10%, rgba(248, 250, 252, 0.16), transparent 30%),
    linear-gradient(145deg, #111722, #232b37 52%, #0c0f14);
  box-shadow: 0 24px 58px rgba(10, 16, 28, 0.18);
  color: #fff;
}

.portal-r2d-hero::after {
  content: "";
  position: absolute;
  inset: auto -14% -56% 32%;
  height: 190px;
  transform: rotate(-7deg);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.11), transparent 36%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 16px);
  opacity: 0.8;
  pointer-events: none;
}

.portal-r2d-hero__copy,
.portal-r2d-hero__meter {
  position: relative;
  z-index: 1;
}

.portal-r2d-eyebrow,
.portal-r2d-section-head p,
.portal-r2d-master-card p {
  margin: 0 0 8px;
  color: #ff4051;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.portal-r2d-hero h1 {
  margin: 0;
  font-size: 38px;
  line-height: 1.12;
}

.portal-r2d-hero__copy span {
  display: block;
  max-width: 660px;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  line-height: 1.65;
}

.portal-r2d-hero__meter {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(8, 11, 18, 0.54);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.portal-r2d-hero__meter span,
.portal-r2d-hero__meter small {
  display: block;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.portal-r2d-hero__meter strong {
  display: block;
  margin: 8px 0;
  font-size: 34px;
  line-height: 1;
}

.portal-r2d-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.portal-r2d-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d31524, #f59e0b, #16a34a);
}

.portal-r2d-stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.portal-r2d-stat-strip div,
.portal-r2d-section,
.portal-r2d-panel {
  border: 1px solid #e4e7ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
}

.portal-r2d-stat-strip div {
  padding: 16px;
}

.portal-r2d-stat-strip span,
.portal-r2d-stat-strip small {
  display: block;
  color: #68707d;
  font-size: 12px;
}

.portal-r2d-stat-strip strong {
  display: block;
  margin: 4px 0;
  color: #16181d;
  font-size: 28px;
  line-height: 1;
}

.portal-r2d-section {
  padding: 20px;
}

.portal-r2d-section-head {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 16px;
}

.portal-r2d-section-head h2 {
  margin: 0;
  color: #121722;
  font-size: 22px;
  line-height: 1.25;
}

.portal-r2d-section-head > span {
  max-width: 520px;
  color: #68707d;
  font-size: 13px;
  line-height: 1.6;
  text-align: right;
}

.portal-r2d-achievement-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(136px, 1fr));
  gap: 12px;
}

.portal-r2d-achievement-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 214px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid #dfe4ed;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f9fafc);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.portal-r2d-achievement-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: #cbd5e1;
}

.portal-r2d-achievement-card:hover,
.portal-r2d-achievement-card:focus {
  transform: translateY(-3px);
  border-color: #d31524;
  box-shadow: 0 20px 44px rgba(16, 24, 40, 0.14);
  outline: none;
}

.portal-r2d-achievement-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.portal-r2d-achievement-orb {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eef2f7;
  color: #374151;
  font-weight: 900;
}

.portal-r2d-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  color: #64748b;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 700;
}

.portal-r2d-achievement-card__body h3 {
  margin: 0;
  color: #111827;
  font-size: 17px;
  line-height: 1.32;
}

.portal-r2d-achievement-card__body p,
.portal-r2d-achievement-card small {
  margin: 6px 0 0;
  color: #68707d;
  font-size: 12px;
  line-height: 1.45;
}

.portal-r2d-card-progress {
  height: 7px;
  overflow: hidden;
  margin-top: auto;
  border-radius: 999px;
  background: #e5e7eb;
}

.portal-r2d-card-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d31524, #f59e0b);
}

.portal-r2d-progress-0 { width: 0%; }
.portal-r2d-progress-5 { width: 5%; }
.portal-r2d-progress-10 { width: 10%; }
.portal-r2d-progress-15 { width: 15%; }
.portal-r2d-progress-20 { width: 20%; }
.portal-r2d-progress-25 { width: 25%; }
.portal-r2d-progress-30 { width: 30%; }
.portal-r2d-progress-35 { width: 35%; }
.portal-r2d-progress-40 { width: 40%; }
.portal-r2d-progress-45 { width: 45%; }
.portal-r2d-progress-50 { width: 50%; }
.portal-r2d-progress-55 { width: 55%; }
.portal-r2d-progress-60 { width: 60%; }
.portal-r2d-progress-65 { width: 65%; }
.portal-r2d-progress-70 { width: 70%; }
.portal-r2d-progress-75 { width: 75%; }
.portal-r2d-progress-80 { width: 80%; }
.portal-r2d-progress-85 { width: 85%; }
.portal-r2d-progress-90 { width: 90%; }
.portal-r2d-progress-95 { width: 95%; }
.portal-r2d-progress-100 { width: 100%; }

.portal-r3a-shell {
  display: grid;
  gap: 18px;
}

.portal-r3a-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 18px;
  align-items: stretch;
  padding: 28px;
  border-radius: 8px;
  color: #fff;
  background:
    radial-gradient(circle at 92% 12%, rgba(225, 29, 72, 0.25), transparent 28%),
    linear-gradient(135deg, #101827 0%, #1f2937 48%, #450a1a 100%);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
}

.portal-r3a-hero.compact {
  padding: 24px;
}

.portal-r3a-eyebrow,
.portal-r3a-panel > p,
.portal-r3a-section-head p {
  margin: 0 0 8px;
  color: #e11d48;
  font-weight: 800;
  font-size: 13px;
}

.portal-r3a-hero h1,
.portal-r3a-panel h2,
.portal-r3a-section-head h2 {
  margin: 0;
  letter-spacing: 0;
}

.portal-r3a-hero h1 {
  font-size: 34px;
  line-height: 1.15;
}

.portal-r3a-hero span {
  display: block;
  margin-top: 12px;
  max-width: 780px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 650;
  line-height: 1.8;
}

.portal-r3a-hero-card {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 150px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.38);
}

.portal-r3a-hero-card span,
.portal-r3a-hero-card small {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 700;
}

.portal-r3a-hero-card strong {
  color: #fff;
  font-size: 32px;
}

.portal-r3a-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.portal-r3a-panel {
  padding: 20px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

.portal-r3a-wide {
  grid-column: 1 / -1;
}

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

.portal-r3a-section-head > span {
  color: #667085;
  font-weight: 700;
}

.portal-r3a-checklist {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.portal-r3a-checklist li {
  padding: 11px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #667085;
  background: #f8fafc;
  font-weight: 750;
}

.portal-r3a-checklist li.is-done {
  border-color: #bbf7d0;
  color: #166534;
  background: #f0fdf4;
}

.portal-r3a-note {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  color: #475467;
  background: #f8fafc;
  font-weight: 700;
}

.portal-r3a-note.warning {
  border-color: #fecdd3;
  color: #be123c;
  background: #fff1f2;
}

.portal-r3a-stat-row,
.portal-r3a-timeline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #eef2f7;
}

.portal-r3a-stat-row span,
.portal-r3a-timeline span {
  color: #667085;
  font-weight: 700;
}

.portal-r3a-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.portal-r3a-form-grid label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-weight: 800;
}

.portal-r3a-form-grid input,
.portal-r3a-form-grid textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  color: #1f2937;
  font: inherit;
}

.portal-r3a-form-grid textarea {
  min-height: 96px;
  resize: vertical;
}

.portal-r3a-form-grid .span-2 {
  grid-column: span 2;
}

.portal-r3a-record-list {
  display: grid;
  gap: 12px;
}

.portal-r3a-record-list article {
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.portal-r3a-record-list span,
.portal-r3a-record-list small {
  display: block;
  color: #667085;
  font-weight: 750;
}

.portal-r3a-record-list strong {
  display: block;
  margin: 6px 0;
  font-size: 17px;
}

.portal-r3a-exactly-ten,
.portal-r3a-stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.portal-r3a-stat-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.portal-r3a-exactly-ten div,
.portal-r3a-stat-strip div {
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.portal-r3a-exactly-ten strong,
.portal-r3a-stat-strip strong {
  display: block;
  font-size: 28px;
}

.portal-r3a-exactly-ten span,
.portal-r3a-stat-strip span {
  color: #667085;
  font-weight: 700;
}

@media (max-width: 860px) {
  .portal-r3a-hero,
  .portal-r3a-grid,
  .portal-r3a-form-grid,
  .portal-r3a-exactly-ten,
  .portal-r3a-stat-strip {
    grid-template-columns: 1fr;
  }

  .portal-r3a-form-grid .span-2 {
    grid-column: span 1;
  }

  .portal-r3a-section-head {
    display: grid;
  }

  .portal-r3a-hero h1 {
    font-size: 29px;
  }
}

.achievement-card--active {
  border-color: rgba(22, 163, 74, 0.52);
  background: linear-gradient(180deg, #ffffff, #f2fbf5);
}

.achievement-card--active::after {
  background: linear-gradient(90deg, #16a34a, #d31524);
}

.achievement-card--active .portal-r2d-achievement-orb {
  background: #dcfce7;
  color: #166534;
}

.achievement-card--active .portal-r2d-status-pill {
  border-color: #bbf7d0;
  color: #166534;
  background: #f0fdf4;
}

.achievement-card--in-progress {
  border-color: rgba(245, 158, 11, 0.56);
  background: linear-gradient(180deg, #fff, #fffbeb);
}

.achievement-card--in-progress::after {
  background: linear-gradient(90deg, #f59e0b, #d31524);
}

.achievement-card--in-progress .portal-r2d-achievement-orb {
  background: #fff7ed;
  color: #b45309;
}

.achievement-card--locked {
  filter: grayscale(0.92);
  opacity: 0.72;
}

.achievement-card--locked:hover,
.achievement-card--locked:focus {
  filter: grayscale(0.55);
  opacity: 0.88;
}

.portal-r2d-grid,
.portal-r2d-wallet-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 18px;
  align-items: stretch;
}

.portal-r2d-specialty-grid,
.portal-r2d-privacy-grid,
.portal-r2d-collection-grid,
.portal-r2d-wallet-stack {
  display: grid;
  gap: 10px;
}

.portal-r2d-specialty-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-r2d-specialty-chip,
.portal-r2d-collection-card,
.portal-r2d-wallet-mini-card,
.portal-r2d-empty-state,
.portal-r2d-privacy-grid div {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.portal-r2d-specialty-chip {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 3px 10px;
  align-items: center;
  padding: 12px;
}

.portal-r2d-specialty-chip span {
  grid-row: span 2;
  width: 12px;
  height: 40px;
  border-radius: 999px;
  background: #cbd5e1;
}

.portal-r2d-specialty-chip strong,
.portal-r2d-collection-card strong,
.portal-r2d-wallet-mini-card strong,
.portal-r2d-empty-state strong,
.portal-r2d-privacy-grid strong {
  color: #16181d;
  font-size: 14px;
}

.portal-r2d-specialty-chip small,
.portal-r2d-collection-card small,
.portal-r2d-wallet-mini-card small,
.portal-r2d-empty-state span,
.portal-r2d-privacy-grid span {
  color: #68707d;
  font-size: 12px;
  line-height: 1.45;
}

.portal-r2d-specialty-chip.is-active {
  border-color: #fecaca;
  background: #fff5f5;
}

.portal-r2d-specialty-chip.is-active span {
  background: linear-gradient(180deg, #d31524, #f59e0b);
}

.portal-r2d-specialty-chip.is-locked {
  opacity: 0.68;
  filter: grayscale(0.85);
}

.portal-r2d-master-card {
  position: relative;
  overflow: hidden;
  min-height: 248px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(211, 21, 36, 0.26), rgba(255, 255, 255, 0.04)),
    linear-gradient(145deg, #111827, #252b36);
}

.portal-r2d-master-card__halo {
  position: absolute;
  top: -72px;
  right: -72px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
}

.portal-r2d-master-card h2,
.portal-r2d-master-card strong,
.portal-r2d-master-card span,
.portal-r2d-master-card small,
.portal-r2d-master-card .portal-r2d-meter {
  position: relative;
  z-index: 1;
}

.portal-r2d-master-card h2 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 26px;
}

.portal-r2d-master-card strong {
  display: block;
  margin-bottom: 8px;
  color: #fff;
  font-size: 18px;
}

.portal-r2d-master-card span,
.portal-r2d-master-card small {
  display: block;
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.55;
}

.portal-r2d-master-card .portal-r2d-meter {
  margin: 22px 0 8px;
}

.portal-r2d-privacy-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-r2d-privacy-grid div,
.portal-r2d-empty-state {
  padding: 14px;
}

.portal-r2d-safety-note {
  padding: 14px 16px;
  border: 1px solid #fde2e4;
  border-radius: 8px;
  background: #fff7f7;
  color: #9f1239;
  font-size: 13px;
  font-weight: 700;
}

.portal-r2d-wallet-feature {
  min-width: 0;
}

.portal-r2d-wallet-card-preview {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  padding: 24px;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(211, 21, 36, 0.42), transparent 42%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.22), transparent 24%),
    linear-gradient(145deg, #111827, #2f3643);
  box-shadow: 0 28px 64px rgba(15, 23, 42, 0.22);
}

.portal-r2d-wallet-card-preview__shine {
  position: absolute;
  inset: -40% -28% auto 42%;
  height: 220px;
  transform: rotate(28deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
}

.portal-r2d-wallet-card-preview__top,
.portal-r2d-wallet-card-preview__foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.portal-r2d-wallet-card-preview__top span {
  font-size: 25px;
  font-weight: 900;
}

.portal-r2d-wallet-card-preview__top small,
.portal-r2d-wallet-card-preview__body p,
.portal-r2d-wallet-card-preview__body span,
.portal-r2d-wallet-card-preview__foot span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.portal-r2d-wallet-card-preview__body {
  position: relative;
  z-index: 1;
  margin-top: 86px;
}

.portal-r2d-wallet-card-preview__body h2 {
  margin: 8px 0;
  color: #fff;
  font-size: 30px;
  line-height: 1.2;
}

.portal-r2d-wallet-card-preview__foot {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 22px;
}

.portal-r2d-wallet-stack {
  grid-template-columns: 1fr;
}

.portal-r2d-wallet-mini-card,
.portal-r2d-collection-card {
  padding: 14px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.portal-r2d-wallet-mini-card:hover,
.portal-r2d-wallet-mini-card:focus,
.portal-r2d-collection-card:hover {
  transform: translateY(-2px);
  border-color: #d31524;
  box-shadow: 0 14px 30px rgba(211, 21, 36, 0.12);
  outline: none;
}

.portal-r2d-wallet-mini-card span {
  display: block;
  margin-bottom: 8px;
  color: #d31524;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.portal-r2d-wallet-mini-card.is-muted {
  opacity: 0.72;
  filter: grayscale(0.75);
}

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

.portal-r2d-collection-card span {
  display: block;
  width: 34px;
  height: 5px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, #d31524, #f59e0b);
}

@media (max-width: 1280px) {
  .portal-r2d-achievement-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (max-width: 860px) {
  .portal-r2d-hero,
  .portal-r2d-grid,
  .portal-r2d-wallet-layout {
    grid-template-columns: 1fr;
  }

  .portal-r2d-section-head {
    align-items: start;
    flex-direction: column;
  }

  .portal-r2d-section-head > span {
    text-align: left;
  }

  .portal-r2d-stat-strip,
  .portal-r2d-specialty-grid,
  .portal-r2d-privacy-grid,
  .portal-r2d-collection-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .portal-r2d-hero {
    min-height: 0;
    padding: 22px;
  }

  .portal-r2d-hero h1 {
    font-size: 30px;
  }

  .portal-r2d-hero__meter strong {
    font-size: 28px;
  }

  .portal-r2d-section {
    padding: 16px;
  }

  .portal-r2d-achievement-card {
    min-height: 184px;
  }

  .portal-r2d-wallet-card-preview {
    min-height: 292px;
  }
}

.portal-r2a-hero .portal-page-hero__meta {
  min-width: 180px;
}

.portal-r2a-achievement-grid,
.portal-r2a-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.portal-r2a-kpi-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.portal-r2a-achievement-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 136px;
  padding: 16px;
  border: 1px solid #dde6f3;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.portal-r2a-achievement-card:hover,
.portal-r2a-achievement-card:focus {
  transform: translateY(-2px);
  border-color: #2563eb;
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.14);
  outline: none;
}

.portal-r2a-achievement-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.portal-r2a-achievement-card p,
.portal-r2a-achievement-card small {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
}

.portal-r2a-achievement-card.is-inactive {
  filter: grayscale(0.85);
  background: #f8fafc;
  color: #64748b;
}

.portal-r2a-achievement-card.is-progress {
  border-color: #f59e0b;
}

.portal-r2a-achievement-card.is-active {
  border-color: #22c55e;
}

.portal-r2a-achievement-orb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eef4ff;
  color: #1d4ed8;
  font-weight: 800;
}

.portal-r2a-progress {
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.portal-r2a-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #22c55e);
}

.portal-r2a-wallet-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 112px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid #dde6f3;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.portal-r2a-wallet-card.is-current {
  border-color: #2563eb;
  background: #f8fbff;
}

.portal-r2a-wallet-card span {
  color: #64748b;
  font-size: 12px;
  text-transform: uppercase;
}

.portal-r2a-wallet-card strong {
  font-size: 20px;
}

.portal-code-block {
  max-width: 100%;
  overflow: auto;
  padding: 14px;
  border: 1px solid #dde6f3;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .portal-r2a-achievement-card {
    grid-template-columns: 40px 1fr;
  }

  .portal-r2a-achievement-card .portal-status-badge {
    grid-column: 1 / -1;
    width: fit-content;
  }
}

.course-payment-instructions {
  display: grid;
  gap: 14px;
  margin: 16px 0;
  padding: 18px;
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  background: #f8fafc;
}

.course-payment-instructions__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.course-payment-instructions__eyebrow {
  margin: 0 0 4px;
  color: var(--portal-primary);
  font-size: 13px;
  font-weight: 800;
}

.course-payment-instructions__head h3 {
  margin: 0;
  color: #101828;
  font-size: 20px;
  line-height: 1.3;
}

.course-payment-instructions__lead,
.course-payment-instructions__fineprint {
  margin: 0;
  color: var(--portal-muted);
  font-weight: 700;
  line-height: 1.6;
}

.course-payment-account {
  display: grid;
  gap: 10px;
  margin: 0;
}

.course-payment-account > div {
  display: grid;
  grid-template-columns: minmax(110px, 160px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.course-payment-account dt {
  color: var(--portal-muted);
  font-size: 13px;
  font-weight: 800;
}

.course-payment-account dd {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0;
  color: #101828;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.course-payment-account__number {
  user-select: all;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.course-payment-account__copy {
  min-height: 32px;
}

.course-payment-instructions__notice {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  line-height: 1.55;
}

.course-payment-instructions__steps {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
  color: #344054;
  font-weight: 700;
  line-height: 1.55;
}

.course-payment-instructions__copy-status {
  min-height: 20px;
  color: var(--portal-primary);
  font-size: 13px;
  font-weight: 800;
}

.portal-copy-fallback-field {
  position: fixed;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 640px) {
  .course-payment-instructions {
    padding: 14px;
  }

  .course-payment-instructions__head {
    display: grid;
  }

  .course-payment-account > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .course-payment-account dd {
    display: grid;
    justify-items: start;
  }
}

/* Portal UI Stage 3: detail, form, drawer, and action safety primitives. */
.portal-detail-page {
  scroll-margin-top: 88px;
}

.portal-object-summary {
  position: relative;
}

.portal-detail-layout {
  align-items: start;
  gap: 18px;
}

.portal-detail-main,
.portal-detail-aside {
  min-width: 0;
}

.portal-form-section,
.portal-drawer-section {
  position: relative;
}

.portal-form-section > h2,
.portal-drawer-section > h2 {
  margin-top: 0;
}

.portal-form-grid {
  gap: 14px;
}

.portal-form-helper,
.portal-readonly-field {
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.portal-definition-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.portal-definition-grid div {
  min-width: 0;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcfe;
}

.portal-definition-grid dt {
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 800;
}

.portal-definition-grid dd {
  margin: 4px 0 0;
  color: var(--portal-ink);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.portal-timeline-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.portal-timeline-list li {
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.portal-timeline-list li > span {
  margin-left: 8px;
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 750;
}

.portal-timeline-list p {
  margin: 8px 0 0;
  white-space: pre-wrap;
}

.portal-sticky-action-bar {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  border-top: 1px solid var(--portal-soft-border);
  padding: 12px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), #ffffff);
}

.portal-action-zone {
  border-top: 1px solid rgba(226, 232, 240, 0.85);
  padding-top: 12px;
}

.portal-danger-zone {
  border-color: #fecdd3;
}

.portal-danger-zone > h2,
.portal-danger-zone > p:first-child {
  color: var(--portal-color-danger);
}

.portal-audit-timeline,
.portal-status-timeline {
  display: grid;
  gap: 10px;
}

.portal-audit-timeline .portal-state,
.portal-status-timeline .portal-state {
  border-left: 3px solid #bfdbfe;
}

.portal-detail-drawer {
  display: grid;
  grid-template-rows: auto 1fr;
}

.portal-drawer-section {
  grid-column: 1 / -1;
  border-top: 1px solid var(--portal-soft-border);
  padding-top: 14px;
}

.portal-mobile-form-section {
  min-width: 0;
}

.portal-protected-detail-boundary {
  position: relative;
}

.portal-protected-detail-boundary::after {
  content: "受保护详情：本页不展示核验 token、二维码载荷、条码载荷、生产包路径或包内容。";
  display: block;
  margin-top: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  padding: 9px 11px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.45;
}

.portal-sensitive-field-mask {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

@media (max-width: 760px) {
  .portal-detail-layout,
  .portal-detail-grid {
    grid-template-columns: 1fr;
  }

  .portal-sticky-action-bar {
    position: static;
    justify-content: stretch;
  }

  .portal-sticky-action-bar button,
  .portal-sticky-action-bar a {
    width: 100%;
    justify-content: center;
  }

  .portal-mobile-form-section .portal-form,
  .portal-mobile-form-section .portal-form-grid {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--portal-ink);
  background: var(--portal-bg);
  overflow-x: hidden;
}

.portal-login-body {
  min-height: 100vh;
  background: var(--portal-black);
}

.portal-login-shell,
.portal-denied {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.portal-login-panel {
  width: min(100%, 420px);
  background: var(--portal-white);
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.portal-login-panel p,
.portal-page-head p,
.portal-panel p {
  margin: 18px 0 6px;
  color: var(--portal-red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.portal-login-panel h1,
.portal-page-head h1,
.portal-panel h1,
.portal-panel h2 {
  margin: 0;
  letter-spacing: 0;
}

.portal-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.portal-form label,
.portal-role-form label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
}

.portal-form input,
.portal-form select,
.portal-form textarea,
.portal-form-grid input,
.portal-form-grid select,
.portal-form-grid textarea,
.portal-filter-form input,
.portal-filter-form select,
.portal-role-form select {
  width: 100%;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  padding: 11px 12px;
  font: inherit;
  background: var(--portal-white);
}

.portal-form textarea,
.portal-form-grid textarea {
  min-height: 96px;
  resize: vertical;
}

.portal-inline-filter-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 14px;
  align-items: end;
}

.portal-inline-filter-form .portal-actions {
  align-items: center;
  margin: 0;
}

.portal-meta-list {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
}

.portal-meta-list div {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px solid var(--portal-border);
  padding-top: 8px;
}

.portal-meta-list dt {
  color: var(--portal-muted);
  font-size: 12px;
}

.portal-meta-list dd {
  margin: 0;
  color: var(--portal-text);
  font-size: 13px;
  text-align: right;
}

.portal-inline-fields {
  display: grid;
  grid-template-columns: minmax(120px, 0.34fr) minmax(0, 1fr);
  gap: 12px;
}

.portal-phone-combo {
  display: grid;
  grid-template-columns: minmax(132px, 0.34fr) minmax(0, 1fr);
  align-items: stretch;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  background: var(--portal-white);
}

.portal-phone-combo--fixed-prefix {
  grid-template-columns: 78px minmax(0, 1fr);
}

.portal-phone-combo--fixed-prefix .auth-phone-prefix {
  display: grid;
  place-items: center;
  padding: 0 12px;
}

.portal-phone-combo select,
.portal-phone-combo input {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.portal-phone-combo select {
  border-right: 1px solid var(--portal-border);
  padding-right: 8px;
}

.portal-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.portal-form-grid label {
  display: grid;
  gap: 7px;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
}

.portal-field-note {
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
}

.portal-form-grid label:has(textarea),
.portal-form-grid .portal-form-actions {
  grid-column: 1 / -1;
}

.portal-form-grid-span-2 {
  grid-column: 1 / -1;
}

.portal-checkbox-row {
  align-content: end;
  display: flex !important;
  flex-direction: row;
  gap: 10px !important;
  align-items: center;
  min-height: 42px;
}

.portal-checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

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

.portal-form-actions button,
.portal-form-grid button {
  border: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--portal-red) 0%, var(--portal-red-dark) 100%);
  color: var(--portal-white);
  font: inherit;
  font-weight: 800;
  padding: 12px 16px;
  cursor: pointer;
}

.portal-form input[readonly],
.portal-form-grid input[readonly],
.portal-form-stack input[readonly] {
  color: var(--portal-muted);
  background: #f1f2f4;
}

.portal-warning-panel {
  display: grid;
  gap: 6px;
  margin: 16px 0;
  border: 1px solid #f4c7c9;
  border-left: 4px solid var(--portal-red);
  border-radius: 8px;
  padding: 14px 16px;
  background: #fff7f7;
  color: var(--portal-ink);
}

.portal-warning-panel strong {
  font-size: 15px;
  font-weight: 900;
}

.portal-warning-panel span {
  color: var(--portal-muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.55;
}

.portal-form button,
.portal-filter-form button,
.portal-link-button,
.portal-secondary-button {
  border: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--portal-blue) 0%, var(--portal-blue-dark) 100%);
  color: var(--portal-white);
  font: inherit;
  font-weight: 800;
  padding: 12px 16px;
  cursor: pointer;
}

.portal-secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--portal-soft-border);
  background: var(--portal-white);
  color: var(--portal-ink);
  text-decoration: none;
}

.portal-secondary-button.muted {
  border: 1px solid var(--portal-soft-border);
  background: var(--portal-white);
  color: var(--portal-ink);
}

.portal-secondary-button:hover,
.portal-secondary-button:focus-visible {
  border-color: #c7ccd6;
  color: var(--portal-blue-dark);
}

.portal-alert {
  margin: 0 0 16px;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
}

.portal-main > .portal-alert:first-child,
.portal-page-head + .portal-alert,
.brand-market-hero + .portal-alert {
  margin-top: 0;
}

.portal-panel > .portal-alert,
.portal-wide-panel > .portal-alert {
  margin-bottom: 14px;
}

.portal-panel > .portal-alert:last-child,
.portal-wide-panel > .portal-alert:last-child {
  margin-bottom: 0;
}

.portal-alert + .portal-alert {
  margin-top: -6px;
}

.portal-alert + .brand-market-stepbar,
.portal-alert + .brand-market-category-strip,
.portal-alert + .brand-market-benefits,
.portal-alert + .portal-panel,
.portal-alert + .portal-wide-panel,
.portal-alert + .portal-grid {
  margin-top: 0;
}

.portal-alert.error {
  margin-top: 16px;
  background: #fff0f1;
  color: #9d101b;
  border: 1px solid #ffc9cf;
}

.portal-alert.warning {
  margin-top: 12px;
  background: #fff8e8;
  color: #7b4d00;
  border: 1px solid #f4d493;
}

.portal-alert.success {
  margin-top: 16px;
  background: #eefaf1;
  color: #116329;
  border: 1px solid #b7e4c1;
}

.portal-state.error,
.portal-alert.no-permission {
  margin-top: 14px;
  background: #fff0f1;
  color: #9d101b;
  border-color: #ffc9cf;
}

.portal-login-footnote {
  margin-top: 18px;
  color: var(--portal-muted);
  font-size: 13px;
  text-transform: none;
}

.portal-login-footnote a {
  color: var(--portal-red);
  text-decoration: none;
  font-weight: 800;
}

.portal-auth-compliance-footer {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 12px;
  color: var(--portal-muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.portal-auth-compliance-footer a {
  color: var(--portal-muted);
  text-decoration: none;
  font-weight: 700;
}

.portal-auth-compliance-footer a:hover {
  color: var(--portal-red);
}

.portal-auth-compliance-footer span {
  flex-basis: 100%;
}

.auth-r1-login-panel {
  display: grid;
  gap: 14px;
}

/* AUTH-R1 login/register guardrail restored from canonical history. */
.auth-r1-login-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(35, 104, 245, 0.12), transparent 32%),
    linear-gradient(180deg, #f8fafc 0%, #eef4ff 48%, #f8fafc 100%);
}

.auth-r1-login-shell {
  align-items: center;
  justify-items: center;
}

.auth-r1-login-body .auth-r1-login-panel {
  width: min(100%, 620px);
  border: 1px solid #e3e8f2;
  background: var(--portal-white);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.16);
}

.auth-login-brand {
  display: inline-flex;
  justify-self: start;
  width: max-content;
  margin-bottom: 6px;
  text-decoration: none;
}

.auth-login-brand img,
.auth-r1-login-panel .auth-login-brand img {
  display: block;
  width: 152px;
  height: auto;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.auth-r1-login-panel .portal-kicker {
  margin: 0 0 8px;
  color: #2368f5;
  font-size: 13px;
  font-weight: 850;
}

.auth-r1-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
  padding: 4px;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  background: #f3f5f8;
}

.auth-r1-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 10px 12px;
  background: transparent;
  color: var(--portal-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.auth-r1-tabs button.is-active {
  background: var(--portal-white);
  color: var(--portal-ink);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
}

.auth-r1-tabs button:focus-visible {
  outline: 2px solid rgba(29, 78, 216, 0.36);
  outline-offset: 2px;
}

.auth-r1-panel {
  display: grid;
  gap: 14px;
}

.auth-r1-panel[hidden] {
  display: none !important;
}

.auth-r1-panel .portal-form {
  margin-top: 0;
  gap: 16px;
}

.auth-r1-login-panel .portal-form label {
  color: #374151;
  font-size: 14px;
  font-weight: 760;
}

.auth-r1-login-panel .portal-form input {
  min-height: 52px;
  font-size: 16px;
}

.auth-r1-login-panel .portal-form button {
  min-height: 52px;
  border-radius: 7px;
  font-size: 16px;
}

.auth-r1-login-panel .portal-form button[disabled] {
  border-color: #d7e4ff;
  background: #a8c4fb;
  color: #f8fbff;
}

.auth-r1-login-panel .portal-form-help {
  margin: 2px 0 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
}

.auth-r1-login-panel .portal-state.compact {
  margin: 0;
  border-color: #dbe3ef;
  background: #f8fbff;
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
}

.auth-phone-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  background: var(--portal-white);
}

.auth-phone-prefix {
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  padding: 0 12px;
  border-right: 1px solid var(--portal-border);
  color: var(--portal-muted);
  font-size: 13px;
  font-weight: 800;
  background: #f8fafc;
}

.portal-form .auth-phone-control input {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.auth-r1-phone-form > button,
.auth-r1-phone-register-step > button {
  width: 100%;
  min-height: 44px;
}

.auth-r1-phone-register-step:not([hidden]) {
  display: grid;
}

.auth-r1-phone-register-step[hidden],
.auth-otp-modal-layer[hidden] {
  display: none !important;
}

.portal-consent-field {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px !important;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--portal-soft-border);
  border-radius: 6px;
  background: #fbfcfd;
  font-weight: 650;
  line-height: 1.5;
}

.portal-consent-field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  padding: 0;
}

.portal-consent-field span {
  min-width: 0;
}

.portal-consent-field a {
  overflow-wrap: anywhere;
  white-space: normal;
}

@media (max-width: 520px) {
  .portal-login-shell {
    padding: 16px;
  }

  .portal-login-panel {
    padding: 24px 20px;
  }

  .auth-r1-tabs {
    gap: 6px;
  }

  .auth-login-brand {
    margin-bottom: 12px;
  }

  .auth-login-brand img,
  .auth-r1-login-panel .auth-login-brand img {
    width: 128px;
  }

  .auth-r1-tabs button,
  .auth-r1-phone-form > button,
  .auth-r1-phone-register-step > button {
    min-height: 46px;
  }

  .auth-r1-tabs button {
    padding-inline: 8px;
    font-size: 12px;
    line-height: 1.25;
  }

  .portal-auth-compliance-footer {
    gap: 6px 10px;
  }
}

.portal-state-card {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  padding: 20px;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  background: #fbfcfd;
}

.portal-state-card h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

.portal-state-card p {
  margin: 0;
  color: var(--portal-muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.65;
}

.portal-summary-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.portal-summary-list div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  background: var(--portal-white);
}

.portal-summary-list dt {
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 800;
}

.portal-summary-list dd {
  margin: 0;
  color: var(--portal-ink);
  font-size: 16px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.portal-button-like {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 10px 14px;
  background: var(--portal-red);
  color: var(--portal-white);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.portal-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--portal-ink);
  border-bottom: 1px solid var(--portal-soft-border);
  backdrop-filter: blur(16px);
}

.portal-brand-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--portal-ink);
  text-decoration: none;
  font-weight: 900;
}

.portal-brand img {
  width: 116px;
  height: auto;
}

.portal-menu-button {
  display: none;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid var(--portal-soft-border);
  border-radius: 7px;
  padding: 0;
  color: var(--portal-ink);
  background: var(--portal-white);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.portal-menu-button span {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--portal-ink);
}

.portal-topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.portal-topbar-actions form {
  margin: 0;
  flex: 0 0 auto;
}

.portal-notice {
  color: var(--portal-muted);
  font-size: 13px;
}

.portal-notice-link {
  color: var(--portal-ink);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.portal-language-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--portal-soft-border);
  border-radius: 999px;
  background: #fff;
  color: var(--portal-ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.portal-language-toggle:hover {
  border-color: var(--portal-ink);
}

.portal-role-pill {
  border: 1px solid var(--portal-soft-border);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--portal-ink);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.portal-link-button {
  padding: 9px 12px;
}

.portal-shell {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: 312px minmax(0, 1fr);
}

.portal-sidebar {
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  border-right: 1px solid var(--portal-soft-border);
  padding: 20px;
}

.portal-user-card {
  display: grid;
  gap: 16px;
  border: 1px solid #d8ddea;
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(170deg, #ffffff 0%, #f9fbff 100%);
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.04);
  overflow-wrap: anywhere;
}

.portal-user-summary {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid #e7ebf3;
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
}

.portal-user-summary-main {
  min-width: 0;
  display: grid;
  gap: 4px;
  align-content: center;
}

.portal-user-summary-subtitle {
  margin: 0;
  color: var(--portal-muted);
  font-size: 12px;
}

.portal-user-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--portal-muted);
  font-size: 11px;
  line-height: 1.4;
}

.portal-user-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid #d9e4ff;
  background: #edf2ff;
  color: #1e4ed8;
  font-weight: 800;
}

.portal-user-profile-link {
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
  outline-offset: 4px;
}

.portal-user-profile-link:hover strong,
.portal-user-profile-link:focus-visible strong {
  color: var(--portal-blue);
}

.portal-user-card-statusbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.portal-user-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--portal-soft-border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--portal-ink);
  background: #f3f6ff;
  font-weight: 800;
}

.portal-user-card-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.portal-user-card-action {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid var(--portal-border);
  border-radius: 10px;
  background: #fafbfc;
  color: var(--portal-ink);
  padding: 10px 10px;
  text-decoration: none;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.portal-user-card-action strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.25;
}

.portal-user-card-action span {
  color: var(--portal-muted);
  font-size: 11px;
  font-weight: 800;
}

.portal-user-card-action:hover,
.portal-user-card-action.is-active {
  border-color: #b7ccff;
  background: #eaf2ff;
  color: #123f9b;
  transform: translateY(-1px);
}

.portal-user-card-action:focus-visible {
  outline: 2px solid #9cb6ff;
  outline-offset: 2px;
}

.portal-user-card-actions {
  align-items: stretch;
}

.portal-user-summary div {
  min-width: 0;
}

.portal-user-avatar {
  display: inline-flex;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--portal-black);
  color: var(--portal-white);
  font-size: 14px;
  font-weight: 900;
}

.portal-user-card strong {
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
}

.portal-user-card span,
.portal-page-head span,
.portal-panel span,
.portal-role-line {
  color: var(--portal-muted);
  font-size: 13px;
  line-height: 1.5;
}

.portal-role-form {
  margin: 16px 0 20px;
  display: grid;
  gap: 8px;
}

.portal-role-switch-button {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--portal-blue) !important;
  border-radius: 6px;
  padding: 11px 12px;
  background: linear-gradient(180deg, var(--portal-blue) 0%, var(--portal-blue-dark) 100%) !important;
  color: #ffffff !important;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 8px 16px rgba(29, 78, 216, 0.16);
}

.portal-role-switch-button span,
.portal-role-switch-button * {
  display: inline-block;
  color: #ffffff !important;
  font-size: 14px;
  line-height: 1.2;
}

.portal-role-switch-button:hover,
.portal-role-switch-button:focus-visible,
.portal-role-switch-button:active,
.portal-role-switch-button:disabled {
  border-color: var(--portal-blue-dark) !important;
  background: linear-gradient(180deg, #2457e6 0%, var(--portal-blue-dark) 100%) !important;
  color: #ffffff !important;
}

.portal-role-switch-button:disabled {
  cursor: wait;
  opacity: 0.82;
}

.portal-role-form-help {
  margin: 0;
  color: var(--portal-muted);
  font-size: 12px;
  line-height: 1.5;
}

.portal-role-pending-note {
  margin: 0;
  color: var(--portal-blue);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.portal-advanced-fields {
  grid-column: 1 / -1;
  border: 1px solid var(--portal-soft-border);
  border-radius: 6px;
  padding: 10px 12px;
  background: #f8fafc;
}

.portal-advanced-fields summary {
  cursor: pointer;
  color: var(--portal-muted);
  font-size: 13px;
  font-weight: 800;
}

.portal-advanced-fields input {
  margin-top: 8px;
}

.portal-menu {
  display: grid;
  gap: 10px;
  padding: 2px 0 28px;
}

.portal-menu-group {
  display: grid;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 8px;
}

.portal-menu-group.is-active {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.portal-menu-group-toggle {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--portal-ink);
  cursor: pointer;
  font: inherit;
  padding: 10px;
  text-align: left;
}

.portal-menu-group-toggle:hover,
.portal-menu-group-toggle:focus-visible {
  background: #eef4ff;
  outline: none;
}

.portal-menu-group-mark {
  flex: 0 0 4px;
  align-self: stretch;
  min-height: 26px;
  border-radius: 999px;
  background: #cbd5e1;
}

.portal-menu-group.is-active .portal-menu-group-mark {
  background: var(--portal-blue);
}

.portal-menu-group-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.portal-menu-group-copy strong {
  color: var(--portal-ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}

.portal-menu-group-copy small {
  display: block;
  color: var(--portal-muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-menu-group-count {
  margin-left: auto;
  border: 1px solid var(--portal-soft-border);
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--portal-white);
  color: var(--portal-muted);
  font-size: 11px;
  font-weight: 900;
}

.portal-menu-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid #94a3b8;
  border-bottom: 2px solid #94a3b8;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.portal-menu-group.is-expanded .portal-menu-chevron {
  transform: rotate(225deg);
}

.portal-menu-children {
  display: none;
  gap: 4px;
  padding: 0 8px 10px 24px;
}

.portal-menu-group.is-expanded .portal-menu-children {
  display: grid;
}

.portal-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  border-left: 2px solid transparent;
  border-radius: 6px;
  color: var(--portal-ink);
  text-decoration: none;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 760;
}

.portal-menu-item-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #cbd5e1;
}

.portal-menu-item.is-active,
.portal-menu-item:hover {
  border-left-color: var(--portal-blue);
  background: #eaf2ff;
  color: #123f9b;
}

.portal-menu-item.is-active .portal-menu-item-dot,
.portal-menu-item:hover .portal-menu-item-dot {
  background: var(--portal-blue);
}

.portal-main {
  min-width: 0;
  padding: 18px 24px 30px;
}

.portal-page-head {
  display: grid;
  gap: 4px;
  margin-bottom: 22px;
}

.portal-page-head-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 112px;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  padding: 22px 24px;
  background: var(--portal-white);
  box-shadow: var(--portal-shadow);
}

.portal-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

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

.portal-panel {
  min-height: 136px;
  background: var(--portal-white);
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--portal-shadow);
  overflow-wrap: anywhere;
}

.portal-card {
  display: grid;
  gap: 8px;
  min-height: 116px;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  padding: 18px;
  background: var(--portal-white);
  box-shadow: var(--portal-shadow);
}

.portal-card p {
  margin: 0;
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 900;
}

.portal-card strong {
  color: var(--portal-black);
  font-size: 32px;
  font-weight: 950;
  line-height: 1;
}

.legacy-migration-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}

.legacy-migration-hero p,
.legacy-migration-readiness p,
.legacy-migration-next p {
  margin: 0 0 8px;
  color: var(--portal-red);
  font-size: 12px;
  font-weight: 950;
}

.legacy-migration-hero h2,
.legacy-migration-readiness h2,
.legacy-migration-next h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.12;
}

.legacy-migration-hero span {
  display: block;
  margin-top: 10px;
  color: var(--portal-muted);
  line-height: 1.6;
}

.legacy-migration-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.legacy-migration-card {
  gap: 14px;
}

.legacy-migration-card h2,
.legacy-migration-card p {
  margin: 0;
}

.legacy-migration-card p {
  color: var(--portal-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.legacy-migration-card dl {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px 10px;
  margin: 0;
}

.legacy-migration-card dt {
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 950;
}

.legacy-migration-card dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 800;
}

.legacy-migration-card dd a {
  color: var(--portal-black);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.legacy-migration-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.legacy-migration-badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(38, 164, 92, 0.12);
  color: #167546;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.legacy-migration-badge.is-neutral {
  background: rgba(20, 24, 31, 0.08);
  color: var(--portal-ink);
}

.legacy-migration-readiness,
.legacy-migration-next {
  margin-bottom: 16px;
}

.legacy-migration-readiness ol {
  margin: 18px 0 0;
  padding-left: 22px;
  color: var(--portal-ink);
  line-height: 1.75;
}

.portal-stat-grid {
  margin-bottom: 16px;
}

.portal-panel-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.portal-panel-heading h2 {
  margin: 0;
}

.portal-muted {
  color: var(--portal-muted);
  font-size: 13px;
  line-height: 1.55;
}

.portal-form-help {
  color: var(--portal-muted);
  font-size: 13px;
  line-height: 1.55;
}

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

.portal-checkbox-line {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--portal-ink);
  font-size: 13px;
  font-weight: 800;
}

.portal-checkbox-line input {
  width: auto;
  margin: 0;
}

.portal-stack {
  display: grid;
  gap: 10px;
}

.portal-dashboard-card {
  display: grid;
  align-content: start;
  gap: 8px;
}

.portal-panel.is-current {
  border-color: var(--portal-red);
  box-shadow: inset 4px 0 0 var(--portal-red);
}

.portal-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.portal-metric-card {
  display: grid;
  gap: 8px;
  min-height: 100px;
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  padding: 14px;
  background: #fbfbfc;
  color: var(--portal-ink);
  text-decoration: none;
}

.portal-metric-card span {
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}

.portal-metric-card strong {
  color: var(--portal-black);
  font-size: 34px;
  font-weight: 950;
  line-height: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.portal-metric-card strong.metric-small {
  font-size: clamp(18px, 1.7vw, 24px);
  line-height: 1.15;
  word-break: break-word;
}

.portal-metric-card small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.portal-metric-card.warning {
  border-color: #f4d493;
  background: #fffaf0;
}

.portal-metric-card.danger {
  border-color: #ffc9cf;
  background: #fff5f6;
}

.portal-metric-card.success {
  border-color: #b7e4c1;
  background: #f1fbf4;
}

.portal-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(31, 41, 55, 0.18);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--portal-black);
  font-size: 13px;
  font-weight: 850;
}

.portal-status-pill.danger {
  border-color: #ffc9cf;
  background: #fff5f6;
  color: var(--portal-red);
}

.portal-status-pill.warning {
  border-color: #f4d493;
  background: #fff8e8;
  color: #7b4d00;
}

.portal-status-pill.success {
  border-color: #b7e4c1;
  background: #eefaf1;
  color: #116329;
}

.portal-status-pill.neutral {
  border-color: #d7dce3;
  background: #f7f8fa;
  color: #3f4652;
}

.portal-small-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--portal-black);
  color: #fff;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.portal-inline-link,
.portal-primary-action,
.portal-secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 6px;
  font-weight: 850;
  line-height: 1.2;
  text-decoration: none;
}

.portal-inline-link {
  color: var(--portal-blue);
}

.portal-primary-action {
  border: 1px solid var(--portal-red-dark);
  padding: 8px 12px;
  background: linear-gradient(180deg, var(--portal-red) 0%, var(--portal-red-dark) 100%);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(211, 21, 36, 0.18);
  white-space: nowrap;
}

.portal-secondary-action {
  border: 1px solid var(--portal-soft-border);
  padding: 8px 12px;
  background: var(--portal-white);
  color: var(--portal-ink);
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.04);
  white-space: nowrap;
}

.portal-primary-action:hover,
.portal-primary-action:focus-visible,
.portal-secondary-action:hover,
.portal-secondary-action:focus-visible {
  border-color: var(--portal-blue);
}

.portal-primary-action:hover,
.portal-primary-action:focus-visible {
  color: #ffffff;
  background: linear-gradient(180deg, #ef3340 0%, #bd1728 100%);
}

.portal-secondary-action:hover,
.portal-secondary-action:focus-visible {
  color: var(--portal-blue-dark);
}

.portal-form button.portal-action-primary,
.portal-form-grid button.portal-action-primary,
.portal-form-actions button.portal-action-primary,
.portal-filter-form button.portal-action-primary {
  border: 0;
  background: linear-gradient(180deg, var(--portal-blue) 0%, var(--portal-blue-dark) 100%);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.16);
}

.portal-form button.portal-action-secondary,
.portal-form-grid button.portal-action-secondary,
.portal-form-actions button.portal-action-secondary {
  border: 1px solid var(--portal-soft-border);
  background: var(--portal-white);
  color: var(--portal-ink);
  box-shadow: none;
}

.portal-form button.portal-action-warning,
.portal-form-grid button.portal-action-warning,
.portal-form-actions button.portal-action-warning {
  border: 1px solid #f4d493;
  background: #fff8e8;
  color: #7b4d00;
  box-shadow: none;
}

.portal-form button.portal-action-danger,
.portal-form-grid button.portal-action-danger,
.portal-form-actions button.portal-action-danger {
  background: linear-gradient(180deg, var(--portal-red) 0%, var(--portal-red-dark) 100%);
  color: #ffffff;
}

.portal-form button.portal-action-danger:disabled,
.portal-form-grid button.portal-action-danger:disabled,
.portal-form-actions button.portal-action-danger:disabled {
  background: #e5e7eb;
  border-color: #d1d5db;
  box-shadow: none;
  color: #94a3b8;
  cursor: not-allowed;
}

.portal-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin: 2px 4px 2px 0;
  border: 1px solid var(--portal-soft-border);
  border-radius: 999px;
  padding: 4px 9px;
  background: #f7f8fa;
  color: var(--portal-ink);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
}

.portal-wide-panel {
  margin-top: 16px;
  min-height: auto;
}

.portal-permission-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.portal-permission-list li {
  border: 1px solid var(--portal-border);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--portal-muted);
}

.portal-state {
  display: grid;
  gap: 4px;
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  padding: 12px;
  color: var(--portal-muted);
  font-size: 13px;
  line-height: 1.5;
  background: #fafbfc;
}

.portal-state.empty {
  margin-top: 14px;
}

.portal-state.compact {
  margin-top: -8px;
  padding: 10px;
}

.portal-switch-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  background: #fbfcfd;
}

.portal-switch-card input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.portal-switch-card span {
  display: grid;
  gap: 4px;
}

.portal-switch-card small {
  color: var(--portal-muted);
  font-size: 12px;
  line-height: 1.5;
}

.portal-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.portal-filter-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  align-items: center;
  margin: 0 0 14px;
}

.portal-filter-form:last-child {
  margin-bottom: 0;
}

.portal-filter-form + .portal-table-wrap,
.portal-inline-filter-form + .portal-table-wrap,
.portal-form + .portal-table-wrap {
  margin-top: 0;
}

.portal-filter-form .portal-sort-select {
  min-width: 220px;
}

.portal-leads-filter {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.portal-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--portal-white);
  font-size: 13px;
  font-weight: 800;
}

.portal-checkbox input {
  width: auto;
  min-width: 16px;
}

.portal-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.portal-small-button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  padding: 6px 12px;
  background: linear-gradient(180deg, var(--portal-color-primary) 0%, var(--portal-color-primary-strong) 100%);
  color: #ffffff !important;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: var(--portal-shadow-action);
}

.portal-small-button.muted {
  border: 1px solid var(--portal-border);
  background: #f8fafc;
  color: var(--portal-ink) !important;
  box-shadow: none;
}

.portal-muted-text {
  color: var(--portal-muted);
  font-size: 13px;
  font-weight: 750;
}

.portal-inline-form {
  display: grid;
  grid-template-columns: minmax(120px, 1fr);
  gap: 8px;
}

.portal-inline-form input,
.portal-inline-form select {
  width: 100%;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  font-size: 12px;
}

.portal-inline-form button {
  border: 0;
  border-radius: 6px;
  background: var(--portal-ink);
  color: var(--portal-white);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 10px;
  cursor: pointer;
}

.portal-opening-detail-actions {
  align-items: stretch;
}

.portal-opening-detail-actions .portal-inline-form {
  display: inline-flex;
  width: auto;
  min-width: 150px;
  margin: 0;
}

.portal-opening-detail-actions .portal-inline-form button {
  width: 100%;
}

.portal-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  background: var(--portal-white);
}

.portal-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  margin-top: 0;
  font-size: 13px;
}

.portal-import-table {
  min-width: 920px;
}

.portal-leads-table {
  min-width: 980px;
}

.portal-table-issuance {
  min-width: 1080px;
}

.portal-table th,
.portal-table td {
  border-bottom: 1px solid var(--portal-soft-border);
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}

.portal-table th {
  background: #f7f8fb;
  color: var(--portal-muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.portal-table a,
.portal-secondary-link {
  color: var(--portal-blue);
  font-weight: 800;
  text-decoration: none;
}

.portal-table a.portal-email-link {
  color: var(--portal-ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.portal-users-table {
  min-width: 1240px;
}

.portal-users-table th:nth-child(1),
.portal-users-table td:nth-child(1) {
  width: 104px;
  min-width: 104px;
}

.portal-users-table th:nth-child(2),
.portal-users-table td:nth-child(2) {
  min-width: 216px;
}

.portal-users-table th:nth-child(3),
.portal-users-table td:nth-child(3) {
  min-width: 148px;
}

.portal-users-table th:nth-child(4),
.portal-users-table td:nth-child(4),
.portal-users-table th:nth-child(7),
.portal-users-table td:nth-child(7),
.portal-users-table th:nth-child(8),
.portal-users-table td:nth-child(8) {
  width: 72px;
  min-width: 72px;
}

.portal-users-table th:nth-child(5),
.portal-users-table td:nth-child(5) {
  width: 106px;
  min-width: 106px;
}

.portal-users-table th:nth-child(6),
.portal-users-table td:nth-child(6) {
  min-width: 188px;
}

.portal-users-table th:nth-child(9),
.portal-users-table td:nth-child(9),
.portal-users-table th:nth-child(10),
.portal-users-table td:nth-child(10) {
  width: 132px;
  min-width: 132px;
}

.portal-users-table th:nth-child(11),
.portal-users-table td:nth-child(11) {
  width: 112px;
  min-width: 112px;
}

.portal-users-table .portal-users-table__uid,
.portal-users-table .portal-users-table__uid-link,
.portal-users-table .portal-users-table__short,
.portal-users-table .portal-users-table__date,
.portal-users-table .portal-users-table__action,
.portal-users-table .portal-secondary-button.compact {
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.portal-users-table .portal-users-table__uid-link {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.portal-users-table .portal-users-table__account .portal-email-link {
  overflow-wrap: anywhere;
}

.portal-users-table .portal-users-table__action {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.portal-users-table .portal-users-table__action .portal-row-action {
  display: inline-flex;
  justify-content: center;
  min-width: 82px;
}

@media (min-width: 761px) {
  .portal-users-table th:nth-child(11),
  .portal-users-table td:nth-child(11) {
    position: sticky;
    right: 0;
    z-index: 2;
    background: #fff;
    box-shadow: -10px 0 16px rgba(15, 23, 42, 0.06);
  }

  .portal-users-table th:nth-child(11) {
    z-index: 3;
    background: #f7f8fb;
  }
}

.portal-user-list-toolbar {
  display: grid;
  gap: 12px;
}

.portal-user-filter-form {
  grid-template-columns: minmax(180px, 1.2fr) repeat(6, minmax(120px, 0.8fr)) auto auto;
}

@media (max-width: 1500px) {
  .portal-user-filter-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .portal-user-filter-form button {
    width: 100%;
  }
}

.portal-list-summary,
.portal-pagination,
.portal-form-actions,
.portal-batch-role-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.portal-list-summary {
  justify-content: space-between;
  color: var(--portal-muted);
  font-size: 13px;
}

.portal-list-summary strong {
  color: var(--portal-ink);
}

.portal-pagination {
  justify-content: flex-end;
  margin-top: 14px;
}

.portal-secondary-button.compact {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}

.portal-secondary-button.disabled {
  pointer-events: none;
  opacity: 0.45;
}

.portal-collapsible-create details {
  display: grid;
  gap: 14px;
}

.portal-collapsible-create summary {
  cursor: pointer;
  color: var(--portal-ink);
  font-weight: 900;
}

.portal-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.portal-form-stack {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.portal-form-stack label {
  display: grid;
  gap: 7px;
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
}

.portal-form-stack input,
.portal-form-stack select,
.portal-form-stack textarea {
  width: 100%;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  background: var(--portal-white);
}

.portal-form-stack button {
  border: 0;
  border-radius: 6px;
  background: var(--portal-red);
  color: var(--portal-white);
  font: inherit;
  font-weight: 900;
  padding: 11px 14px;
  cursor: pointer;
}

.portal-detail-list {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 10px 14px;
  margin: 14px 0;
}

.portal-detail-list dt {
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.portal-detail-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.portal-card-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.2fr);
  gap: 16px;
  align-items: start;
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  padding: 16px;
  background: #fafbfc;
}

.portal-definition-list {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px 14px;
  margin: 16px 0 0;
}

.portal-definition-list dt {
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.portal-definition-list dd {
  min-width: 0;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.break-anywhere {
  overflow-wrap: anywhere;
}

.portal-status-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 24px;
  border: 1px solid var(--portal-border);
  border-radius: 999px;
  padding: 4px 8px;
  background: #f7f8fa;
  color: var(--portal-ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.portal-status-badge.neutral {
  border-color: #d7dce3;
  background: #f7f8fa;
  color: #3f4652;
}

.portal-status-badge.success {
  border-color: #afe6c4;
  background: #eafaf0;
  color: #11833f;
}

.portal-status-badge.warning {
  border-color: #f4d493;
  background: #fff8e8;
  color: #7b4d00;
}

.portal-status-badge.danger {
  border-color: #ffc9cf;
  background: #fff0f1;
  color: #9d101b;
}

.portal-table .portal-status-badge {
  white-space: nowrap;
}

.portal-table td small {
  color: var(--portal-muted);
  line-height: 1.45;
}

.portal-user-detail-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(360px, 0.82fr);
  grid-template-areas:
    "profile org"
    "roles roles"
    "cardCurrent cardBind";
  gap: 16px;
  align-items: start;
}

.portal-user-detail-grid > * {
  min-width: 0;
}

.portal-user-profile-panel {
  grid-area: profile;
}

.portal-user-org-panel {
  grid-area: org;
}

.portal-card-current-panel {
  grid-area: cardCurrent;
}

.portal-role-panel {
  grid-area: roles;
}

.portal-card-bind-panel {
  grid-area: cardBind;
}

.portal-user-summary-head {
  align-items: center;
}

.portal-user-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.portal-metric-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  padding: 14px;
  background: var(--portal-white);
}

.portal-metric-card span,
.portal-metric-card small {
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 800;
}

.portal-metric-card strong {
  color: var(--portal-ink);
  font-size: 20px;
  line-height: 1.2;
}

.portal-anchor-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.portal-anchor-tabs a {
  border: 1px solid var(--portal-soft-border);
  border-radius: 999px;
  padding: 8px 11px;
  background: var(--portal-white);
  color: var(--portal-ink);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.portal-user-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.portal-user-section-card {
  scroll-margin-top: 16px;
}

.portal-user-detail-layout .portal-role-panel {
  grid-area: auto;
}

.portal-safe-action-form,
.portal-warning-form {
  margin-top: 14px;
}

.portal-safe-action-form button {
  background: var(--portal-ink);
}

.portal-user-detail-layout .portal-form-grid button,
.portal-user-detail-layout .portal-card-search-form button,
.portal-user-detail-layout .portal-batch-role-form button[type="submit"] {
  background: var(--portal-ink);
}

.portal-user-detail-layout .portal-batch-role-form .portal-secondary-button {
  border: 1px solid var(--portal-soft-border);
  background: var(--portal-white);
  color: var(--portal-ink);
}

.portal-user-detail-layout .portal-form-grid button:hover,
.portal-user-detail-layout .portal-card-search-form button:hover,
.portal-user-detail-layout .portal-batch-role-form button[type="submit"]:hover {
  background: #111827;
}

.portal-user-detail-layout .portal-batch-role-form .portal-secondary-button:hover {
  background: #f8fafc;
}

.portal-warning-form button {
  background: #7b4d00;
}

.portal-state.warning {
  border-color: #f4d493;
  background: #fff8e8;
  color: #7b4d00;
}

.portal-user-role-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(140px, 0.6fr) minmax(140px, 0.6fr) minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 18px;
}

.portal-user-role-form label {
  display: grid;
  gap: 6px;
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 800;
}

.portal-user-role-form select,
.portal-user-role-form input {
  width: 100%;
  border: 1px solid var(--portal-soft-border);
  border-radius: 6px;
  padding: 11px 12px;
  font: inherit;
  background: var(--portal-white);
}

.portal-user-role-form .portal-checkbox-line {
  grid-column: 1 / -1;
}

.portal-role-description-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  background: #f8fafc;
}

.portal-role-description-panel strong {
  color: var(--portal-ink);
  font-size: 15px;
}

.portal-role-description-panel span,
.portal-role-description-panel small,
.portal-muted-line {
  display: block;
  color: var(--portal-muted);
  font-size: 12px;
  line-height: 1.55;
}

.portal-role-warning {
  display: none;
}

.portal-role-warning.is-visible {
  display: block;
  color: #9f1239;
  font-weight: 900;
}

.portal-dev-hint {
  opacity: 0.72;
}

.portal-user-role-form button {
  justify-self: start;
  min-width: 78px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--portal-red) 0%, var(--portal-red-dark) 100%);
  color: var(--portal-white);
  font: inherit;
  font-weight: 900;
  padding: 10px 18px;
  cursor: pointer;
}

.portal-batch-role-form {
  display: grid;
  gap: 12px;
  margin: 14px 0 18px;
}

.portal-batch-role-head {
  justify-content: space-between;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  padding: 12px 14px;
  background: #f8fafc;
}

.portal-batch-role-head strong {
  color: var(--portal-ink);
  font-size: 15px;
}

.portal-batch-role-head span,
.portal-role-batch-preview {
  color: var(--portal-muted);
  font-size: 13px;
  line-height: 1.5;
}

.portal-batch-role-rows {
  display: grid;
  gap: 12px;
}

.portal-batch-role-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(130px, 0.5fr) minmax(140px, 0.55fr) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

@media (max-width: 1180px) {
  .portal-batch-role-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-batch-role-row .portal-role-description-panel,
  .portal-batch-role-row button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .portal-batch-role-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.portal-batch-role-row label {
  display: grid;
  gap: 6px;
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 800;
}

.portal-batch-role-row select,
.portal-batch-role-row input {
  width: 100%;
  border: 1px solid var(--portal-soft-border);
  border-radius: 6px;
  padding: 10px 11px;
  font: inherit;
  background: var(--portal-white);
}

.portal-batch-role-row .portal-role-description-panel {
  grid-column: 1 / -1;
}

.portal-role-batch-preview {
  border: 1px dashed var(--portal-soft-border);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fafafa;
}

.portal-section-subhead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 20px 0 10px;
}

.portal-section-subhead h2 {
  margin: 0;
  color: var(--portal-ink);
  font-size: 18px;
  line-height: 1.25;
}

.portal-section-subhead span {
  color: var(--portal-muted);
  font-size: 13px;
}

.portal-role-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 220px;
}

.portal-role-actions .portal-inline-form {
  margin: 0;
}

.portal-role-actions button {
  border: 1px solid var(--portal-soft-border);
  border-radius: 6px;
  background: var(--portal-white);
  color: var(--portal-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  padding: 8px 12px;
  cursor: pointer;
}

.portal-role-actions button.danger {
  border-color: #f3b4b4;
  background: #fff5f5;
  color: var(--portal-red-dark);
}

.portal-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.portal-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--portal-soft-border);
  border-radius: 999px;
  padding: 4px 10px;
  background: #f8fafc;
  color: var(--portal-ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.portal-chip-list-compact {
  max-width: 360px;
}

.portal-role-chip {
  max-width: 100%;
}

.portal-role-chip,
.portal-chip-more {
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.portal-chip-more {
  background: #fff;
  color: var(--portal-muted);
}

.portal-checkbox-fieldset,
.portal-service-area-group {
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.portal-checkbox-fieldset legend,
.portal-service-area-group legend {
  padding: 0 6px;
  color: var(--portal-muted);
  font-size: 13px;
  font-weight: 900;
}

.portal-chip-checkbox-grid,
.portal-service-area-cities {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.portal-checkbox-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--portal-soft-border);
  border-radius: 999px;
  padding: 8px 11px;
  background: #f8fafc;
  color: var(--portal-ink);
  font-weight: 800;
}

.portal-checkbox-chip input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.portal-section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.portal-section-head h2 {
  margin: 0 0 6px;
}

.portal-section-head p {
  margin: 0;
  color: var(--portal-muted);
}

.portal-service-area-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.service-area-selected {
  margin-bottom: 14px;
}

.portal-card-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.portal-card-search-form input {
  width: 100%;
  border: 1px solid var(--portal-soft-border);
  border-radius: 6px;
  padding: 11px 12px;
  font: inherit;
  background: var(--portal-white);
}

.portal-card-search-form button {
  border: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--portal-red) 0%, var(--portal-red-dark) 100%);
  color: var(--portal-white);
  font: inherit;
  font-weight: 900;
  padding: 11px 18px;
  cursor: pointer;
  white-space: nowrap;
}

.portal-stat-number {
  margin: 6px 0 0;
  color: var(--portal-black);
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
}

.portal-download-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.portal-download-list a {
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--portal-red);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.portal-download-list a.is-disabled {
  color: var(--portal-muted);
  background: #f1f2f4;
}

.portal-timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.portal-timeline-step {
  display: grid;
  gap: 6px;
  min-height: 112px;
  border: 1px solid var(--portal-border);
  border-left: 4px solid #9ca3af;
  border-radius: 6px;
  padding: 12px;
  background: #fff;
}

.portal-timeline-step strong {
  font-size: 14px;
  font-weight: 900;
}

.portal-timeline-step span,
.portal-timeline-step small {
  color: var(--portal-muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.portal-timeline-step.is-done {
  border-left-color: #14804a;
  background: #f4fbf7;
}

.portal-timeline-step.is-pending {
  border-left-color: #d0a000;
  background: #fffaf0;
}

.portal-timeline-step.is-attention {
  border-left-color: #d97706;
  background: #fff7ed;
}

.portal-timeline-step.is-blocked {
  border-left-color: var(--portal-red);
  background: #fff5f5;
}

.portal-profile-form {
  max-width: 680px;
}

.portal-opening-form {
  max-width: 980px;
}

.portal-opening-students {
  display: grid;
  gap: 14px;
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  padding: 14px;
  background: #fafbfc;
}

.portal-opening-students-head,
.portal-opening-student-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.portal-opening-students-head span {
  display: block;
  color: var(--portal-ink);
  font-size: 13px;
  font-weight: 900;
}

.portal-opening-students-head p {
  margin: 4px 0 0;
  color: var(--portal-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.portal-opening-students-list {
  display: grid;
  gap: 12px;
}

.portal-opening-student-row {
  display: grid;
  gap: 12px;
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  background: var(--portal-white);
  padding: 12px;
}

.portal-opening-student-row-head strong {
  color: var(--portal-ink);
  font-size: 14px;
  font-weight: 950;
}

.portal-opening-student-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
}

.portal-opening-student-remove {
  width: 30px;
  height: 30px;
  min-height: 30px;
  border-color: var(--portal-border);
  background: #f6f7f9;
  color: var(--portal-ink);
  box-shadow: none;
}

.portal-profile-legal-note {
  grid-column: 1 / -1;
}

.portal-phone-combo--profile {
  grid-template-columns: minmax(180px, 0.38fr) minmax(0, 1fr);
}

.portal-phone-status,
.portal-phone-pending {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 760px;
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  background: #fafbfc;
  padding: 14px 16px;
}

.portal-phone-status div,
.portal-phone-pending {
  min-width: 0;
}

.portal-phone-status strong,
.portal-phone-pending strong {
  display: block;
  color: var(--portal-ink);
  font-size: 15px;
  line-height: 1.35;
}

.portal-phone-status span,
.portal-phone-pending span {
  display: block;
  margin-top: 4px;
  color: var(--portal-muted);
  font-size: 13px;
  line-height: 1.55;
}

.portal-phone-status em {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eef3fb;
  color: #4f5f75;
  padding: 6px 10px;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.portal-phone-pending {
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
  border-color: #dbe5f3;
  background: #f8fbff;
}

.portal-drawer-toggle,
.portal-scrim {
  display: none;
}

.portal-mobile-page-title,
.portal-mobile-nav,
.portal-mobile-helper,
.portal-desktop-recommendation,
.portal-mobile-quick-actions,
.portal-mobile-toggle-drawer {
  display: none;
}

.portal-mobile-toggle {
  min-height: 34px;
  border: 1px solid var(--portal-soft-border);
  border-radius: 999px;
  padding: 7px 12px;
  background: #ffffff;
  color: var(--portal-ink);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}

.portal-mobile-toggle:hover,
.portal-mobile-toggle:focus-visible {
  border-color: var(--portal-ink);
}

.portal-mobile-toggle.muted {
  border-color: #d7dce3;
  background: #f7f8fa;
}

.portal-mobile-warning {
  align-items: center;
  gap: 10px;
  border: 1px solid #f0d29a;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fffaf0;
  color: #5d4200;
  font-size: 13px;
  line-height: 1.45;
}

.portal-mobile-warning strong {
  color: #4a3500;
}

@media (max-width: 760px) {
  .portal-topbar {
    height: 72px;
    align-items: center;
    flex-direction: row;
    padding: 16px;
  }

  .portal-menu-button {
    display: inline-flex;
  }

  .portal-brand img {
    width: 86px;
  }

  .portal-topbar-actions {
    min-width: 0;
    justify-content: flex-end;
    gap: 8px;
  }

  .portal-notice {
    display: none;
  }

  .portal-role-pill {
    max-width: min(42vw, 180px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .portal-shell {
    display: block;
  }

  .portal-sidebar {
    position: fixed;
    top: 72px;
    bottom: 0;
    left: min(-86vw, -320px);
    z-index: 40;
    width: min(86vw, 320px);
    height: auto;
    transform: none;
    transition: left 180ms ease;
    box-shadow: 18px 0 42px rgba(0, 0, 0, 0.18);
  }

  .portal-drawer-toggle:checked ~ .portal-shell .portal-sidebar {
    left: 0;
  }

  .portal-drawer-toggle:checked ~ .portal-scrim {
    display: block;
    position: fixed;
    inset: 72px 0 0;
    z-index: 35;
    background: rgba(0, 0, 0, 0.38);
  }

  .portal-main {
    padding: 16px;
  }

  .portal-grid,
  .portal-card-list,
  .portal-detail-grid,
  .portal-card-row,
  .portal-filter-form,
  .portal-form-grid,
  .portal-inline-fields,
  .portal-phone-combo,
  .portal-user-detail-grid,
  .portal-user-role-form,
  .portal-user-summary-grid,
  .portal-batch-role-row,
  .portal-card-search-form,
  .portal-timeline {
    grid-template-columns: 1fr;
  }

  .portal-phone-combo--fixed-prefix {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .portal-user-detail-grid {
    grid-template-areas:
      "profile"
      "org"
      "cardCurrent"
      "roles"
      "cardBind";
  }

  .portal-page-head-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .portal-panel {
    min-height: auto;
    padding: 16px;
  }

  .portal-table {
    min-width: 680px;
  }

  .portal-definition-list {
    grid-template-columns: 1fr;
  }

  .portal-detail-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .portal-topbar {
    gap: 10px;
  }

  .portal-brand {
    gap: 8px;
  }

  .portal-brand span {
    display: none;
  }

  .portal-brand img {
    width: 78px;
  }

  .portal-link-button {
    padding: 8px 10px;
  }

  .portal-role-pill {
    max-width: 118px;
  }
}

/* Portal UI Overhaul Stage 1: Page Header Hero */
.portal-page-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 132px;
  margin-bottom: 24px;
  padding: 24px 28px;
  overflow: hidden;
  border: 1px solid rgba(191, 202, 220, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 252, 255, 0.98) 54%, rgba(238, 246, 255, 0.9) 100%);
  box-shadow:
    0 18px 48px rgba(15, 23, 42, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.portal-page-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #1d4ed8 0%, #0ea5e9 100%);
}

.portal-page-hero--archive::before {
  background: linear-gradient(180deg, #64748b 0%, #94a3b8 100%);
}

.portal-page-hero--protected::before {
  background: linear-gradient(180deg, #0f766e 0%, #16a34a 100%);
}

.portal-page-hero__main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.portal-page-hero__eyebrow,
.portal-page-head .portal-page-hero__eyebrow {
  margin: 0;
  color: #dc2626;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

.portal-page-hero__title,
.portal-page-head .portal-page-hero__title {
  margin: 0;
  color: #101828;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.08;
  letter-spacing: 0;
}

.portal-page-hero__description,
.portal-page-head .portal-page-hero__description {
  max-width: 760px;
  color: #667085;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.65;
}

.portal-page-hero__actions,
.portal-page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.portal-page-hero__actions form {
  margin: 0;
}

.portal-page-hero__meta {
  display: grid;
  gap: 4px;
  justify-items: end;
  min-width: 150px;
  padding: 12px 14px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.portal-page-hero__meta span,
.portal-page-hero__summary span {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.portal-page-hero__meta strong {
  color: #111827;
  font-size: 15px;
  font-weight: 900;
  text-align: right;
}

.portal-page-hero__summary.portal-kpi-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.portal-kpi-card--compact {
  min-width: 118px;
  padding: 12px 14px;
  grid-template-columns: 1fr;
  box-shadow: none;
}

.portal-kpi-card--warning {
  border-color: #f6c76e;
  background: #fff8e8;
}

.portal-logo-home-link {
  border-radius: 8px;
}

.portal-logo-home-link:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 4px;
}

@media (max-width: 900px) {
  .portal-page-hero {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .portal-page-hero__actions,
  .portal-page-actions,
  .portal-page-hero__summary.portal-kpi-strip {
    justify-content: flex-start;
  }

  .portal-page-hero__meta {
    justify-items: start;
    width: 100%;
  }

  .portal-page-hero__meta strong {
    text-align: left;
  }
}

.portal-cockpit {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.portal-cockpit-main,
.portal-cockpit-side,
.brand-action-panel,
.brand-empty-state,
.brand-benefit-card,
.portal-kpi-card,
.brand-order-card {
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  background: var(--portal-white);
  box-shadow: var(--portal-shadow);
}

.portal-cockpit-main,
.portal-cockpit-side {
  padding: 22px;
}

.portal-cockpit-kicker,
.brand-card-kicker {
  margin: 0 0 8px;
  color: var(--portal-red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.portal-cockpit h1,
.portal-cockpit h2 {
  margin: 0;
  letter-spacing: 0;
}

.portal-cockpit-copy,
.brand-muted {
  color: var(--portal-muted);
  line-height: 1.65;
}

.portal-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.portal-kpi-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 16px;
}

.portal-kpi-card span {
  color: var(--portal-muted);
  font-size: 13px;
  font-weight: 800;
}

.portal-kpi-card strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(20px, 2.1vw, 28px);
  letter-spacing: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 1200px) {
  .portal-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.brand-icon {
  position: relative;
  width: 50px;
  height: 50px;
  display: inline-grid;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #dfe4eb;
  border-radius: 14px;
  color: #515b69;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.96) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(15, 23, 42, 0.03),
    0 10px 22px rgba(16, 24, 40, 0.08);
  overflow: hidden;
}

.brand-icon::before {
  content: "";
  position: absolute;
  top: 9px;
  right: 9px;
  width: 12px;
  height: 3px;
  border-radius: 999px;
  background: var(--portal-red);
  box-shadow: 0 2px 8px rgba(211, 21, 36, 0.24);
}

.brand-icon::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(15, 23, 42, 0.035);
  border-radius: 10px;
  pointer-events: none;
}

.brand-icon svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
  transform: translateZ(0);
}

.brand-icon svg * {
  vector-effect: non-scaling-stroke;
}

.brand-icon--wallet-recharge,
.brand-icon--wallet-deduct,
.brand-icon--completed {
  color: #176234;
  background:
    linear-gradient(180deg, #ffffff 0%, #f3fbf6 100%);
  border-color: #cfe9d7;
}

.brand-icon--wallet-frozen,
.brand-icon--manual-quote,
.brand-icon--in-progress {
  color: #80540d;
  background:
    linear-gradient(180deg, #ffffff 0%, #fff9ea 100%);
  border-color: #f0dcaa;
}

.brand-icon--referral-commission,
.brand-icon--director-support,
.brand-icon--category-exclusive {
  color: var(--portal-red);
  background:
    linear-gradient(180deg, #ffffff 0%, #fff4f5 100%);
  border-color: #ffd4d9;
}

.brand-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  border: 1px solid var(--portal-soft-border);
  color: var(--portal-ink);
  background: #f4f5f7;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.brand-status-badge.is-warning {
  color: #7b4d00;
  border-color: #f4d493;
  background: #fff8e8;
}

.brand-status-badge.is-active {
  color: #174ea6;
  border-color: #bfd4ff;
  background: #eff5ff;
}

.brand-status-badge.is-success {
  color: #116329;
  border-color: #b7e4c1;
  background: #eefaf1;
}

.brand-status-badge.is-danger {
  color: #9d101b;
  border-color: #ffc9cf;
  background: #fff0f1;
}

.brand-action-grid,
.brand-benefit-grid,
.brand-order-grid,
.brand-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.brand-action-panel {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 16px;
  color: var(--portal-ink);
  text-decoration: none;
}

.brand-action-panel strong,
.brand-benefit-card strong,
.brand-order-card strong {
  display: block;
  margin-bottom: 4px;
}

.brand-action-panel span,
.brand-benefit-card p,
.brand-order-card p {
  color: var(--portal-muted);
  line-height: 1.55;
}

.brand-benefit-card,
.brand-order-card {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.brand-benefit-card-head,
.brand-order-card-head,
.brand-wallet-row,
.brand-timeline-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}

.brand-benefit-card-title,
.brand-order-card-title {
  min-width: 0;
}

.brand-badge-row,
.brand-card-actions,
.brand-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.brand-money-line {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: baseline;
}

.brand-money-line strong {
  font-size: 22px;
}

.brand-market-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 18px;
  border: 1px solid #1d2027;
  border-radius: 12px;
  padding: 30px;
  background:
    linear-gradient(90deg, rgba(211, 21, 36, 0.18), rgba(211, 21, 36, 0) 42%),
    #090a0d;
  box-shadow: 0 24px 60px rgba(8, 9, 11, 0.16);
  overflow: hidden;
}

.brand-market-hero::after {
  content: "";
  position: absolute;
  right: -72px;
  top: -92px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.brand-market-hero-copy,
.brand-market-hero-panel {
  position: relative;
  z-index: 1;
}

.brand-market-hero-copy p,
.brand-market-section-head p {
  margin: 0 0 8px;
  color: var(--portal-red);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
}

.brand-market-hero-copy h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1;
  letter-spacing: 0;
}

.brand-market-hero-copy span {
  display: block;
  width: min(100%, 720px);
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 15px;
  line-height: 1.7;
}

.brand-market-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.brand-market-hero-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-self: end;
}

.brand-market-hero-panel div {
  min-height: 96px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.brand-market-hero-panel span {
  display: block;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 850;
}

.brand-market-hero-panel strong {
  display: block;
  margin-top: 8px;
  color: #ffffff;
  font-size: 34px;
  line-height: 1;
}

.brand-market-stepbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.brand-market-stepbar div,
.brand-market-category-card,
.brand-market-benefits {
  border: 1px solid var(--portal-soft-border);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.05);
}

.brand-market-stepbar div {
  padding: 14px 16px;
  border-left: 4px solid var(--portal-red);
}

.brand-market-stepbar strong,
.brand-market-stepbar span {
  display: block;
}

.brand-market-stepbar strong {
  font-size: 14px;
}

.brand-market-stepbar span {
  margin-top: 5px;
  color: var(--portal-muted);
  font-size: 12px;
  line-height: 1.5;
}

.brand-market-category-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.brand-market-category-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 116px;
  padding: 16px;
  overflow: hidden;
}

.brand-market-category-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--portal-red);
}

.brand-market-category-card span,
.brand-market-category-card strong,
.brand-market-category-card p {
  display: block;
}

.brand-market-category-card span {
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 900;
}

.brand-market-category-card strong {
  margin-top: 3px;
  font-size: 20px;
}

.brand-market-category-card p {
  margin: 6px 0 0;
  color: var(--portal-muted);
  font-size: 12px;
  line-height: 1.45;
}

.brand-market-benefits {
  padding: 22px;
}

.brand-market-section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 16px;
}

.brand-market-section-head h2 {
  margin: 0;
  font-size: 28px;
}

.brand-market-section-head > span {
  color: var(--portal-muted);
  font-size: 13px;
  font-weight: 900;
}

.brand-marketplace-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.brand-benefit-card--market {
  position: relative;
  align-content: start;
  gap: 14px;
  min-height: 430px;
  padding: 22px;
  border-radius: 10px;
  box-shadow: 0 16px 42px rgba(16, 24, 40, 0.07);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.brand-benefit-card--market::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--portal-red), #111318);
  border-radius: 10px 10px 0 0;
}

.brand-benefit-card--market:hover {
  transform: translateY(-2px);
  border-color: #cfd3db;
  box-shadow: 0 22px 56px rgba(16, 24, 40, 0.11);
}

.brand-benefit-card--market .brand-icon,
.brand-market-category-card .brand-icon {
  width: 50px;
  height: 50px;
  display: inline-grid;
  place-items: center;
  font-size: initial;
  line-height: 1;
}

.brand-benefit-card--market .brand-benefit-card-title strong {
  font-size: 19px;
  line-height: 1.35;
}

.brand-market-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 2px;
}

.brand-market-price strong {
  margin: 0;
  font-size: clamp(28px, 2.6vw, 36px);
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.brand-market-price span {
  color: var(--portal-muted);
  font-weight: 850;
}

.brand-benefit-lead {
  min-height: 48px;
  margin: 0;
  color: #4b5563 !important;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.65;
}

.brand-market-card-info {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #edf0f4;
  border-radius: 10px;
  background: #fbfcfe;
}

.brand-market-card-info span {
  display: block;
  color: var(--portal-muted);
  font-size: 11px;
  font-weight: 950;
}

.brand-market-card-info p {
  margin: 4px 0 0;
  color: #4b5563;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.55;
}

.brand-market-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 950;
  text-decoration: none;
  white-space: nowrap;
}

.brand-market-cta.primary {
  border: 1px solid var(--portal-red);
  background: var(--portal-red);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(211, 21, 36, 0.18);
}

.brand-market-cta.primary:hover {
  background: var(--portal-red-dark);
  border-color: var(--portal-red-dark);
}

.brand-market-cta.secondary {
  border: 1px solid #cfd3db;
  background: #ffffff;
  color: var(--portal-ink);
}

.brand-market-cta.secondary:hover {
  border-color: var(--portal-ink);
}

.brand-benefit-card--market .brand-card-actions {
  margin-top: auto;
  padding-top: 4px;
}

.brand-empty-state {
  padding: 18px;
  color: var(--portal-muted);
  line-height: 1.6;
}

.brand-timeline {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.brand-timeline-step {
  position: relative;
  padding: 12px;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  background: #fff;
}

.brand-timeline-step.is-done {
  border-color: #b7e4c1;
  background: #f5fcf6;
}

.brand-timeline-step.is-current {
  border-color: #f4d493;
  background: #fffaf0;
}

.brand-timeline-step strong {
  display: block;
  font-size: 13px;
}

.brand-timeline-step span {
  display: block;
  margin-top: 4px;
  color: var(--portal-muted);
  font-size: 12px;
  line-height: 1.45;
}

.brand-finance-grid,
.brand-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.brand-finance-card,
.brand-info-card {
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.brand-finance-card span,
.brand-info-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 800;
}

.brand-wallet-ledger {
  display: grid;
  gap: 10px;
}

.brand-wallet-row {
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.brand-wallet-row-main {
  flex: 1 1 auto;
  min-width: 0;
}

.brand-wallet-row-amount {
  text-align: right;
  min-width: 150px;
}

.brand-expiry-callout,
.brand-catalog-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid #f1cf8b;
  border-radius: 8px;
  padding: 16px;
  background: #fff8e8;
}

.brand-expiry-callout.is-calm {
  border-color: #cfe9d7;
  background: #f3fbf6;
}

.brand-expiry-callout span,
.brand-catalog-summary span,
.brand-lot-card span,
.brand-catalog-admin-card span,
.brand-allocation-list span {
  display: block;
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 850;
}

.brand-expiry-callout strong,
.brand-catalog-summary strong {
  display: block;
  margin-top: 3px;
  font-size: 22px;
}

.brand-expiry-callout p,
.brand-catalog-summary p {
  margin: 6px 0 0;
  color: var(--portal-muted);
  line-height: 1.55;
}

.brand-lot-grid,
.brand-catalog-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.brand-lot-card,
.brand-catalog-admin-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.05);
}

.brand-lot-card-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}

.brand-lot-card-head strong {
  display: block;
  overflow-wrap: anywhere;
}

.brand-lot-money-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.brand-lot-money-grid div {
  border: 1px solid #edf0f4;
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfe;
}

.brand-lot-money-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.brand-allocation-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.brand-allocation-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #edf0f4;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcfe;
}

.brand-catalog-summary {
  grid-template-columns: auto minmax(0, 1fr);
  margin: 14px 0;
  background: #fbfcfe;
  border-color: var(--portal-soft-border);
}

.brand-catalog-admin-grid {
  margin-top: 18px;
}

.brand-catalog-edit-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hq-benefit-ops-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  padding: 20px;
  background: #ffffff;
  box-shadow: 0 16px 42px rgba(16, 24, 40, 0.06);
}

.hq-benefit-ops-hero p {
  margin: 0 0 8px;
  color: var(--portal-red);
  font-size: 12px;
  font-weight: 950;
}

.hq-benefit-ops-hero h2 {
  margin: 0;
  font-size: 24px;
}

.hq-benefit-ops-hero span {
  display: block;
  max-width: 780px;
  margin-top: 8px;
  color: var(--portal-muted);
  line-height: 1.65;
}

.hq-benefit-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.hq-benefit-stat-grid article {
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.05);
}

.hq-benefit-stat-grid span,
.hq-benefit-admin-metrics span {
  display: block;
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 900;
}

.hq-benefit-stat-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 30px;
  line-height: 1;
}

.hq-benefit-stat-grid p {
  margin: 8px 0 0;
  color: var(--portal-muted);
  font-size: 12px;
  line-height: 1.45;
}

.hq-benefit-create {
  margin-bottom: 18px;
}

.hq-benefit-create > summary,
.hq-benefit-edit-details > summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.hq-benefit-create > summary::-webkit-details-marker,
.hq-benefit-edit-details > summary::-webkit-details-marker {
  display: none;
}

.hq-benefit-create > summary strong,
.hq-benefit-edit-details > summary {
  font-weight: 950;
}

.hq-benefit-create > summary small {
  display: block;
  margin-top: 4px;
  color: var(--portal-muted);
  font-size: 13px;
  line-height: 1.45;
}

.hq-benefit-create > summary b,
.hq-benefit-edit-details > summary {
  border: 1px solid #d8dde6;
  border-radius: 8px;
  padding: 9px 12px;
  background: #ffffff;
  color: var(--portal-ink);
  font-size: 13px;
}

.hq-benefit-create[open] > summary {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--portal-soft-border);
}

.hq-benefit-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hq-benefit-form .brand-form-section {
  grid-column: 1 / -1;
  margin-top: 4px;
}

.hq-benefit-form .brand-form-section h2 {
  margin: 0;
  font-size: 18px;
}

.hq-benefit-form .brand-form-section p {
  margin: 5px 0 0;
  color: var(--portal-muted);
  font-size: 13px;
  line-height: 1.45;
}

.hq-benefit-admin-list {
  display: grid;
  gap: 14px;
}

.hq-benefit-admin-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, auto);
  gap: 16px;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  padding: 18px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.05);
}

.hq-benefit-admin-card.is-retired {
  background: #fafbfc;
  opacity: 0.82;
}

.hq-benefit-card-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.hq-benefit-card-main p {
  margin: 6px 0 0;
  color: var(--portal-muted);
  font-size: 13px;
  line-height: 1.55;
}

.hq-benefit-admin-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.hq-benefit-admin-metrics div {
  min-width: 0;
  border: 1px solid #edf0f4;
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfe;
}

.hq-benefit-admin-metrics strong {
  display: block;
  margin-top: 5px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.hq-benefit-card-actions {
  display: grid;
  align-content: start;
  gap: 8px;
}

.hq-benefit-card-actions .portal-inline-form {
  display: block;
}

.hq-benefit-card-actions button,
.hq-benefit-card-actions .hq-benefit-edit-details > summary {
  width: 100%;
}

.hq-benefit-edit-details {
  grid-column: 1 / -1;
}

.hq-benefit-edit-details[open] {
  position: relative;
  grid-column: 1 / -1;
  margin-top: 8px;
  border-top: 1px solid var(--portal-soft-border);
  padding-top: 12px;
}

.hq-benefit-page-head h1 {
  letter-spacing: 0;
}

.portal-section-eyebrow {
  margin: 0 0 6px;
  color: var(--portal-color-danger);
  font-size: 12px;
  font-weight: 950;
}

.portal-action-primary,
.portal-form button.portal-action-primary,
.portal-form-grid button.portal-action-primary,
.portal-form-actions button.portal-action-primary,
.portal-filter-form button.portal-action-primary {
  border: 0;
  background: linear-gradient(180deg, var(--portal-color-primary) 0%, var(--portal-color-primary-strong) 100%);
  color: #ffffff;
  box-shadow: var(--portal-shadow-action);
}

.portal-action-secondary,
.portal-form button.portal-action-secondary,
.portal-form-grid button.portal-action-secondary,
.portal-form-actions button.portal-action-secondary {
  border: 1px solid var(--portal-soft-border);
  background: #ffffff;
  color: var(--portal-ink);
  box-shadow: none;
}

.portal-action-secondary:hover,
.portal-action-secondary:focus-visible {
  border-color: var(--portal-color-primary);
  color: var(--portal-color-primary-strong);
  background: #f8fbff;
}

.portal-icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--portal-soft-border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--portal-ink);
  font-size: 24px;
  line-height: 1;
  box-shadow: none;
}

.portal-status-badge.status-success {
  border-color: #bfe8d2;
  background: #effaf4;
  color: #167449;
}

.portal-status-badge.status-muted {
  border-color: #dbe2ea;
  background: #f4f7fb;
  color: #667085;
}

.portal-empty-state {
  border: 1px dashed var(--portal-soft-border);
  border-radius: 8px;
  padding: 22px;
  background: #fbfcfe;
  text-align: center;
}

.portal-empty-state h2 {
  margin: 0;
  font-size: 20px;
}

.portal-empty-state p {
  margin: 8px 0 0;
  color: var(--portal-muted);
}

.portal-points-formula {
  display: grid;
  gap: 8px;
  margin: 12px 0 16px;
  border: 1px solid #dce8ff;
  border-radius: 8px;
  padding: 14px;
  background: #f8fbff;
}

.portal-points-formula code {
  color: var(--portal-color-primary-strong);
  font-size: 15px;
  font-weight: 900;
  white-space: normal;
}

.portal-points-formula span {
  color: var(--portal-ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.portal-points-rule-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.portal-points-table {
  min-width: 860px;
}

.portal-list-page {
  display: grid;
  gap: 12px;
}

.portal-filter-bar {
  align-items: end;
  gap: 12px;
}

.portal-filter-bar input,
.portal-filter-bar select {
  min-height: 42px;
}

.portal-filter-bar__search {
  min-width: min(100%, 240px);
}

.portal-filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--portal-soft-border);
  border-radius: 999px;
  padding: 6px 12px;
  background: #ffffff;
  color: var(--portal-ink);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.portal-result-count {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  color: var(--portal-muted);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.portal-result-count strong {
  color: var(--portal-ink);
  font-size: 18px;
  font-weight: 950;
}

.portal-table-shell {
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.035);
}

.portal-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.portal-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.portal-table td.portal-table-actions,
.portal-table .portal-table-actions {
  vertical-align: middle;
}

.portal-row-action {
  white-space: nowrap;
}

.portal-row-meta {
  display: inline-block;
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.portal-mobile-card-list {
  min-width: 900px;
}

.portal-courses-table {
  min-width: 1040px;
}

.portal-courses-table th:nth-child(1),
.portal-courses-table td:nth-child(1),
.portal-courses-table th:nth-child(5),
.portal-courses-table td:nth-child(5),
.portal-courses-table th:nth-child(6),
.portal-courses-table td:nth-child(6),
.portal-courses-table th:nth-child(7),
.portal-courses-table td:nth-child(7),
.portal-courses-table th:nth-child(8),
.portal-courses-table td:nth-child(8) {
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.portal-enrolments-table,
.portal-audit-table,
.portal-resources-table,
.portal-cards-table,
.portal-certificates-table,
.portal-card-production-table,
.portal-card-production-attention-table {
  min-width: 980px;
}

.portal-hq-resources-page {
  display: grid;
  gap: 18px;
}

.portal-hq-resources-filter-panel,
.portal-hq-resources-editor,
.portal-hq-resources-list {
  padding: 18px;
}

.portal-hq-resources-filter {
  grid-template-columns: minmax(220px, 1.35fr) repeat(4, minmax(140px, 1fr)) minmax(220px, 0.95fr);
}

.portal-hq-resources-filter-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-self: end;
}

.portal-hq-resources-filter-actions > button,
.portal-hq-resources-filter-actions > a {
  width: 100%;
  justify-content: center;
  min-height: 42px;
}

.portal-hq-resources-editor .portal-panel-heading {
  align-items: flex-start;
}

.portal-hq-resources-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.portal-hq-resources-role-fieldset,
.portal-hq-resources-textarea,
.portal-hq-resources-save-bar {
  grid-column: 1 / -1;
}

.portal-hq-resources-role-fieldset {
  background: #fbfcff;
}

.portal-hq-resources-textarea textarea {
  min-height: 118px;
}

.portal-hq-resources-save-bar {
  justify-content: flex-end;
}

.portal-hq-resources-save-bar .portal-action-primary {
  min-width: 160px;
}

.portal-card-production-page {
  display: grid;
  gap: 18px;
}

.portal-card-production-command,
.portal-card-production-overview,
.portal-card-production-filter-panel,
.portal-card-production-section {
  padding: 18px;
}

.portal-card-production-tabs {
  justify-content: flex-end;
}

.portal-card-production-create {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(360px, 0.95fr);
  gap: 16px;
  align-items: end;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
}

.portal-card-production-create strong {
  display: block;
  color: var(--portal-ink);
  font-size: 14px;
  font-weight: 950;
}

.portal-card-production-create span {
  display: block;
  margin-top: 4px;
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.55;
}

.portal-card-production-create-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.portal-card-production-create-form input {
  min-height: 40px;
}

.portal-card-production-metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.portal-card-production-metrics .portal-metric-card {
  min-height: 112px;
}

.portal-card-production-metrics .portal-metric-card small {
  color: var(--portal-muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
}

.portal-card-production-filter {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(160px, 0.8fr) minmax(180px, 1fr) minmax(150px, 0.7fr) minmax(150px, 0.7fr) minmax(220px, 0.9fr);
}

.portal-card-production-filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: end;
}

.portal-card-production-filter-actions > button,
.portal-card-production-filter-actions > a {
  min-height: 42px;
}

.portal-card-production-section .portal-table-wrap {
  margin-top: 4px;
}

@media (max-width: 1280px) {
  .portal-hq-resources-filter {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .portal-hq-resources-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-card-production-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .portal-card-production-filter {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .portal-hq-resources-filter-panel,
  .portal-hq-resources-editor,
  .portal-hq-resources-list {
    padding: 14px;
  }

  .portal-hq-resources-filter,
  .portal-hq-resources-form,
  .portal-hq-resources-filter-actions {
    grid-template-columns: 1fr;
  }

  .portal-hq-resources-save-bar {
    justify-content: stretch;
  }

  .portal-hq-resources-save-bar > button,
  .portal-hq-resources-save-bar > a {
    width: 100%;
    justify-content: center;
  }

  .portal-card-production-command,
  .portal-card-production-overview,
  .portal-card-production-filter-panel,
  .portal-card-production-section {
    padding: 14px;
  }

  .portal-card-production-tabs,
  .portal-card-production-create,
  .portal-card-production-create-form,
  .portal-card-production-filter,
  .portal-card-production-filter-actions {
    grid-template-columns: 1fr;
  }

  .portal-card-production-tabs {
    justify-content: stretch;
  }

  .portal-card-production-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.portal-sensitive-boundary {
  position: relative;
}

.portal-regression-guard {
  scroll-margin-top: 88px;
}

.portal-blocked-action,
.portal-blocked-action:disabled {
  background: #e5e7eb !important;
  border-color: #d1d5db !important;
  box-shadow: none !important;
  color: #94a3b8 !important;
  cursor: not-allowed;
}

.portal-sensitive-boundary::before {
  content: "受保护信息：页面仅展示业务状态，敏感制卡与核验内容不会在列表中显示。";
  display: block;
  margin: 0 0 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  padding: 10px 12px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.45;
}

.portal-bulk-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--portal-soft-border);
  padding-top: 12px;
}

.hq-benefit-ops-hero {
  align-items: flex-start;
}

.hq-benefit-ops-hero p {
  color: var(--portal-color-danger);
}

.hq-benefit-ops-hero form,
.hq-benefit-toolbar-actions form {
  margin: 0;
}

.hq-benefit-stat-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.hq-benefit-stat-grid article {
  min-width: 0;
  padding: 14px;
}

.hq-benefit-stat-grid strong {
  color: var(--portal-ink);
}

.hq-benefit-directory {
  display: grid;
  gap: 14px;
  max-width: 100%;
  overflow: hidden;
}

.hq-benefit-toolbar-heading {
  align-items: flex-start;
  gap: 16px;
}

.hq-benefit-toolbar-heading h2 {
  margin: 0;
}

.hq-benefit-toolbar-heading span {
  display: block;
  margin-top: 6px;
  color: var(--portal-muted);
  font-size: 13px;
  line-height: 1.55;
}

.hq-benefit-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.hq-benefit-filter-bar {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
  max-width: 100%;
}

.hq-benefit-filter-bar label {
  min-width: 0;
}

.hq-benefit-filter-bar label span {
  display: block;
  margin-bottom: 6px;
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 900;
}

.hq-benefit-result-count {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  padding: 8px 12px;
  background: #fbfcfe;
  color: var(--portal-muted);
  font-weight: 850;
  white-space: nowrap;
}

.hq-benefit-result-count strong {
  margin-right: 4px;
  color: var(--portal-ink);
}

.hq-benefit-table-wrap {
  margin-top: 0;
  max-width: 100%;
  overflow-x: auto;
}

.hq-benefit-table {
  min-width: 1120px;
  table-layout: fixed;
}

.hq-benefit-table th:first-child,
.hq-benefit-table td:first-child {
  width: 270px;
}

.hq-benefit-table th:last-child,
.hq-benefit-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  width: 118px;
  background: #ffffff;
  box-shadow: -10px 0 18px rgba(15, 23, 42, 0.07);
}

.hq-benefit-table th:last-child {
  background: #f8fafc;
}

.hq-benefit-table th,
.hq-benefit-table td {
  vertical-align: top;
  padding: 10px 8px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hq-benefit-table .brand-status-badge {
  max-width: 100%;
  justify-content: center;
  white-space: normal;
  text-align: center;
  line-height: 1.25;
  padding: 4px 7px;
}

.hq-benefit-table-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  min-width: 260px;
}

.hq-benefit-table-title strong,
.hq-benefit-table-title small,
.hq-benefit-table-title p {
  display: block;
}

.hq-benefit-table-title small {
  margin-top: 3px;
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 850;
}

.hq-benefit-table-title p {
  max-width: 460px;
  margin: 6px 0 0;
  color: var(--portal-muted);
  font-size: 12px;
  line-height: 1.45;
}

.hq-benefit-row-actions {
  display: grid;
  min-width: 116px;
  gap: 8px;
}

.hq-benefit-row-actions .portal-inline-form {
  display: block;
}

.hq-benefit-row-actions button {
  width: 100%;
  min-height: 36px;
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 900;
}

.hq-benefit-row-actions .portal-action-secondary,
.hq-benefit-toolbar-actions .portal-action-secondary,
.hq-benefit-ops-hero .portal-action-secondary {
  border: 1px solid var(--portal-border);
  background: #ffffff;
  color: var(--portal-ink);
  box-shadow: none;
}

.hq-benefit-row-actions .portal-action-secondary:hover,
.hq-benefit-toolbar-actions .portal-action-secondary:hover,
.hq-benefit-ops-hero .portal-action-secondary:hover {
  border-color: var(--portal-color-primary);
  background: var(--portal-color-primary-bg);
  color: var(--portal-color-primary);
}

.hq-benefit-drawer-shell[hidden] {
  display: none;
}

.hq-benefit-drawer-shell {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 680px);
}

.hq-benefit-drawer-scrim {
  background: rgba(15, 23, 42, 0.36);
}

.hq-benefit-drawer {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  background: #ffffff;
  border-left: 1px solid var(--portal-soft-border);
  box-shadow: -24px 0 60px rgba(15, 23, 42, 0.2);
  overflow: auto;
}

.hq-benefit-drawer-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  border-bottom: 1px solid var(--portal-soft-border);
  padding: 22px;
  background: #ffffff;
}

.hq-benefit-drawer-head h2 {
  margin: 0;
  font-size: 26px;
}

.hq-benefit-drawer-head span {
  display: block;
  margin-top: 6px;
  color: var(--portal-muted);
  font-size: 13px;
  line-height: 1.5;
}

.hq-benefit-drawer-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 22px;
}

.hq-benefit-drawer-form input[readonly] {
  background: #f4f7fb;
  color: var(--portal-muted);
}

.hq-benefit-drawer-actions {
  position: sticky;
  bottom: 0;
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--portal-soft-border);
  margin: 0 -22px -22px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.portal-drawer-open {
  overflow: hidden;
}

@media (max-width: 1280px) {
  .hq-benefit-stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hq-benefit-filter-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hq-benefit-result-count {
    justify-content: flex-start;
  }
}

@media (max-width: 860px) {
  .hq-benefit-ops-hero,
  .hq-benefit-toolbar-heading,
  .hq-benefit-toolbar-actions {
    display: grid;
    justify-content: stretch;
  }

  .hq-benefit-toolbar-actions button,
  .hq-benefit-toolbar-actions form {
    width: 100%;
  }

  .hq-benefit-stat-grid,
  .hq-benefit-filter-bar {
    grid-template-columns: 1fr;
  }

  .hq-benefit-table-wrap {
    overflow: visible;
  }

  .hq-benefit-table.portal-responsive-table,
  .hq-benefit-table.portal-responsive-table thead,
  .hq-benefit-table.portal-responsive-table tbody,
  .hq-benefit-table.portal-responsive-table tr,
  .hq-benefit-table.portal-responsive-table th,
  .hq-benefit-table.portal-responsive-table td {
    display: block;
  }

  .hq-benefit-table.portal-responsive-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .hq-benefit-table.portal-responsive-table tr {
    border: 1px solid var(--portal-soft-border);
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 12px;
    background: #ffffff;
  }

  .hq-benefit-table.portal-responsive-table td {
    border: 0;
    padding: 8px 0;
  }

  .hq-benefit-table.portal-responsive-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--portal-muted);
    font-size: 12px;
    font-weight: 900;
  }

  .hq-benefit-table-title {
    min-width: 0;
  }

  .hq-benefit-row-actions {
    grid-template-columns: 1fr 1fr;
  }

  .hq-benefit-drawer-shell {
    grid-template-columns: 1fr;
  }

  .hq-benefit-drawer-scrim {
    display: none;
  }

  .hq-benefit-drawer {
    height: 100dvh;
    border-left: 0;
  }

  .hq-benefit-drawer-head,
  .hq-benefit-drawer-form {
    padding: 16px;
  }

  .hq-benefit-drawer-head h2 {
    font-size: 22px;
  }

  .hq-benefit-drawer-form {
    grid-template-columns: 1fr;
  }

  .hq-benefit-drawer-actions {
    margin: 0 -16px -16px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }

  .hq-benefit-drawer-actions button {
    min-height: 44px;
  }
}

.brand-recharge-confirm-form {
  align-items: end;
}

.brand-step-header {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.brand-step-header span {
  border: 1px solid var(--portal-soft-border);
  border-radius: 999px;
  padding: 10px 12px;
  background: #fff;
  font-size: 13px;
  font-weight: 900;
}

.brand-form-section {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--portal-soft-border);
}

.brand-form-section h2,
.brand-form-section h3 {
  margin: 0 0 6px;
}

.brand-service-choice-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 8px;
}

.brand-service-choice {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
}

.media-cockpit {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 18px;
  margin-bottom: 18px;
}

.media-cockpit-main,
.media-cockpit-side,
.media-kpi-card,
.media-card,
.media-referral-card,
.media-action-panel,
.media-empty-state {
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  background: var(--portal-white);
  box-shadow: var(--portal-shadow);
}

.media-cockpit-main,
.media-cockpit-side {
  padding: 22px;
}

.media-kicker {
  margin: 0 0 8px;
  color: var(--portal-red);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
}

.media-cockpit h1 {
  margin: 0;
  letter-spacing: 0;
}

.media-cockpit p,
.media-cockpit-side span,
.media-card p,
.media-referral-card span,
.media-table span {
  color: var(--portal-muted);
  line-height: 1.55;
}

.media-action-row,
.media-action-stack,
.media-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.media-summary-grid,
.media-section-grid,
.media-code-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

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

.media-kpi-card,
.media-action-panel,
.media-empty-state,
.media-card-head {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.media-kpi-card,
.media-card,
.media-referral-card,
.media-action-panel,
.media-empty-state {
  padding: 16px;
}

.media-kpi-card span {
  display: block;
  color: var(--portal-muted);
  font-size: 13px;
  font-weight: 850;
}

.media-kpi-card strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(19px, 2vw, 26px);
  letter-spacing: 0;
}

.media-card,
.media-referral-card {
  display: grid;
  gap: 12px;
  align-content: start;
}

.media-card h2 {
  margin: 0 0 4px;
  font-size: 17px;
  letter-spacing: 0;
}

.media-card > strong {
  font-size: 24px;
}

.media-action-panel {
  color: var(--portal-ink);
  text-decoration: none;
}

.media-card-form {
  box-shadow: none;
  border: 0;
  padding: 0;
  margin-top: 4px;
}

.media-link-card {
  align-content: stretch;
}

.media-copy-button {
  width: fit-content;
}

.media-code-box,
.media-referral-card code {
  display: block;
  width: 100%;
  overflow-wrap: anywhere;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  padding: 10px;
  background: #f7f8fa;
  color: var(--portal-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.media-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  border: 1px solid var(--portal-soft-border);
  background: #f4f5f7;
  color: var(--portal-ink);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.media-status-badge.is-warning {
  color: #7b4d00;
  border-color: #f4d493;
  background: #fff8e8;
}

.media-status-badge.is-success {
  color: #116329;
  border-color: #b7e4c1;
  background: #eefaf1;
}

.media-status-badge.is-danger {
  color: #9d101b;
  border-color: #ffc9cf;
  background: #fff0f1;
}

.media-status-badge.is-active {
  color: #174ea6;
  border-color: #bfd4ff;
  background: #eff5ff;
}

.media-onboarding-panel {
  display: grid;
  gap: 16px;
}

.media-onboarding-head {
  align-items: flex-start;
  gap: 16px;
}

.media-onboarding-alert,
.media-return-note {
  margin-bottom: 14px;
}

.media-onboarding-form {
  align-items: start;
}

.media-onboarding-rule-copy {
  max-width: 860px;
  margin: 10px 0 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.7;
}

.media-onboarding-error-summary {
  outline: none;
}

.media-onboarding-error-summary ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.media-onboarding-error-summary a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.media-form-section-title {
  display: grid;
  gap: 4px;
  margin-top: 4px;
  padding: 14px 16px;
  border: 1px solid #dbe5f0;
  border-radius: 8px;
  background: #f8fafc;
}

.media-form-section-title h3 {
  margin: 0;
  color: #0f172a;
  font-size: 17px;
  line-height: 1.35;
}

.media-form-section-title p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}

.media-field-requirement {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  width: max-content;
  min-height: 22px;
  margin-left: 6px;
  padding: 0 8px;
  border: 1px solid #d8e2ef;
  border-radius: 999px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
}

.media-field-requirement.is-required {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.media-field-error {
  display: block;
  margin-top: 6px;
  color: #b42318;
  font-size: 13px;
  line-height: 1.45;
}

.media-onboarding-form input[aria-invalid="true"],
.media-onboarding-form select[aria-invalid="true"],
.media-onboarding-form textarea[aria-invalid="true"] {
  border-color: #d92d20;
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.12);
}

.media-onboarding-actions {
  justify-content: flex-start;
}

.media-onboarding-dashboard-state {
  align-items: flex-start;
  max-width: 900px;
}

.portal-mobile .media-onboarding-head,
.portal-mobile .media-onboarding-actions {
  align-items: stretch;
  flex-direction: column;
}

.portal-mobile .media-form-section-title {
  padding: 12px;
}

.portal-mobile .media-field-requirement {
  margin-left: 4px;
  padding: 0 7px;
  font-size: 11px;
}

.media-table th,
.media-table td {
  min-width: 112px;
  vertical-align: top;
}

.media-table th:first-child,
.media-table td:first-child {
  min-width: 150px;
}

.media-table code {
  display: inline-block;
  max-width: 420px;
  overflow-wrap: anywhere;
  white-space: normal;
}

@media (max-width: 980px) {
  .portal-cockpit,
  .media-cockpit,
  .brand-market-hero,
  .portal-summary-grid,
  .media-summary-grid,
  .media-section-grid,
  .media-code-grid,
  .brand-action-grid,
  .brand-benefit-grid,
  .brand-order-grid,
  .brand-category-grid,
  .brand-market-category-strip,
  .brand-market-stepbar,
  .brand-finance-grid,
  .brand-info-grid,
  .brand-lot-money-grid,
  .hq-benefit-stat-grid,
  .hq-benefit-form,
  .hq-benefit-admin-card,
  .hq-benefit-admin-metrics,
  .brand-service-choice-grid,
  .brand-step-header,
  .brand-catalog-edit-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brand-timeline {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .portal-cockpit,
  .media-cockpit,
  .brand-market-hero,
  .portal-summary-grid,
  .media-summary-grid,
  .media-section-grid,
  .media-code-grid,
  .brand-action-grid,
  .brand-benefit-grid,
  .brand-order-grid,
  .brand-category-grid,
  .brand-market-category-strip,
  .brand-market-stepbar,
  .brand-finance-grid,
  .brand-info-grid,
  .brand-lot-grid,
  .brand-lot-money-grid,
  .brand-catalog-admin-grid,
  .hq-benefit-stat-grid,
  .hq-benefit-form,
  .hq-benefit-admin-card,
  .hq-benefit-admin-metrics,
  .brand-service-choice-grid,
  .brand-step-header,
  .brand-catalog-edit-form {
    grid-template-columns: 1fr;
  }

  .brand-market-hero,
  .brand-market-benefits {
    padding: 18px;
  }

  .brand-market-hero-panel {
    grid-template-columns: 1fr;
  }

  .brand-market-section-head {
    display: grid;
    align-items: start;
  }

  .hq-benefit-ops-hero {
    display: grid;
    padding: 18px;
  }

  .hq-benefit-create > summary {
    display: grid;
  }

  .brand-marketplace-grid {
    grid-template-columns: 1fr;
  }

  .brand-wallet-row {
    display: grid;
  }

  .brand-wallet-row-amount {
    text-align: left;
    min-width: 0;
  }

  .brand-expiry-callout,
  .brand-catalog-summary,
  .brand-allocation-list div {
    grid-template-columns: 1fr;
    display: grid;
  }
}

.media-dashboard-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.7fr);
  gap: 16px;
  margin-bottom: 16px;
}

.media-ops-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.65fr);
  gap: 16px;
  margin-bottom: 16px;
}

.media-ops-dashboard *,
.media-ops-widgets *,
.media-code-panel * {
  box-sizing: border-box;
  min-width: 0;
}

.media-ops-main,
.media-widget,
.media-ops-side {
  box-sizing: border-box;
  max-width: 100%;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  background: var(--portal-white);
  box-shadow: var(--portal-shadow);
}

.media-ops-main {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.media-ops-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.media-ops-header > div {
  min-width: 0;
}

.media-ops-header h1 {
  margin: 0;
  font-size: clamp(28px, 2.7vw, 40px);
  line-height: 1.12;
  letter-spacing: 0;
  word-break: keep-all;
}

.media-ops-header p:not(.media-eyebrow) {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--portal-muted);
  font-size: 14px;
  line-height: 1.6;
}

.media-eyebrow {
  margin: 0 0 6px;
  color: var(--portal-red);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
}

.media-ops-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.media-ops-card {
  box-sizing: border-box;
  max-width: 100%;
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid #e3e7ee;
  border-radius: 8px;
  padding: 13px;
  background: #fbfcfe;
  color: var(--portal-ink);
  text-decoration: none;
}

.media-ops-card span,
.media-widget-list span {
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 900;
}

.media-ops-card strong {
  min-width: 0;
  font-size: clamp(18px, 1.55vw, 22px);
  font-weight: 950;
  line-height: 1.15;
  overflow-wrap: normal;
  word-break: keep-all;
}

.media-ops-card small {
  color: #6f7785;
  font-size: 12px;
  line-height: 1.35;
}

.media-ops-side {
  padding: 18px;
}

.media-ops-widgets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.media-widget {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 232px;
  padding: 16px;
}

.media-step-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.media-step-list li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.media-step-list li > span {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #eef3ff;
  color: #2554d9;
  font-size: 12px;
  font-weight: 950;
}

.media-step-list strong,
.media-widget-list strong,
.media-timeline strong {
  color: var(--portal-ink);
  font-weight: 950;
}

.media-step-list small,
.media-timeline small,
.media-compliance-mini p {
  color: var(--portal-muted);
  font-size: 13px;
  line-height: 1.5;
}

.media-step-list em {
  color: var(--portal-ink);
  font-style: normal;
  font-weight: 950;
  white-space: nowrap;
}

.media-widget-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
}

.media-widget-list div {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--portal-soft-border);
  background: #fbfcfe;
}

.media-widget-list div:last-child {
  border-bottom: 0;
}

.media-timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.media-timeline div {
  position: relative;
  box-sizing: border-box;
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  padding: 13px 13px 13px 34px;
  background: #fbfcfe;
}

.media-timeline div > span {
  position: absolute;
  top: 16px;
  left: 13px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--portal-red);
  box-shadow: 0 0 0 4px rgba(211, 21, 36, 0.1);
}

.media-compliance-mini {
  background: #fbfcfe;
}

.media-command-center,
.media-identity-card {
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  background: var(--portal-white);
  box-shadow: var(--portal-shadow);
}

.media-command-center {
  position: relative;
  display: grid;
  gap: 18px;
  overflow: hidden;
  padding: 22px;
  background:
    linear-gradient(135deg, #ffffff 0%, #ffffff 62%, #f7f8fb 100%);
}

.media-command-center::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--portal-red) 0%, #111827 36%, #176234 68%, #b7791f 100%);
}

.media-command-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.media-command-copy {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--portal-muted);
  font-size: 15px;
  line-height: 1.75;
}

.media-command-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  background: #fbfcfe;
}

.media-command-strip > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 14px 16px;
  border-right: 1px solid var(--portal-soft-border);
}

.media-command-strip > div:last-child {
  border-right: 0;
}

.media-command-strip span,
.media-identity-head span,
.media-metric-card span,
.media-finance-head span {
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.3;
}

.media-command-strip strong,
.media-identity-head strong {
  min-width: 0;
  color: var(--portal-ink);
  font-size: 18px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.media-command-strip small,
.media-metric-card small {
  color: #6f7785;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.media-command-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.media-action-button {
  box-sizing: border-box;
  max-width: 100%;
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #dfe3ea;
  border-radius: 8px;
  padding: 8px 12px;
  background: #ffffff;
  color: var(--portal-ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.04);
}

.media-action-button:hover {
  border-color: #c7ccd6;
  transform: translateY(-1px);
}

.media-action-button.is-primary {
  border-color: var(--portal-red-dark);
  background: linear-gradient(180deg, var(--portal-red) 0%, var(--portal-red-dark) 100%);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(211, 21, 36, 0.18);
}

.media-action-button.is-compact {
  min-height: 38px;
  padding: 7px 10px;
}

.media-action-button .brand-icon,
.media-dashboard-shell .brand-icon,
.media-metric-card .brand-icon,
.media-finance-card .brand-icon,
.media-code-card .brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94), 0 8px 16px rgba(16, 24, 40, 0.06);
}

.media-action-button .brand-icon svg,
.media-dashboard-shell .brand-icon svg,
.media-metric-card .brand-icon svg,
.media-finance-card .brand-icon svg,
.media-code-card .brand-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.35;
}

.media-action-button .brand-icon::before,
.media-dashboard-shell .brand-icon::before,
.media-metric-card .brand-icon::before,
.media-finance-card .brand-icon::before,
.media-code-card .brand-icon::before {
  top: 6px;
  right: 6px;
  width: 8px;
  height: 2px;
}

.media-action-button .brand-icon::after,
.media-dashboard-shell .brand-icon::after,
.media-metric-card .brand-icon::after,
.media-finance-card .brand-icon::after,
.media-code-card .brand-icon::after {
  inset: 4px;
  border-radius: 6px;
}

.media-action-button.is-primary .brand-icon {
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  box-shadow: none;
}

.media-action-button.is-primary .brand-icon::before,
.media-action-button.is-primary .brand-icon::after {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.75);
}

.media-identity-card {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 20px;
}

.media-identity-head,
.media-code-main,
.media-finance-head {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.media-identity-head div,
.media-code-main div,
.media-finance-head div {
  min-width: 0;
}

.media-identity-list {
  display: grid;
  gap: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
}

.media-identity-list div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--portal-soft-border);
  background: #fbfcfe;
}

.media-identity-list div:last-child {
  border-bottom: 0;
}

.media-identity-list dt,
.media-identity-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.45;
}

.media-identity-list dt {
  color: var(--portal-muted);
  font-weight: 850;
}

.media-identity-list dd {
  color: var(--portal-ink);
  font-weight: 900;
}

.media-metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.media-metric-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  gap: 3px 10px;
  min-height: 118px;
  align-content: center;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
  color: var(--portal-ink);
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.045);
}

.media-metric-card:hover {
  border-color: #d0d5df;
  box-shadow: 0 14px 30px rgba(16, 24, 40, 0.07);
}

.media-metric-card .brand-icon {
  grid-row: 1 / span 3;
  align-self: start;
}

.media-metric-card strong {
  min-width: 0;
  font-size: 24px;
  font-weight: 950;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.media-metric-card.is-money {
  border-color: #efd8a3;
  background: linear-gradient(180deg, #ffffff 0%, #fffaf0 100%);
}

.media-metric-card.is-paid {
  border-color: #cae6d2;
  background: linear-gradient(180deg, #ffffff 0%, #f4fbf6 100%);
}

/* BUG-127: media profile "suggested to complete" chips */
.media-missing-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* BUG-129: media avatar controlled upload */
.media-avatar-upload {
  margin-bottom: 16px;
}

.media-avatar-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 12px;
}

.media-avatar-preview img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.media-avatar-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.media-avatar-legacy {
  word-break: break-all;
}

.media-finance-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.media-finance-card {
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 210px;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  padding: 18px;
  background: #ffffff;
  box-shadow: var(--portal-shadow);
}

.media-finance-head h2 {
  margin: 2px 0 0;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: 0;
}

.media-finance-card p {
  min-height: 54px;
  margin: 0;
  color: var(--portal-muted);
  font-size: 14px;
  line-height: 1.65;
}

.media-finance-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--portal-soft-border);
  color: var(--portal-muted);
  font-size: 13px;
  font-weight: 850;
}

.media-finance-foot a {
  color: var(--portal-ink);
  font-weight: 950;
  text-decoration: none;
}

.media-code-panel {
  margin-top: 16px;
}

.media-section-title {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.media-section-title p {
  margin: 0 0 4px;
  color: var(--portal-red);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.media-section-title h2 {
  margin: 0;
  font-size: 20px;
}

.media-code-list {
  display: grid;
  gap: 10px;
}

.media-code-card {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(260px, 1.35fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

.media-code-main strong {
  display: block;
  min-width: 0;
  color: var(--portal-ink);
  font-size: 18px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.media-code-main span {
  display: block;
  margin-top: 3px;
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 850;
}

.media-code-card code {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  border: 1px solid #e1e5ec;
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  color: var(--portal-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.media-code-card .media-copy-button {
  min-height: 36px;
  padding: 9px 12px;
  white-space: nowrap;
}

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

  .media-ops-header {
    grid-template-columns: 1fr;
  }

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

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

  .media-metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .media-code-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .media-code-card code {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .media-dashboard-shell,
  .media-finance-board {
    grid-template-columns: 1fr;
  }

  .media-command-strip {
    grid-template-columns: 1fr;
  }

  .media-command-strip > div {
    border-right: 0;
    border-bottom: 1px solid var(--portal-soft-border);
  }

  .media-command-strip > div:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 720px) {
  .media-command-header,
  .media-metric-grid,
  .media-ops-metrics,
  .media-ops-widgets,
  .media-timeline {
    grid-template-columns: 1fr;
  }

  .media-identity-head {
    flex-wrap: wrap;
  }

  .media-ops-header .portal-primary-action {
    box-sizing: border-box;
    width: 100%;
  }

  .media-identity-card,
  .media-ops-main,
  .media-widget {
    width: 100%;
  }

  .media-command-center,
  .media-identity-card {
    padding: 16px;
  }

  .media-command-actions {
    align-items: stretch;
  }

  .media-action-button {
    width: 100%;
    justify-content: flex-start;
  }

  .media-code-card {
    grid-template-columns: 1fr;
  }

  .media-code-card .media-status-badge,
  .media-code-card .media-copy-button {
    width: fit-content;
  }
}

@media (max-width: 900px) {
  .legacy-migration-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .legacy-migration-hero {
    grid-template-columns: 1fr;
  }

  .portal-mobile {
    background: #f7f8fa;
    overflow-x: hidden;
  }

  .portal-mobile .portal-shell,
  .portal-mobile .portal-main,
  .portal-mobile .portal-content {
    max-width: 100%;
    overflow-x: hidden;
  }

  .portal-mobile .portal-topbar {
    height: 64px;
    gap: 10px;
    padding: 10px 12px;
  }

  .portal-mobile .portal-menu-button {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .portal-mobile .portal-brand-row {
    flex: 0 0 auto;
    gap: 8px;
  }

  .portal-mobile .portal-brand {
    gap: 8px;
  }

  .portal-mobile .portal-brand img {
    width: 78px;
  }

  .portal-mobile .portal-brand span,
  .portal-mobile .portal-language-toggle,
  .portal-mobile .portal-topbar-actions > [data-portal-view-toggle],
  .portal-mobile .portal-notice {
    display: none;
  }

  .portal-mobile .portal-mobile-quick-actions {
    display: grid;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--portal-soft-border);
    background: #ffffff;
  }

  .portal-mobile .portal-mobile-quick-row,
  .portal-mobile .portal-mobile-language-form,
  .portal-mobile .portal-mobile-role-switcher,
  .portal-mobile .portal-mobile-quick-links {
    min-width: 0;
  }

  .portal-mobile .portal-mobile-quick-row--controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .portal-mobile .portal-mobile-language-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--portal-soft-border);
    border-radius: 10px;
    background: #f8fafc;
  }

  .portal-mobile .portal-mobile-language-form > span,
  .portal-mobile .portal-mobile-role-switcher summary > span,
  .portal-mobile .portal-mobile-quick-links a span {
    min-width: 0;
    color: var(--portal-muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
  }

  .portal-mobile .portal-mobile-language-form strong,
  .portal-mobile .portal-mobile-role-switcher summary strong {
    color: var(--portal-ink);
    font-weight: 950;
  }

  .portal-mobile .portal-mobile-quick-button {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid rgba(37, 99, 235, 0.28);
    border-radius: 999px;
    padding: 0 12px;
    background: #ffffff;
    color: #1d4ed8;
    font: inherit;
    font-size: 12px;
    font-weight: 950;
    white-space: nowrap;
  }

  .portal-mobile .portal-mobile-quick-button span {
    color: inherit;
  }

  .portal-mobile .portal-mobile-role-switcher {
    border: 1px solid var(--portal-soft-border);
    border-radius: 10px;
    background: #ffffff;
  }

  .portal-mobile .portal-mobile-role-switcher summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px;
    cursor: pointer;
  }

  .portal-mobile .portal-mobile-role-switcher summary::after {
    content: "⌄";
    color: var(--portal-muted);
    font-size: 12px;
    font-weight: 900;
  }

  .portal-mobile .portal-mobile-role-list {
    display: grid;
    gap: 6px;
    padding: 0 10px 10px;
  }

  .portal-mobile .portal-mobile-role-list form {
    margin: 0;
  }

  .portal-mobile .portal-mobile-role-option {
    display: grid;
    width: 100%;
    min-height: 44px;
    gap: 2px;
    justify-items: start;
    border: 1px solid #e4e9f2;
    border-radius: 8px;
    padding: 8px 10px;
    background: #ffffff;
    color: var(--portal-ink);
    font: inherit;
    text-align: left;
  }

  .portal-mobile .portal-mobile-role-option.is-active {
    border-color: rgba(37, 99, 235, 0.4);
    background: rgba(37, 99, 235, 0.08);
  }

  .portal-mobile .portal-mobile-role-option span {
    font-size: 13px;
    font-weight: 950;
  }

  .portal-mobile .portal-mobile-role-option em {
    color: var(--portal-muted);
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
  }

  .portal-mobile .portal-mobile-quick-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .portal-mobile .portal-mobile-quick-links a {
    display: grid;
    min-width: 0;
    gap: 3px;
    border: 1px solid var(--portal-soft-border);
    border-radius: 10px;
    padding: 10px;
    background: #ffffff;
    color: var(--portal-ink);
    text-decoration: none;
  }

  .portal-mobile .portal-mobile-quick-links a.is-active {
    border-color: rgba(37, 99, 235, 0.36);
    background: rgba(37, 99, 235, 0.08);
  }

  .portal-mobile .portal-mobile-quick-links a strong {
    min-width: 0;
    overflow: visible;
    color: var(--portal-ink);
    font-size: 13px;
    font-weight: 950;
    line-height: 1.18;
    white-space: normal;
  }

  .portal-mobile .portal-mobile-page-title {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
    gap: 2px;
  }

  .portal-mobile .portal-mobile-page-title strong,
  .portal-mobile .portal-mobile-page-title span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .portal-mobile .portal-mobile-page-title strong {
    color: var(--portal-ink);
    font-size: 14px;
    font-weight: 950;
    line-height: 1.2;
  }

  .portal-mobile .portal-mobile-page-title span {
    color: var(--portal-muted);
    font-size: 12px;
    font-weight: 850;
  }

  .portal-mobile .portal-topbar-actions {
    flex: 0 0 auto;
    gap: 7px;
  }

  .portal-mobile .portal-role-pill {
    max-width: 88px;
    padding: 5px 8px;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .portal-mobile .portal-link-button {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 12px;
  }

  .portal-mobile .portal-shell {
    display: block;
    min-height: calc(100vh - 64px);
  }

  .portal-mobile .portal-sidebar {
    position: fixed;
    top: 64px;
    bottom: 0;
    left: min(-88vw, -336px);
    z-index: 60;
    width: min(88vw, 336px);
    height: auto;
    padding: 16px;
    transition: left 180ms ease;
    box-shadow: 18px 0 42px rgba(0, 0, 0, 0.2);
  }

  .portal-mobile .portal-drawer-toggle:checked ~ .portal-shell .portal-sidebar {
    left: 0;
  }

  .portal-mobile .portal-drawer-toggle:checked ~ .portal-shell .portal-mobile-nav {
    display: none;
  }

  .portal-mobile .portal-drawer-toggle:checked ~ .portal-scrim {
    display: block;
    position: fixed;
    inset: 64px 0 0;
    z-index: 55;
    background: rgba(8, 9, 11, 0.42);
  }

  .portal-mobile .portal-role-form {
    position: sticky;
    top: -16px;
    z-index: 2;
    margin: 14px 0 18px;
    padding: 12px 0;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  }

  .portal-mobile .portal-mobile-toggle-drawer {
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: center;
  }

  .portal-mobile .portal-main {
    padding: 14px 12px calc(128px + env(safe-area-inset-bottom));
  }

  .portal-mobile .portal-content {
    padding-bottom: calc(36px + env(safe-area-inset-bottom));
  }

  .portal-mobile .portal-mobile-helper {
    display: flex;
    justify-content: space-between;
    margin: 0 0 14px;
  }

  .portal-mobile .portal-desktop-recommendation {
    display: grid;
    align-items: start;
    margin: 0 0 14px;
  }

  .portal-mobile .portal-desktop-recommendation button {
    justify-self: start;
  }

  .portal-mobile .portal-page-head {
    margin-bottom: 14px;
  }

  .portal-mobile .portal-page-head p {
    margin-top: 0;
  }

  .portal-mobile .portal-page-head h1 {
    font-size: 24px;
    line-height: 1.18;
  }

  .portal-mobile .portal-page-head-card {
    min-height: auto;
    padding: 16px;
  }

  .portal-mobile .portal-panel {
    min-height: auto;
    padding: 16px;
  }

  .portal-mobile .portal-grid,
  .portal-mobile .portal-card-list,
  .portal-mobile .portal-detail-grid,
  .portal-mobile .portal-card-row,
  .portal-mobile .portal-filter-form,
  .portal-mobile .portal-inline-filter-form,
  .portal-mobile .portal-form-grid,
  .portal-mobile .portal-user-detail-grid,
  .portal-mobile .portal-user-role-form,
  .portal-mobile .portal-card-search-form,
  .portal-mobile .portal-timeline,
  .portal-mobile .portal-cockpit,
  .portal-mobile .portal-summary-grid,
  .portal-mobile .brand-action-grid,
  .portal-mobile .brand-benefit-grid,
  .portal-mobile .brand-order-grid,
  .portal-mobile .brand-category-grid,
  .portal-mobile .brand-finance-grid,
  .portal-mobile .brand-info-grid,
  .portal-mobile .brand-lot-grid,
  .portal-mobile .brand-catalog-admin-grid,
  .portal-mobile .media-cockpit,
  .portal-mobile .media-dashboard-shell,
  .portal-mobile .media-summary-grid,
  .portal-mobile .media-section-grid,
  .portal-mobile .media-code-grid,
  .portal-mobile .media-finance-board {
    grid-template-columns: 1fr;
  }

  .portal-mobile .portal-user-detail-grid {
    grid-template-areas:
      "profile"
      "org"
      "cardCurrent"
      "roles"
      "cardBind";
  }

  .portal-mobile .portal-form input,
  .portal-mobile .portal-form select,
  .portal-mobile .portal-form textarea,
  .portal-mobile .portal-form-grid input,
  .portal-mobile .portal-form-grid select,
  .portal-mobile .portal-form-grid textarea,
  .portal-mobile .portal-filter-form input,
  .portal-mobile .portal-filter-form select,
  .portal-mobile .portal-role-form select,
  .portal-mobile .portal-form-stack input,
  .portal-mobile .portal-form-stack select,
  .portal-mobile .portal-form-stack textarea {
    min-height: 44px;
    font-size: 16px;
  }

  .portal-mobile .portal-opening-student-grid,
  .portal-mobile .portal-opening-students-head,
  .portal-mobile .portal-opening-student-row-head {
    grid-template-columns: 1fr;
  }

  .portal-mobile .portal-opening-students-head,
  .portal-mobile .portal-opening-student-row-head {
    display: grid;
  }

  .portal-mobile .portal-form button,
  .portal-mobile .portal-filter-form button,
  .portal-mobile .portal-form-grid button,
  .portal-mobile .portal-form-stack button,
  .portal-mobile .portal-small-button,
  .portal-mobile .portal-secondary-button,
  .portal-mobile .portal-secondary-action,
  .portal-mobile .brand-market-cta,
  .portal-mobile .media-action-button {
    min-height: 44px;
  }

  .portal-mobile .portal-form-actions,
  .portal-mobile .portal-action-row,
  .portal-mobile .brand-card-actions,
  .portal-mobile .brand-quick-links,
  .portal-mobile .media-command-actions {
    align-items: stretch;
  }

  .portal-mobile .portal-form-actions > *,
  .portal-mobile .portal-action-row > *,
  .portal-mobile .brand-card-actions > *,
  .portal-mobile .media-command-actions > * {
    justify-content: center;
  }

  .portal-mobile .portal-opening-detail-actions .portal-inline-form {
    width: 100%;
    min-width: 0;
  }

  .portal-mobile .portal-mobile-nav {
    display: grid;
    grid-template-columns: repeat(var(--portal-mobile-nav-count, 5), minmax(0, 1fr));
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 70;
    gap: 6px;
    padding: 8px max(10px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    border-top: 1px solid var(--portal-soft-border);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -14px 34px rgba(16, 24, 40, 0.12);
    backdrop-filter: blur(16px);
  }

  .portal-mobile .portal-mobile-nav--count-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  .portal-mobile .portal-mobile-nav--count-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-mobile .portal-mobile-nav--count-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .portal-mobile .portal-mobile-nav--count-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .portal-mobile .portal-mobile-nav--count-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

  .portal-mobile .portal-mobile-nav-item {
    display: grid;
    min-width: 0;
    min-height: 54px;
    align-content: center;
    justify-items: center;
    gap: 4px;
    border-radius: 12px;
    color: var(--portal-muted);
    font-size: 11px;
    font-weight: 950;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
  }

  .portal-mobile .portal-mobile-nav-item strong {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
  }

  .portal-mobile .portal-mobile-nav-icon {
    display: inline-grid;
    width: 28px;
    height: 26px;
    place-items: center;
    border-radius: 999px;
    color: currentColor;
  }

  .portal-mobile .portal-mobile-nav-icon svg {
    display: block;
    width: 21px;
    height: 21px;
    fill: currentColor;
  }

  .portal-mobile .portal-mobile-nav-item.is-active {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
  }

  .portal-mobile .portal-mobile-nav-item.is-active .portal-mobile-nav-icon {
    background: rgba(37, 99, 235, 0.14);
  }
}

@media (max-width: 640px) {
  .portal-mobile .portal-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .portal-mobile .portal-responsive-table,
  .portal-mobile .portal-responsive-table thead,
  .portal-mobile .portal-responsive-table tbody,
  .portal-mobile .portal-responsive-table tr,
  .portal-mobile .portal-responsive-table th,
  .portal-mobile .portal-responsive-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .portal-mobile .portal-responsive-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
  }

  .portal-mobile .portal-responsive-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .portal-mobile .portal-responsive-table tr {
    margin-bottom: 12px;
    border: 1px solid var(--portal-soft-border);
    border-radius: 8px;
    padding: 8px 12px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.045);
  }

  .portal-mobile .portal-responsive-table td {
    display: grid;
    grid-template-columns: minmax(86px, 38%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    border-bottom: 1px solid var(--portal-soft-border);
    padding: 9px 0;
  }

  .portal-mobile .portal-responsive-table td:last-child {
    border-bottom: 0;
  }

  .portal-mobile .portal-responsive-table td::before {
    content: attr(data-label);
    color: var(--portal-muted);
    font-size: 12px;
    font-weight: 950;
    line-height: 1.35;
  }

  .portal-mobile .portal-responsive-table td:empty {
    display: none;
  }
}

@media (max-width: 430px) {
  .legacy-migration-grid {
    grid-template-columns: 1fr;
  }

  .legacy-migration-card-head {
    flex-direction: column;
  }

  .portal-mobile .portal-topbar {
    padding-right: 10px;
    padding-left: 10px;
  }

  .portal-mobile .portal-role-pill {
    display: none;
  }

  .portal-mobile .portal-mobile-helper {
    display: grid;
  }

  .portal-mobile .portal-mobile-helper button {
    justify-self: start;
  }

  .portal-mobile .portal-panel,
  .portal-mobile .portal-page-head-card,
  .portal-mobile .brand-market-hero,
  .portal-mobile .brand-market-benefits,
  .portal-mobile .media-command-center,
  .portal-mobile .media-identity-card {
    padding: 14px;
  }
}

@media (max-width: 900px) {
  .portal-desktop-forced {
    min-width: 1100px;
    overflow-x: auto;
  }

  .portal-desktop-forced .portal-topbar {
    min-width: 1100px;
  }

  .portal-desktop-forced .portal-menu-button,
  .portal-desktop-forced .portal-mobile-page-title,
  .portal-desktop-forced .portal-mobile-nav,
  .portal-desktop-forced .portal-mobile-helper,
  .portal-desktop-forced .portal-desktop-recommendation,
  .portal-desktop-forced .portal-mobile-toggle-drawer,
  .portal-desktop-forced .portal-scrim {
    display: none !important;
  }

  .portal-desktop-forced .portal-topbar-actions > [data-portal-view-toggle] {
    position: fixed;
    left: 14px;
    right: auto;
    bottom: calc(14px + env(safe-area-inset-bottom));
    z-index: 90;
    display: inline-flex !important;
    box-shadow: 0 16px 34px rgba(8, 9, 11, 0.24);
  }

  .portal-desktop-forced .portal-shell {
    display: grid;
    grid-template-columns: 312px minmax(760px, 1fr);
    min-height: calc(100vh - 72px);
  }

  .portal-desktop-forced .portal-sidebar {
    position: sticky;
    top: 72px;
    left: auto;
    z-index: 1;
    width: auto;
    height: calc(100vh - 72px);
    box-shadow: none;
  }

  .portal-desktop-forced .portal-main {
    padding: 18px 24px 30px;
  }
}

/* Controlled three-level portal IA */
.portal-shell {
  grid-template-columns: 444px minmax(0, 1fr);
}

.portal-sidebar {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
}

.portal-nav-system {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  padding-bottom: 24px;
}

.portal-primary-rail,
.portal-secondary-panel {
  min-width: 0;
  min-height: 0;
}

.portal-primary-rail {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  padding-right: 4px;
}

.portal-rail-module {
  -webkit-appearance: none;
  appearance: none;
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--portal-ink);
  cursor: pointer;
  font: inherit;
  padding: 8px 8px 8px 6px;
  text-align: left;
}

.portal-rail-module:hover,
.portal-rail-module:focus-visible,
.portal-rail-module.is-active {
  border-color: #bfdbfe;
  background: #eef4ff;
  outline: none;
}

.portal-rail-module .portal-menu-group-copy small,
.portal-rail-module .portal-menu-group-count {
  display: none;
}

.portal-secondary-panel {
  overflow-y: auto;
  border-left: 1px solid var(--portal-soft-border);
  padding-left: 12px;
}

.portal-module-panel {
  display: none;
  gap: 12px;
}

.portal-module-panel.is-active {
  display: grid;
}

.portal-module-panel-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-bottom: 1px solid var(--portal-soft-border);
  padding: 2px 0 12px;
}

.portal-module-panel-head div {
  display: grid;
  gap: 3px;
}

.portal-module-panel-head strong {
  color: var(--portal-ink);
  font-size: 15px;
  font-weight: 950;
}

.portal-module-panel-head span {
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.portal-nav-back {
  display: none;
  border: 1px solid var(--portal-soft-border);
  border-radius: 6px;
  background: var(--portal-white);
  color: var(--portal-ink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  padding: 6px 8px;
}

.portal-nav-sections {
  display: grid;
  gap: 10px;
  padding: 0;
}

.portal-nav-section {
  display: grid;
  gap: 5px;
  border: 1px solid var(--portal-soft-border);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
}

.portal-nav-section.is-active {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.portal-nav-section-toggle {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--portal-ink);
  cursor: pointer;
  font: inherit;
  padding: 2px 0 5px;
  text-align: left;
}

.portal-nav-section-toggle span {
  font-size: 12px;
  font-weight: 950;
}

.portal-nav-section-toggle small {
  display: none;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--portal-muted);
  font-size: 11px;
  font-weight: 950;
  padding: 2px 7px;
}

.portal-nav-section-links {
  display: grid;
  gap: 4px;
}

.portal-nav-level3-link {
  min-height: 34px;
  padding: 7px 8px;
}

.portal-personal-area {
  display: grid;
  gap: 5px;
  margin-top: auto;
  border-top: 1px solid var(--portal-soft-border);
  padding-top: 10px;
}

.portal-personal-title {
  color: var(--portal-muted);
  font-size: 11px;
  font-weight: 950;
}

.portal-personal-link {
  display: flex;
  min-width: 0;
  border-radius: 6px;
  color: var(--portal-ink);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
  padding: 7px 8px;
  text-decoration: none;
}

.portal-personal-link:hover,
.portal-personal-link.is-active {
  background: #eaf2ff;
  color: #123f9b;
}

.portal-sms-box {
  display: grid;
  gap: 12px;
  border: 1px solid #dbe5f3;
  border-radius: 8px;
  background: #f8fbff;
  padding: 14px;
}

.portal-sms-box p {
  margin: 4px 0 0;
  color: var(--portal-muted);
  font-size: 13px;
}

.account-modal-layer[hidden],
.otp-modal-layer[hidden] {
  display: none !important;
}

body.account-modal-open,
body.auth-otp-modal-open {
  overflow: hidden;
}

.account-modal-layer,
.otp-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 22px;
  background: rgba(17, 24, 39, 0.56);
  backdrop-filter: blur(5px);
}

.account-modal,
.otp-modal {
  position: relative;
  display: grid;
  gap: 18px;
  width: min(100%, 560px);
  border: 1px solid rgba(226, 232, 240, 0.94);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.28);
  padding: 28px;
  transform-origin: 50% 44%;
  animation: accountModalPopIn 180ms ease-out;
}

.account-modal--narrow,
.otp-modal {
  width: min(100%, 520px);
}

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

.account-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: #4b5563;
  background: transparent;
  font-size: 24px;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
}

.account-modal-close:hover {
  background: #f2f5f9;
  color: var(--portal-ink);
}

.otp-modal-titlebar {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-right: 42px;
}

.otp-modal-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--portal-blue);
  font-weight: 950;
}

.otp-modal-title {
  margin: 0;
  color: var(--portal-ink);
  font-size: 23px;
  font-weight: 950;
  line-height: 1.25;
}

.otp-modal-titlebar p {
  margin: 8px 0 0;
  color: var(--portal-muted);
  font-size: 14px;
  line-height: 1.55;
}

.otp-passive-widget,
.otp-sms-widget {
  display: grid;
  gap: 16px;
}

.email-binding-modal {
  width: min(100%, 540px);
}

.email-binding-modal-icon {
  background: #111827;
}

.email-binding-setup-step {
  display: grid;
  gap: 14px;
}

.email-binding-setup-step[hidden],
.email-binding-target-field[hidden],
.email-binding-current[hidden] {
  display: none !important;
}

.email-binding-current {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(203, 213, 225, 0.75);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
}

.email-binding-current span,
.email-binding-target-field span {
  color: #667085;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
}

.email-binding-current strong {
  min-width: 0;
  color: #101828;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.email-binding-target-field {
  display: grid;
  gap: 7px;
}

.email-binding-target-field input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #d5dce8;
  border-radius: 8px;
  padding: 10px 12px;
  color: #101828;
  background: #ffffff;
  font-size: 15px;
  font-weight: 750;
}

.email-binding-target-field input:focus {
  border-color: var(--portal-blue);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.email-binding-help {
  margin: 0;
  color: #667085;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.55;
}

.email-binding-actions {
  justify-content: flex-end;
}

.otp-setup-step,
.otp-verification-step {
  display: grid;
  gap: 16px;
}

.otp-verification-step:not([hidden]) {
  animation: otpStepIn 160ms ease-out;
}

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

.otp-destination {
  margin: 0;
  color: #374151;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.55;
  text-align: center;
}

.otp-input-shell {
  display: grid;
  gap: 16px;
}

.otp-verification-step[hidden],
.otp-input-shell[hidden],
.otp-resend-row[hidden],
.otp-confirm-button[hidden],
.otp-modal [data-otp-status][hidden],
.otp-modal [data-sms-status][hidden] {
  display: none !important;
}

.otp-input-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.otp-digit-input {
  width: 100%;
  aspect-ratio: 1;
  min-height: 52px;
  border: 1px solid #d5dce8;
  border-radius: 8px;
  color: var(--portal-ink);
  background: #ffffff;
  font-size: 24px;
  font-weight: 900;
  text-align: center;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.otp-digit-input:focus {
  border-color: var(--portal-blue);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  transform: translateY(-1px);
}

.otp-resend-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #4b5563;
  font-size: 14px;
}

.otp-resend-copy {
  color: var(--portal-muted);
  font-weight: 750;
  white-space: nowrap;
}

.otp-resend-button,
.otp-confirm-button,
.otp-setup-send-button {
  min-height: 40px;
  border-radius: 8px;
  font-weight: 850;
}

.otp-resend-button:disabled,
.otp-confirm-button:disabled,
.otp-setup-send-button:disabled {
  color: #98a2b3;
  background: #f4f6f9;
  cursor: not-allowed;
}

.otp-resend-button {
  width: auto;
  min-width: 0;
  min-height: 34px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--portal-blue);
  padding: 0 4px;
  justify-self: start;
}

.otp-resend-button:hover,
.otp-resend-button:focus-visible {
  background: transparent;
  color: var(--portal-color-primary-strong);
  text-decoration: underline;
}

.otp-resend-button:disabled {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #64748b;
  opacity: 1;
  text-decoration: none;
}

.account-modal-actions,
.otp-verification-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.account-modal-actions > *,
.otp-verification-actions > * {
  width: 100%;
}

.account-modal-footnote {
  margin: 14px 0 0;
  color: var(--portal-muted);
  font-size: 13px;
  text-align: center;
}

.account-modal-footnote a {
  color: var(--portal-blue);
  font-weight: 850;
  text-decoration: none;
}

.otp-phone-label {
  display: grid;
  gap: 8px;
  color: var(--portal-ink);
  font-size: 13px;
  font-weight: 850;
}

.otp-phone-control {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #dbe5f3;
  border-radius: 8px;
  background: #ffffff;
}

.otp-phone-control .auth-phone-prefix {
  display: grid;
  place-items: center;
  border-right: 1px solid #dbe5f3;
  color: #475467;
  background: #f6f8fb;
  font-weight: 850;
}

.otp-phone-control input {
  min-width: 0;
  border: 0;
  padding: 0 13px;
}

.portal-form-label {
  color: var(--portal-ink);
  font-size: 13px;
  font-weight: 850;
}

.portal-sms-controls {
  display: grid;
  grid-template-columns: minmax(120px, auto) minmax(120px, 1fr) minmax(100px, auto);
  gap: 10px;
  align-items: center;
}

.portal-sms-controls--stepwise {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.portal-sms-controls--modal {
  gap: 12px;
}

.portal-sms-send-primary {
  justify-self: start;
  min-width: min(100%, 180px);
}

.portal-sms-send-primary:disabled,
.portal-sms-send-primary[aria-disabled="true"] {
  background: #d7e4ff;
  color: #5d6f92;
  box-shadow: none;
  cursor: wait;
}

.portal-sms-code-panel {
  display: grid;
  gap: 12px;
  border: 1px solid #dbe5f3;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.portal-sms-code-panel[hidden] {
  display: none !important;
}

.portal-sms-controls--stepwise [hidden] {
  display: none !important;
}

[data-register-sms-widget] [data-register-sms-status][hidden] {
  display: none !important;
}

.portal-sms-code-field {
  display: grid;
  gap: 8px;
  margin: 0;
}

.portal-sms-code-field span {
  color: var(--portal-ink);
  font-size: 13px;
  font-weight: 850;
}

.portal-sms-code-field input {
  width: 100%;
  min-width: 0;
  letter-spacing: 0.18em;
  text-align: center;
}

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

.portal-sms-verify-primary,
.portal-sms-resend-secondary {
  min-width: 128px;
}

.portal-sms-resend-secondary {
  color: var(--portal-blue);
  background: #eef4ff;
}

.portal-sms-controls input {
  min-width: 0;
}

.portal-sms-sent-panel,
.portal-sms-verified-panel {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-radius: 8px;
  padding: 10px;
}

.portal-sms-sent-panel {
  border: 1px solid #b8c9e5;
  background: #ffffff;
  color: #334155;
}

.portal-sms-verified-panel {
  border: 1px solid #9bd6ad;
  background: #eefaf2;
  color: #176339;
}

.portal-sms-sent-panel[hidden],
.portal-sms-verified-panel[hidden] {
  display: none !important;
}

.portal-sms-sent-badge,
.portal-sms-verified-badge {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #16a34a;
  color: #ffffff;
  font-size: 16px;
  font-weight: 950;
}

.portal-sms-sent-badge {
  background: #eaf2ff;
  color: var(--portal-blue);
}

.portal-sms-verified-panel strong,
.portal-sms-sent-panel strong,
.portal-sms-sent-panel span:not(.portal-sms-sent-badge),
.portal-sms-verified-panel span:not(.portal-sms-verified-badge) {
  display: block;
  line-height: 1.4;
}

.portal-sms-sent-panel strong,
.portal-sms-verified-panel strong {
  font-size: 14px;
  font-weight: 950;
}

.portal-sms-sent-panel span:not(.portal-sms-sent-badge),
.portal-sms-verified-panel span:not(.portal-sms-verified-badge) {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 750;
}

.portal-sms-change-phone {
  min-width: 92px;
}

.portal-sms-continue {
  min-width: 92px;
}

.portal-form .portal-sms-sent-panel .portal-sms-continue,
.portal-form .portal-sms-verified-panel .portal-sms-change-phone {
  width: auto;
  min-width: 0;
  padding: 7px 12px;
  border: 1px solid #86c79d;
  background: #ffffff;
  color: #176339;
  box-shadow: none;
  font-size: 12px;
  line-height: 1.2;
}

.portal-form .portal-sms-sent-panel .portal-sms-continue {
  border-color: #b8c9e5;
  color: var(--portal-blue);
}

.portal-form .portal-sms-sent-panel .portal-sms-continue:hover {
  background: #f8fbff;
  border-color: #7aa2f5;
  color: var(--portal-color-primary-strong);
}

.portal-form .portal-sms-verified-panel .portal-sms-change-phone:hover {
  background: #f6fff8;
  border-color: #5fb87f;
  color: #0f5130;
}

.portal-state.success {
  border-color: #8ccaa4;
  background: #eefaf2;
  color: #176339;
}

.portal-state.error {
  border-color: #e7a8a8;
  background: #fff4f4;
  color: #8a1f1f;
}

@media (max-width: 560px) {
  .portal-user-card-actions {
    grid-template-columns: 1fr;
  }

  .portal-user-summary {
    grid-template-columns: 50px minmax(0, 1fr);
    padding: 10px;
  }

  .portal-user-avatar {
    width: 50px;
    height: 50px;
    font-size: 13px;
  }

  .portal-user-summary-subtitle {
    display: none;
  }

  .portal-user-summary-meta {
    font-size: 10px;
    gap: 4px;
  }

  .portal-user-status-badge {
    display: none;
  }

  .portal-phone-status {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-sms-controls {
    grid-template-columns: 1fr;
  }

  .portal-sms-send-primary,
  .portal-sms-verify-primary,
  .portal-sms-resend-secondary {
    width: 100%;
  }

  .portal-sms-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .portal-sms-verified-panel {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .portal-sms-sent-panel {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .portal-sms-continue {
    grid-column: 2;
    justify-self: start;
    width: auto;
  }

  .portal-sms-change-phone {
    grid-column: 2;
    justify-self: start;
    width: auto;
  }

  .account-modal-layer,
  .otp-modal-layer {
    align-items: start;
    padding: 18px 12px calc(18px + env(safe-area-inset-bottom));
  }

  .account-modal,
  .otp-modal {
    gap: 16px;
    padding: 24px 16px;
  }

  .otp-modal-titlebar {
    gap: 10px;
    padding-right: 34px;
  }

  .otp-modal-title {
    font-size: 21px;
  }

  .otp-modal-titlebar p,
  .otp-destination {
    font-size: 13px;
  }

  .otp-input-grid {
    gap: 7px;
  }

  .otp-digit-input {
    min-height: 42px;
    font-size: 20px;
  }

  .otp-resend-row,
  .account-modal-actions,
  .otp-verification-actions {
    grid-template-columns: 1fr;
  }

  .email-binding-actions .portal-secondary-button {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .portal-mobile .portal-nav-system {
    display: block;
    padding-bottom: 96px;
  }

  .portal-mobile .portal-primary-rail {
    display: grid;
    gap: 8px;
    overflow: visible;
    padding-right: 0;
  }

  .portal-mobile .portal-rail-module {
    min-height: 48px;
    grid-template-columns: 4px minmax(0, 1fr) auto;
  }

  .portal-mobile .portal-rail-module .portal-menu-group-copy small,
  .portal-mobile .portal-rail-module .portal-menu-group-count {
    display: none;
  }

  .portal-mobile .portal-secondary-panel {
    display: none;
    border-left: 0;
    padding-left: 0;
  }

  .portal-mobile .portal-mobile-nav-panel-open .portal-primary-rail {
    display: none;
  }

  .portal-mobile .portal-mobile-nav-panel-open .portal-secondary-panel {
    display: block;
  }

  .portal-mobile .portal-nav-back {
    display: inline-flex;
  }

  .portal-mobile .portal-module-panel-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--portal-white);
  }

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

  .portal-mobile .portal-nav-section.is-open .portal-nav-section-links {
    display: grid;
  }
}

@media (max-width: 900px) {
  .portal-desktop-forced .portal-shell {
    grid-template-columns: 444px minmax(760px, 1fr);
  }
}

/* Portal UI System v0.1: command-center semantics and P0 component baseline. */
:root {
  --portal-color-primary: #1d4ed8;
  --portal-color-primary-strong: #153eac;
  --portal-color-secondary: #475569;
  --portal-color-danger: #d31524;
  --portal-color-danger-strong: #b60f1b;
  --portal-color-warning: #b7791f;
  --portal-color-warning-bg: #fff8e8;
  --portal-color-success: #15803d;
  --portal-color-success-bg: #eefaf1;
  --portal-color-info: #0369a1;
  --portal-color-info-bg: #edf8ff;
  --portal-color-archive: #475569;
  --portal-color-archive-bg: #f1f5f9;
  --portal-radius-sm: 6px;
  --portal-radius-md: 8px;
  --portal-space-1: 4px;
  --portal-space-2: 8px;
  --portal-space-3: 12px;
  --portal-space-4: 16px;
  --portal-space-6: 24px;
  --portal-space-8: 32px;
  --portal-shadow-card: 0 12px 32px rgba(15, 23, 42, 0.06);
  --portal-shadow-action: 0 10px 22px rgba(29, 78, 216, 0.16);
}

.portal-page-head,
.portal-panel,
.portal-page-head-card,
.portal-dashboard-card,
.portal-state-card {
  border-radius: var(--portal-radius-md);
  box-shadow: var(--portal-shadow-card);
}

.portal-page-head {
  display: grid;
  gap: var(--portal-space-2);
  border: 1px solid var(--portal-soft-border);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.portal-page-head:not(.portal-page-hero) {
  position: relative;
  overflow: hidden;
  min-height: 118px;
  margin-bottom: 24px;
  padding: 28px 32px;
  border-left: 0;
  background:
    linear-gradient(90deg, rgba(37, 99, 235, 0.08) 0%, rgba(255, 255, 255, 0) 52%),
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.portal-page-head:not(.portal-page-hero)::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--portal-color-primary);
}

.portal-page-head:not(.portal-page-hero) p {
  margin: 0;
  color: var(--portal-color-danger);
  font-size: 12px;
  font-weight: 900;
}

.portal-page-head:not(.portal-page-hero) h1 {
  color: var(--portal-ink);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
}

.portal-page-head:not(.portal-page-hero) span {
  max-width: 760px;
  color: var(--portal-muted);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.55;
}

.portal-page-head p,
.portal-panel p,
.legacy-migration-hero p,
.legacy-migration-readiness p,
.legacy-migration-next p {
  color: var(--portal-color-danger);
}

.portal-page-head span,
.portal-panel span,
.portal-muted,
.portal-form-help {
  color: var(--portal-muted);
}

.portal-panel {
  border: 1px solid var(--portal-soft-border);
  background: #ffffff;
}

.portal-form-actions button,
.portal-form-grid button,
.portal-form button,
.portal-filter-form button,
.portal-link-button,
.portal-role-switch-button,
.portal-primary-action,
.portal-small-link,
.portal-safe-action-form button,
.portal-card-search-form button,
.portal-batch-role-form button[type="submit"] {
  border: 0;
  background: linear-gradient(180deg, var(--portal-color-primary) 0%, var(--portal-color-primary-strong) 100%);
  color: #ffffff;
  box-shadow: var(--portal-shadow-action);
}

.portal-form-actions button:hover,
.portal-form-grid button:hover,
.portal-form button:hover,
.portal-filter-form button:hover,
.portal-link-button:hover,
.portal-role-switch-button:hover,
.portal-primary-action:hover,
.portal-small-link:hover {
  background: linear-gradient(180deg, #2563eb 0%, var(--portal-color-primary-strong) 100%);
  color: #ffffff;
}

.portal-secondary-button,
.portal-secondary-link,
.portal-secondary-action,
.portal-form button.portal-action-secondary,
.portal-form-grid button.portal-action-secondary,
.portal-form-actions button.portal-action-secondary {
  border: 1px solid var(--portal-soft-border);
  background: #ffffff;
  color: var(--portal-ink);
  box-shadow: none;
}

.portal-form button.portal-action-warning,
.portal-form-grid button.portal-action-warning,
.portal-form-actions button.portal-action-warning,
.portal-metric-card.warning,
.portal-state.warning {
  border-color: #f4d493;
  background: var(--portal-color-warning-bg);
  color: #7b4d00;
}

.portal-form button.portal-action-danger,
.portal-form-grid button.portal-action-danger,
.portal-form-actions button.portal-action-danger,
button.danger,
.portal-warning-form button,
.portal-role-actions button.danger {
  background: linear-gradient(180deg, var(--portal-color-danger) 0%, var(--portal-color-danger-strong) 100%);
  color: #ffffff;
}

.portal-form button.portal-action-danger:disabled,
.portal-form-grid button.portal-action-danger:disabled,
.portal-form-actions button.portal-action-danger:disabled {
  background: #e5e7eb;
  border-color: #d1d5db;
  box-shadow: none;
  color: #94a3b8;
  cursor: not-allowed;
}

.portal-metric-card.danger {
  border-color: #ffc9cf;
  background: #fff7f8;
}

/* Portal global button rhythm: filter bars, row actions, drawers, and detail actions. */
.portal-action-primary,
.portal-action-secondary,
.portal-secondary-button,
.portal-secondary-link.portal-row-action,
.portal-secondary-action,
.portal-button.secondary,
.portal-filter-bar > button,
.portal-filter-bar > a,
.portal-filter-bar .portal-actions > button,
.portal-filter-bar .portal-actions > a,
.portal-table-actions button,
.portal-table-actions a,
.portal-action-zone > button,
.portal-action-zone > a,
.portal-sticky-action-bar > button,
.portal-sticky-action-bar > a,
.portal-panel-heading > a.portal-secondary-action {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border-radius: 6px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.portal-action-primary,
.portal-filter-bar > button,
.portal-filter-bar .portal-actions > button,
.portal-sticky-action-bar > button[type="submit"] {
  border: 0;
  background: linear-gradient(180deg, var(--portal-color-primary) 0%, var(--portal-color-primary-strong) 100%);
  color: #ffffff;
  box-shadow: var(--portal-shadow-action);
}

.portal-action-primary:hover,
.portal-action-primary:focus-visible,
.portal-filter-bar > button:hover,
.portal-filter-bar > button:focus-visible,
.portal-filter-bar .portal-actions > button:hover,
.portal-filter-bar .portal-actions > button:focus-visible {
  background: linear-gradient(180deg, #2563eb 0%, var(--portal-color-primary-strong) 100%);
  color: #ffffff;
}

.portal-action-secondary,
.portal-secondary-button,
.portal-secondary-link.portal-row-action,
.portal-secondary-action,
.portal-button.secondary,
.portal-filter-bar > a,
.portal-filter-bar .portal-actions > a,
.portal-table-actions a,
.portal-table-actions button:not(.portal-action-primary),
.portal-action-zone > a,
.portal-sticky-action-bar > a,
.portal-panel-heading > a.portal-secondary-action {
  border: 1px solid var(--portal-soft-border);
  background: #ffffff;
  color: var(--portal-ink);
  box-shadow: none;
}

.portal-action-secondary:hover,
.portal-action-secondary:focus-visible,
.portal-secondary-button:hover,
.portal-secondary-button:focus-visible,
.portal-secondary-link.portal-row-action:hover,
.portal-secondary-link.portal-row-action:focus-visible,
.portal-secondary-action:hover,
.portal-secondary-action:focus-visible,
.portal-button.secondary:hover,
.portal-button.secondary:focus-visible,
.portal-filter-bar > a:hover,
.portal-filter-bar > a:focus-visible,
.portal-table-actions a:hover,
.portal-table-actions a:focus-visible,
.portal-table-actions button:not(.portal-action-primary):hover,
.portal-table-actions button:not(.portal-action-primary):focus-visible {
  border-color: var(--portal-color-primary);
  background: #f8fbff;
  color: var(--portal-color-primary-strong);
}

.portal-form .portal-sms-controls--stepwise .portal-sms-resend-secondary {
  width: auto;
  min-width: 0;
  min-height: 34px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--portal-color-primary-strong);
  padding: 0 4px;
  font-size: 13px;
  justify-self: start;
}

.portal-form .portal-sms-controls--stepwise .portal-sms-resend-secondary:hover,
.portal-form .portal-sms-controls--stepwise .portal-sms-resend-secondary:focus-visible {
  background: transparent;
  color: var(--portal-color-primary-strong);
  text-decoration: underline;
}

.portal-form .portal-sms-controls--stepwise .portal-sms-resend-secondary:disabled {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #64748b;
  cursor: not-allowed;
  opacity: 1;
  text-decoration: none;
}

@media (max-width: 560px) {
  .portal-form .portal-sms-controls--stepwise .portal-sms-resend-secondary {
    width: auto;
    min-height: 34px;
    justify-self: start;
  }
}

.portal-filter-bar > button,
.portal-filter-bar > a,
.portal-filter-bar .portal-actions > button,
.portal-filter-bar .portal-actions > a {
  width: 100%;
  min-height: 42px;
  padding-inline: 16px;
}

.portal-filter-bar .portal-secondary-button.compact,
.portal-filter-bar .portal-secondary-action,
.portal-filter-bar .portal-secondary-link.portal-row-action {
  min-height: 42px;
  padding-inline: 16px;
  font-size: 13px;
}

.portal-table-actions form {
  display: inline-flex;
  margin: 0;
}

.portal-table-actions .portal-row-action,
.portal-table-actions .portal-secondary-button.compact,
.portal-table-actions .portal-secondary-link,
.portal-table-actions .portal-secondary-action,
.portal-table-actions button {
  min-height: 32px;
  padding-inline: 10px;
  font-size: 12px;
}

.portal-table-actions .portal-row-action {
  min-width: 0;
}

/* Account security keeps high-risk row forms collapsed so the table remains scannable. */
.portal-account-security-panel .portal-table-wrap {
  border-radius: 8px;
}

.portal-account-security-table {
  min-width: 1180px;
}

.portal-account-security-table th,
.portal-account-security-table td {
  vertical-align: middle;
}

.portal-account-security-table th:nth-child(1),
.portal-account-security-table td:nth-child(1) {
  width: 22%;
}

.portal-account-security-table th:nth-child(2),
.portal-account-security-table td:nth-child(2) {
  width: 18%;
}

.portal-account-security-table th:nth-child(9),
.portal-account-security-table td:nth-child(9) {
  width: 180px;
}

.portal-account-security-cell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
}

.portal-account-security-cell .portal-row-action {
  width: 100%;
}

.portal-account-security-actions {
  width: 100%;
  border: 1px solid var(--portal-soft-border);
  border-radius: 6px;
  background: #ffffff;
}

.portal-account-security-actions.portal-action-zone {
  border-top: 1px solid var(--portal-soft-border);
  padding-top: 0;
}

.portal-account-security-actions > summary {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  color: var(--portal-color-primary-strong);
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
  list-style: none;
}

.portal-account-security-actions > summary::-webkit-details-marker {
  display: none;
}

.portal-account-security-actions[open] {
  padding: 8px;
  border-color: #bfdbfe;
  background: #f8fbff;
}

.portal-account-security-actions[open] > summary {
  min-height: 28px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--portal-soft-border);
}

.portal-account-security-action-grid {
  display: grid;
  gap: 8px;
}

.portal-account-security-actions .portal-account-security-mini-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--portal-soft-border);
  border-radius: 6px;
  background: #ffffff;
}

.portal-account-security-actions .portal-account-security-mini-form input {
  min-height: 32px;
  padding: 6px 9px;
}

.portal-account-security-actions .portal-account-security-mini-form button {
  width: 100%;
  min-height: 32px;
  border-radius: 6px;
  border: 1px solid var(--portal-soft-border);
  background: #ffffff;
  color: var(--portal-color-primary-strong);
  box-shadow: none;
}

.portal-account-security-actions .portal-account-security-mini-form button:hover,
.portal-account-security-actions .portal-account-security-mini-form button:focus-visible {
  border-color: var(--portal-color-primary);
  background: #f8fbff;
  color: var(--portal-color-primary-strong);
}

.portal-metric-card.success,
.portal-state.success {
  border-color: #b7e4c1;
  background: var(--portal-color-success-bg);
  color: #116329;
}

.portal-status-pill,
.portal-status-badge,
.portal-badge {
  border-radius: 999px;
  letter-spacing: 0;
}

.portal-status-pill.danger,
.portal-status-badge.danger {
  border-color: #ffc9cf;
  background: #fff0f1;
  color: #9d101b;
}

.portal-status-pill.warning,
.portal-status-badge.warning {
  border-color: #f4d493;
  background: var(--portal-color-warning-bg);
  color: #7b4d00;
}

.portal-status-pill.success,
.portal-status-badge.success {
  border-color: #b7e4c1;
  background: var(--portal-color-success-bg);
  color: #116329;
}

.portal-status-pill.neutral,
.portal-status-badge.neutral,
.portal-badge.archive,
.portal-archive-badge {
  border-color: #d7dce3;
  background: var(--portal-color-archive-bg);
  color: var(--portal-color-archive);
}

.portal-table-wrap {
  border-radius: var(--portal-radius-md);
  background: #ffffff;
}

.portal-table th {
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.portal-table td {
  vertical-align: middle;
}

.portal-state.empty {
  border-style: dashed;
  background: #fbfdff;
  color: var(--portal-muted);
}

.portal-user-card {
  border: 1px solid #dbe3ee;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.portal-user-card-action {
  border-color: #dbe3ee;
  background: #ffffff;
}

.portal-user-card-action.is-active {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--portal-color-primary-strong);
}

.portal-nav-system .portal-rail-module,
.portal-nav-system .portal-nav-section {
  border-radius: var(--portal-radius-md);
}

.portal-nav-system .portal-rail-module.is-active,
.portal-nav-system .portal-nav-section.is-open,
.portal-nav-system .portal-menu-item.is-active {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.portal-archive-banner,
.portal-readonly-banner,
.portal-protected-boundary {
  border: 1px solid #d7dce3;
  border-left: 4px solid var(--portal-color-archive);
  border-radius: var(--portal-radius-md);
  padding: var(--portal-space-4);
  background: var(--portal-color-archive-bg);
  color: var(--portal-color-archive);
}

.portal-filter-form {
  gap: var(--portal-space-3);
}

.portal-filter-form + .portal-table-wrap,
.portal-inline-filter-form + .portal-table-wrap,
.portal-form + .portal-table-wrap {
  margin-top: 0;
}

.portal-alert {
  margin: 0 0 var(--portal-space-4);
}

@media (max-width: 900px) {
  .portal-mobile .portal-panel,
  .portal-mobile .portal-page-head,
  .portal-mobile .portal-page-head-card {
    padding: var(--portal-space-3);
  }

  .portal-mobile .portal-table-wrap {
    border-radius: var(--portal-radius-md);
  }

.portal-mobile .portal-form button,
  .portal-mobile .portal-filter-form button,
  .portal-mobile .portal-form-grid button,
  .portal-mobile .portal-form-stack button,
  .portal-mobile .portal-small-button,
  .portal-mobile .portal-secondary-button,
  .portal-mobile .media-action-button {
    min-height: 44px;
  }
}

/* Portal Shell Sidebar v2: compact rail + context panel */
.portal-shell.portal-shell-v2 {
  grid-template-columns: 376px minmax(0, 1fr);
}

.portal-shell-v2 .portal-sidebar-v2 {
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  background: #fbfcff;
}

.portal-shell-v2 .portal-identity-compact {
  gap: 8px;
  border-color: #dce4f0;
  padding: 10px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.035);
}

.portal-shell-v2 .portal-user-summary {
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 9px;
  border-color: #eef2f7;
  padding: 7px;
}

.portal-shell-v2 .portal-user-avatar {
  width: 38px;
  height: 38px;
  font-size: 12px;
}

.portal-shell-v2 .portal-user-summary-main {
  gap: 2px;
}

.portal-shell-v2 .portal-user-summary-main strong {
  margin: 0;
  font-size: 13px;
  line-height: 1.2;
}

.portal-shell-v2 .portal-user-summary-subtitle {
  display: none;
}

.portal-shell-v2 .portal-user-summary-meta {
  gap: 4px 7px;
  font-size: 10px;
  line-height: 1.35;
}

.portal-shell-v2 .portal-user-summary-meta span:first-child {
  display: none;
}

.portal-shell-v2 .portal-user-status-badge {
  padding: 1px 6px;
  font-size: 10px;
}

.portal-shell-v2 .portal-user-card-statusbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.portal-shell-v2 .portal-user-pill {
  min-width: 0;
  justify-content: center;
  overflow: hidden;
  padding: 3px 7px;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-shell-v2 .portal-personal-entry-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.portal-shell-v2 .portal-user-card-action {
  min-height: 40px;
  gap: 1px;
  border-radius: 8px;
  padding: 7px;
}

.portal-shell-v2 .portal-user-card-action strong {
  font-size: 11px;
}

.portal-shell-v2 .portal-user-card-action span {
  font-size: 10px;
}

.portal-shell-v2 .portal-role-form-compact {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  margin: 0;
  border: 1px solid #dde6f2;
  border-radius: 10px;
  padding: 8px;
  background: #ffffff;
}

.portal-shell-v2 .portal-role-form-compact label {
  min-width: 0;
}

.portal-shell-v2 .portal-role-form-compact label span {
  display: block;
  margin-bottom: 3px;
  color: var(--portal-muted);
  font-size: 10px;
  font-weight: 900;
}

.portal-shell-v2 .portal-role-form-compact select {
  width: 100%;
  min-height: 34px;
  border-radius: 8px;
  padding: 6px 28px 6px 8px;
  font-size: 12px;
  font-weight: 850;
}

.portal-shell-v2 .portal-role-form-compact .portal-role-switch-button {
  align-self: end;
  width: auto;
  min-height: 34px;
  border-radius: 8px;
  padding: 7px 10px;
  box-shadow: none;
  font-size: 12px;
}

.portal-shell-v2 .portal-role-form-compact .portal-role-form-help,
.portal-shell-v2 .portal-role-form-compact .portal-mobile-toggle-drawer {
  grid-column: 1 / -1;
  display: none;
}

.portal-shell-v2 .portal-role-form-compact .portal-role-pending-note {
  grid-column: 1 / -1;
  font-size: 11px;
}

.portal-shell-v2 .portal-nav-system-v2 {
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 12px;
}

.portal-shell-v2 .portal-primary-rail-v2 {
  gap: 4px;
  padding-right: 2px;
}

.portal-shell-v2 .portal-rail-module {
  min-height: 38px;
  grid-template-columns: 3px minmax(0, 1fr);
  gap: 7px;
  border-radius: 8px;
  padding: 6px 6px 6px 4px;
}

.portal-shell-v2 .portal-rail-module .portal-menu-group-mark {
  width: 3px;
  min-height: 24px;
  border-radius: 999px;
  background: #cbd5e1;
}

.portal-shell-v2 .portal-rail-module.is-active .portal-menu-group-mark {
  background: var(--portal-blue);
}

.portal-shell-v2 .portal-rail-module .portal-menu-group-copy strong {
  margin: 0;
  font-size: 12px;
  line-height: 1.25;
}

.portal-shell-v2 .portal-context-panel-v2 {
  padding-left: 10px;
}

.portal-shell-v2 .portal-module-panel-head {
  gap: 8px;
  padding-bottom: 9px;
}

.portal-shell-v2 .portal-module-panel-head strong {
  font-size: 14px;
}

.portal-shell-v2 .portal-module-panel-head span {
  font-size: 11px;
}

.portal-shell-v2 .portal-nav-sections {
  gap: 6px;
}

.portal-shell-v2 .portal-nav-section {
  gap: 3px;
  border-color: transparent;
  border-left: 3px solid #d5dfec;
  border-radius: 6px;
  background: transparent;
  padding: 5px 4px 5px 8px;
}

.portal-shell-v2 .portal-nav-section.is-active,
.portal-shell-v2 .portal-nav-section.is-open {
  border-color: transparent;
  border-left-color: #bfdbfe;
  background: #f8fbff;
}

.portal-shell-v2 .portal-nav-section-toggle {
  padding: 1px 0 4px;
}

.portal-shell-v2 .portal-nav-section-toggle span {
  font-size: 11px;
  letter-spacing: 0;
}

.portal-shell-v2 .portal-nav-section-links {
  gap: 2px;
}

.portal-shell-v2 .portal-nav-level3-link {
  min-height: 30px;
  border-radius: 7px;
  padding: 6px 7px;
  font-size: 12px;
}

.portal-shell-v2 .portal-menu-item-dot {
  width: 6px;
  height: 6px;
}

.portal-shell-v2 .portal-personal-area {
  display: none;
}

.portal-shell-v2 .portal-main {
  min-width: 0;
}

@media (min-width: 901px) and (max-width: 1180px) {
  .portal-shell.portal-shell-v2 {
    grid-template-columns: 340px minmax(0, 1fr);
  }

  .portal-shell-v2 .portal-nav-system-v2 {
    grid-template-columns: 102px minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .portal-mobile .portal-shell.portal-shell-v2 {
    display: block;
  }

  .portal-mobile .portal-sidebar-v2 {
    padding: 14px;
  }

  .portal-mobile .portal-role-form-compact {
    grid-template-columns: 1fr;
  }

  .portal-mobile .portal-role-form-compact .portal-role-switch-button {
    width: 100%;
  }

  .portal-mobile .portal-user-summary-meta span:first-child {
    display: inline-flex;
  }

  .portal-mobile .portal-nav-system-v2 {
    grid-template-columns: 1fr;
  }

  .portal-mobile .portal-context-panel-v2 {
    padding-left: 0;
  }
}

/* Portal UI Overhaul Stage 1: Volcengine-style console shell */
.portal-topbar-volcengine {
  height: 58px;
  padding: 0 16px;
  gap: 12px;
  z-index: 60;
  justify-content: flex-start;
  border-bottom: 1px solid #e6ebf2;
  background: #ffffff;
  box-shadow: none;
  overflow: visible;
}

.portal-topbar-left,
.portal-topbar-nav,
.portal-user-center-trigger,
.portal-sidebar-service,
.portal-sidebar-brand,
.portal-sidebar-collapse-button,
.portal-topbar-trigger {
  display: inline-flex;
  align-items: center;
}

.portal-topbar-left {
  flex: 0 0 auto;
  min-width: 0;
  gap: 12px;
}

.portal-topbar-volcengine .portal-brand img {
  width: 118px;
  height: auto;
}

.portal-topbar-home-pill {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  border-radius: 5px;
  padding: 0 12px;
  color: #2563eb;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.portal-topbar-home-pill span {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: #3b82f6;
  color: #ffffff;
  font-size: 12px;
  line-height: 1;
}

.portal-topbar-home-pill:hover,
.portal-topbar-home-pill:focus-visible,
.portal-topbar-home-pill.is-active {
  background: #eef4ff;
  color: #1d4ed8;
}

.portal-product-context {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding-left: 14px;
  border-left: 1px solid #e5eaf3;
  border-radius: 0;
  color: #111827;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.portal-product-context.portal-topbar-trigger {
  padding-right: 10px;
}

.portal-product-context.portal-topbar-trigger:hover,
.portal-product-context.portal-topbar-trigger:focus-visible,
.portal-project-dropdown.is-open > .portal-product-context {
  border-color: transparent transparent transparent #e5eaf3;
  background: #f8fafc;
}

.portal-product-context span {
  color: #334155;
  font-size: 14px;
}

.portal-product-context strong {
  color: #111827;
  font-size: 13px;
}

.portal-product-context em {
  color: #64748b;
  font-style: normal;
  font-size: 13px;
}

.portal-topbar-search {
  display: inline-flex;
  flex: 0 1 390px;
  min-width: 220px;
  max-width: 28vw;
  height: 36px;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  border: 1px solid #d8e0ea;
  border-radius: 5px;
  padding: 0 12px;
  background: #ffffff;
  color: #94a3b8;
  position: relative;
  z-index: 1;
}

.portal-topbar-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 13px;
  outline: 0;
}

.portal-topbar-search:focus-within {
  border-color: #8bb7ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.portal-nav-search-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 95;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
}

.portal-nav-search-panel[hidden] {
  display: none;
}

.portal-nav-search-empty {
  padding: 12px 14px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.portal-nav-search-results {
  display: grid;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
}

.portal-nav-search-results a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  border-radius: 5px;
  padding: 9px 10px;
  color: #111827;
  text-decoration: none;
}

.portal-nav-search-results a:hover,
.portal-nav-search-results a:focus-visible,
.portal-nav-search-results a.is-active {
  background: #eef5ff;
  color: #1d4ed8;
}

.portal-nav-search-results strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-nav-search-results span {
  grid-column: 1 / -1;
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-nav-search-results em {
  align-self: start;
  color: #94a3b8;
  font-size: 11px;
  font-style: normal;
}

.portal-topbar-nav {
  flex: 0 0 auto;
  min-width: 0;
  gap: 2px;
  position: relative;
  z-index: 3;
}

.portal-topbar-volcengine .portal-topbar-actions {
  flex: 0 0 auto;
  gap: 10px;
  position: relative;
  z-index: 4;
}

.portal-topbar-dropdown,
.portal-user-center {
  position: relative;
}

.portal-topbar-trigger,
.portal-user-center-trigger,
.portal-sidebar-collapse-button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #1f2937;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.portal-topbar-trigger {
  gap: 6px;
  padding: 0 10px;
}

.portal-topbar-trigger:hover,
.portal-topbar-trigger:focus-visible,
.portal-topbar-dropdown.is-open > .portal-topbar-trigger,
.portal-user-center-trigger:hover,
.portal-user-center-trigger:focus-visible,
.portal-user-center.is-open > .portal-user-center-trigger {
  border-color: #dbe7ff;
  background: #eef5ff;
  color: #1d4ed8;
}

.portal-notice-link.portal-topbar-trigger {
  width: 36px;
  min-width: 36px;
  justify-content: center;
  padding: 0;
  position: relative;
}

.portal-notice-bell {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  position: relative;
}

.portal-notice-bell::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid #64748b;
  border-bottom: 0;
  border-radius: 9px 9px 4px 4px;
}

.portal-notice-bell::after {
  content: "";
  position: absolute;
  left: 7px;
  bottom: 2px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: #64748b;
  box-shadow: 3px 3px 0 -1px #64748b;
}

.portal-notice-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  display: inline-flex;
  min-width: 18px;
  min-height: 18px;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  border-radius: 999px;
  padding: 0 4px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  line-height: 1;
}

.portal-notice-badge:empty {
  display: none;
}

.portal-topbar-menu,
.portal-user-center-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 90;
  width: min(360px, calc(100vw - 32px));
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
}

.portal-topbar-nav .portal-topbar-menu {
  left: 0;
  right: auto;
  width: 300px;
}

.portal-topbar-menu[hidden],
.portal-user-center-popover[hidden] {
  display: none;
}

.portal-topbar-menu-item {
  display: grid;
  gap: 2px;
  border-radius: 5px;
  padding: 10px 10px;
  color: #111827;
  text-decoration: none;
}

.portal-topbar-menu-item strong {
  font-size: 13px;
  line-height: 1.25;
}

.portal-topbar-menu-item span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.portal-topbar-menu-item:hover,
.portal-topbar-menu-item:focus-visible,
.portal-topbar-menu-item.is-active {
  background: #eef5ff;
  color: #1d4ed8;
}

.portal-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid #edf1f7;
}

.portal-popover-head strong {
  font-size: 14px;
}

.portal-popover-head span,
.portal-popover-empty {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.portal-popover-empty {
  padding: 10px;
}

.portal-notification-popover {
  width: min(380px, calc(100vw - 32px));
  padding: 0;
  overflow: hidden;
}

.portal-notification-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid #edf1f7;
  background: #f8fafc;
}

.portal-notification-stats span {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border-right: 1px solid #edf1f7;
}

.portal-notification-stats span:last-child {
  border-right: 0;
}

.portal-notification-stats strong {
  color: #111827;
  font-size: 17px;
}

.portal-notification-stats em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
}

.portal-notification-list {
  display: grid;
  padding: 10px 14px;
}

.portal-notification-list a {
  display: grid;
  gap: 4px;
  border-radius: 5px;
  padding: 10px 0;
  color: #111827;
  text-decoration: none;
}

.portal-notification-list span {
  color: #64748b;
  font-size: 12px;
}

.portal-popover-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-top: 1px solid #edf1f7;
  background: #fbfdff;
}

.portal-popover-footer a {
  color: #2563eb;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.portal-project-role-popover {
  left: 0;
  right: auto;
  width: min(360px, calc(100vw - 32px));
  padding: 0;
  overflow: hidden;
}

.portal-project-role-current {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-bottom: 1px solid #edf1f7;
  background: #fbfdff;
}

.portal-project-role-current span {
  color: #64748b;
  font-size: 12px;
}

.portal-project-role-current strong {
  color: #111827;
  font-size: 14px;
}

.portal-project-role-form {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px 16px 16px;
}

.portal-project-role-form label {
  display: grid;
  gap: 6px;
}

.portal-project-role-form label span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.portal-project-role-form select {
  width: 100%;
}

.portal-project-role-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px;
  border: 1px solid #d8e0eb;
  border-radius: 5px;
  padding: 0 12px;
  background: #ffffff;
}

.portal-project-role-search span {
  color: #64748b;
  font-size: 20px;
}

.portal-project-role-search input {
  width: 100%;
  height: 44px;
  border: 0;
  background: transparent;
  color: #111827;
  font: inherit;
  outline: 0;
}

.portal-project-role-list {
  display: grid;
  gap: 4px;
  padding: 10px 12px 14px;
}

.portal-project-role-list-title {
  padding: 8px 8px 6px;
  color: #111827;
  font-size: 15px;
}

.portal-project-role-form.portal-role-direct-form {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.portal-project-role-option,
.portal-user-center-role-option {
  display: grid;
  width: 100%;
  gap: 4px;
  border: 0;
  border-radius: 5px;
  padding: 11px 14px;
  background: transparent;
  color: #111827;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.portal-project-role-option span,
.portal-user-center-role-option span {
  font-size: 15px;
  font-weight: 800;
}

.portal-project-role-option em,
.portal-user-center-role-option em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.portal-project-role-option:hover,
.portal-project-role-option:focus-visible,
.portal-project-role-option.is-active,
.portal-user-center-role-option:hover,
.portal-user-center-role-option:focus-visible,
.portal-user-center-role-option.is-active {
  background: #f1f5fb;
  color: #2563eb;
}

.portal-project-role-option.is-active span,
.portal-user-center-role-option.is-active span {
  color: #2563eb;
}

.portal-role-direct-form[hidden] {
  display: none;
}

.portal-user-center-trigger {
  gap: 8px;
  padding: 2px 6px 2px 2px;
  max-width: 250px;
  overflow: hidden;
}

.portal-user-avatar--topbar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  overflow: hidden;
  font-size: 11px;
  line-height: 1;
}

.portal-user-center-trigger-copy {
  display: grid;
  gap: 0;
  text-align: left;
  line-height: 1.15;
}

.portal-user-center-trigger-copy strong {
  max-width: 108px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.portal-user-center-trigger-copy small {
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
}

.portal-user-center-head {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin: -10px -10px 0;
  padding: 20px 22px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(90deg, #f3f7ff 0%, #eef5ff 100%);
}

.portal-user-center-title > strong,
.portal-user-center-title > span,
.portal-user-center-head em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-user-center-head .portal-user-avatar {
  display: inline-flex;
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 999px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.portal-user-center-title > strong {
  color: #0f172a;
  font-size: 18px;
}

.portal-user-center-title > span {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
}

.portal-user-center-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.portal-user-center-head em {
  width: fit-content;
  border: 1px solid #c7d7ff;
  border-radius: 999px;
  padding: 2px 8px;
  background: #ffffff;
  color: #1d4ed8;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.portal-user-center-manage {
  align-self: start;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.portal-user-center-meta,
.portal-user-center-links {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.portal-user-center-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-user-center-meta span {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e4ebf5;
  border-radius: 999px;
  padding: 5px 8px;
  background: #ffffff;
  color: #475569;
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-user-center-links {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.portal-user-center-links a {
  display: grid;
  gap: 2px;
  border: 0;
  border-radius: 5px;
  padding: 8px 6px;
  color: #111827;
  text-decoration: none;
}

.portal-user-center-links a:hover,
.portal-user-center-links a:focus-visible {
  border-color: #bfd4ff;
  background: #f0f6ff;
  color: #1d4ed8;
}

.portal-user-center-links strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.portal-user-center-links span {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.portal-user-center-role-form {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  border: 0;
  border-top: 1px solid #edf1f7;
  border-radius: 0;
  padding: 14px 0 0;
  background: #ffffff;
}

.portal-user-center-role-form > strong {
  color: #111827;
  font-size: 15px;
}

.portal-user-center-role-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.portal-user-center-role-list form {
  margin: 0;
}

.portal-user-center-role-option {
  min-height: 56px;
  border: 1px solid #edf1f7;
  padding: 8px 10px;
}

.portal-user-center-role-form .portal-role-switch-button {
  align-self: end;
  width: auto;
  min-height: 36px;
  border-radius: 7px;
  box-shadow: none;
}

.portal-user-center-role-form .portal-role-pending-note {
  grid-column: 1 / -1;
}

.portal-user-center-role-form .portal-role-helper {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  color: #64748b;
  font-size: 11px;
  line-height: 1.5;
}

.portal-user-center form[data-portal-logout] {
  margin: 14px 0 0;
}

.portal-user-center-logout {
  width: 100%;
  border-color: #e2e8f0 !important;
  background: #f8fafc !important;
  color: #1f2937 !important;
  box-shadow: none !important;
}

.portal-user-center-popover {
  width: min(500px, calc(100vw - 32px));
  padding: 10px;
}

.portal-user-center-section {
  margin-top: 14px;
  border-top: 1px solid #edf1f7;
  padding-top: 14px;
}

.portal-user-center-section h2 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 15px;
}

.portal-user-center-todos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
  border-radius: 5px;
  background: #f5f7fb;
}

.portal-user-center-todos span {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-right: 1px solid #e4eaf2;
}

.portal-user-center-todos span:last-child {
  border-right: 0;
}

.portal-user-center-todos em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
}

.portal-user-center-todos strong {
  color: #111827;
  font-size: 16px;
}

.portal-message-center {
  display: block;
  min-height: calc(100vh - 58px);
  margin: 0;
}

.portal-message-center-main {
  min-width: 0;
}

.portal-message-titlebar.portal-page-hero {
  margin: 0 0 22px;
}

.portal-message-center-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: -4px 0 20px;
  padding: 4px 0 0;
}

.portal-message-center-tabs a,
.portal-message-center-tabs span {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border: 1px solid #d8e0eb;
  border-radius: 5px;
  padding: 0 18px;
  background: #ffffff;
  color: #111827;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.portal-message-center-tabs a.is-active {
  border-color: #9bbcff;
  background: #eaf1ff;
  color: #2563eb;
}

.portal-message-center-tabs span {
  color: #64748b;
  cursor: default;
}

.portal-message-filters {
  display: grid;
  gap: 18px;
  margin-bottom: 20px;
}

.portal-message-category-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.portal-message-category-tabs > span {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.portal-message-category-tabs button,
.portal-message-batch-actions button {
  min-height: 38px;
  border: 1px solid #d8e0eb;
  border-radius: 5px;
  padding: 0 22px;
  background: #f8fafc;
  color: #111827;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.portal-message-category-tabs button.is-active,
.portal-message-category-tabs button:hover,
.portal-message-category-tabs button:focus-visible {
  border-color: #9bbcff;
  background: #eef5ff;
  color: #2563eb;
}

.portal-message-filter-row {
  display: grid;
  grid-template-columns: minmax(160px, 240px) minmax(160px, 240px) minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.portal-message-filter-row label {
  display: grid;
  gap: 6px;
}

.portal-message-filter-row label span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.portal-message-filter-row select,
.portal-message-filter-row input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d8e0eb;
  border-radius: 5px;
  padding: 0 12px;
  background: #ffffff;
  color: #111827;
  font: inherit;
}

.portal-message-table-card {
  border: 1px solid #edf1f7;
  border-radius: 5px;
  background: #ffffff;
  overflow: hidden;
}

.portal-message-table {
  min-width: 920px;
}

.portal-message-table th,
.portal-message-table td {
  vertical-align: middle;
}

.portal-message-table th:first-child,
.portal-message-table td:first-child {
  width: 48px;
  text-align: center;
}

.portal-message-table td:nth-child(2) {
  min-width: 320px;
}

.portal-message-table td:nth-child(2) strong,
.portal-message-table td:nth-child(2) span,
.portal-message-table td:nth-child(2) a {
  display: block;
}

.portal-message-table td:nth-child(2) span {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.portal-message-table tr.is-read {
  color: #94a3b8;
}

.portal-message-category {
  display: block;
  color: #111827;
  font-weight: 850;
}

.portal-message-table small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.portal-message-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-weight: 850;
}

.portal-message-status i {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #94a3b8;
}

.portal-message-status.is-unread {
  color: #2563eb;
}

.portal-message-status.is-unread i {
  background: #2563eb;
}

.portal-message-batch-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px;
  border-top: 1px solid #edf1f7;
  background: #fbfdff;
}

.portal-message-batch-actions button {
  background: #2563eb;
  color: #ffffff;
}

.portal-message-batch-actions button:disabled {
  border-color: #d8e0eb;
  background: #eef2f7;
  color: #94a3b8;
  cursor: not-allowed;
}

.portal-message-batch-actions span {
  margin-left: auto;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.portal-shell.portal-shell-v2.portal-shell-volcengine {
  min-height: calc(100vh - 58px);
  grid-template-columns: 264px minmax(0, 1fr);
}

.portal-shell-volcengine .portal-sidebar-volcengine {
  top: 58px;
  height: calc(100vh - 58px);
  padding: 0;
  background: #f5f7fb;
  overflow: hidden;
}

.portal-sidebar-service {
  min-height: 62px;
  justify-content: space-between;
  gap: 8px;
  padding: 0 16px;
  border-bottom: 1px solid #e3eaf4;
  background: #f5f7fb;
}

.portal-sidebar-brand {
  min-width: 0;
  gap: 10px;
  color: #111827;
  font-size: 18px;
  font-weight: 900;
  text-decoration: none;
}

.portal-sidebar-brand span {
  color: #111827;
}

.portal-sidebar-service-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: linear-gradient(135deg, #64748b, #334155);
  color: #ffffff !important;
  font-size: 13px;
}

.portal-sidebar-service-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-sidebar-collapse-button {
  position: relative;
  width: 42px;
  min-height: 42px;
  justify-content: center;
  flex: 0 0 auto;
  border-color: transparent;
  background: transparent;
  color: #050505;
  border-radius: 6px;
  padding: 0;
  transition: background 0.16s ease, color 0.16s ease;
}

.portal-sidebar-collapse-button::before {
  content: attr(data-sidebar-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  z-index: 80;
  min-width: 72px;
  padding: 10px 12px;
  border: 1px solid #dce4ef;
  border-radius: 6px;
  background: #ffffff;
  color: #1f2937;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  white-space: nowrap;
}

.portal-sidebar-collapse-button::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  z-index: 81;
  width: 10px;
  height: 10px;
  border-right: 1px solid #dce4ef;
  border-bottom: 1px solid #dce4ef;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) rotate(45deg) translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.portal-sidebar-collapse-button:hover,
.portal-sidebar-collapse-button:focus-visible {
  background: #e9edf4;
  color: #000000;
}

.portal-sidebar-collapse-button:hover::before,
.portal-sidebar-collapse-button:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.portal-sidebar-collapse-button:hover::after,
.portal-sidebar-collapse-button:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) rotate(45deg) translateY(0);
}

.portal-sidebar-collapse-icon {
  display: block;
  width: 30px;
  height: 22px;
  object-fit: contain;
  pointer-events: none;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.portal-sidebar-context {
  display: none;
  gap: 2px;
  padding: 12px 14px;
  border-bottom: 1px solid #e8eef6;
  background: #f8fafc;
}

.portal-sidebar-context span {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
}

.portal-sidebar-context strong {
  color: #111827;
  font-size: 15px;
  line-height: 1.3;
}

.portal-shell-volcengine .portal-nav-system-v2 {
  height: calc(100vh - 58px - 62px - 76px);
  grid-template-columns: 1fr;
  gap: 0;
  overflow: hidden;
}

.portal-sidebar-footer {
  display: flex;
  height: 76px;
  align-items: flex-start;
  border-top: 1px solid #e3eaf4;
  padding: 10px 18px 18px;
  background: #f8fafc;
}

.portal-sidebar-collapse-button--bottom {
  width: 42px;
  min-height: 42px;
  margin-right: auto;
}

.portal-shell-volcengine .portal-primary-rail-v2 {
  display: block;
  overflow-y: auto;
  height: 100%;
  padding: 10px 10px 18px;
  border-bottom: 0;
}

.portal-shell-volcengine .portal-rail-module {
  min-height: 42px;
  width: 100%;
  grid-template-columns: 3px 28px minmax(0, 1fr);
  margin: 2px 0;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 7px 10px 7px 5px;
  background: transparent;
}

.portal-shell-volcengine .portal-menu-group-icon {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 900;
  color: transparent;
  position: relative;
  overflow: hidden;
}

.portal-shell-volcengine .portal-menu-group-icon::before,
.portal-shell-volcengine .portal-menu-group-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.portal-shell-volcengine .portal-menu-group-icon::before {
  inset: 6px;
  border: 2px solid #64748b;
  border-radius: 3px;
}

.portal-shell-volcengine .portal-menu-group-icon::after {
  width: 8px;
  height: 2px;
  left: 9px;
  top: 12px;
  border-radius: 999px;
  background: #64748b;
}

.portal-shell-volcengine [data-portal-module-icon="workbench"]::before {
  inset: 5px 6px 7px;
  border-radius: 3px;
}

.portal-shell-volcengine [data-portal-module-icon="workbench"]::after {
  width: 10px;
  height: 2px;
  left: 8px;
  top: 11px;
  box-shadow: 0 4px 0 #64748b;
}

.portal-shell-volcengine [data-portal-module-icon="course-ops"]::before {
  inset: 7px 5px 6px;
  border-radius: 2px;
  transform: skewY(-8deg);
}

.portal-shell-volcengine [data-portal-module-icon="course-ops"]::after {
  width: 12px;
  left: 7px;
  top: 9px;
}

.portal-shell-volcengine [data-portal-module-icon="student-enrolment"]::before {
  inset: 5px 7px;
  border-radius: 999px 999px 4px 4px;
}

.portal-shell-volcengine [data-portal-module-icon="student-enrolment"]::after {
  width: 14px;
  height: 7px;
  left: 6px;
  top: 14px;
  border: 2px solid #64748b;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: transparent;
}

.portal-shell-volcengine [data-portal-module-icon="certification-review"]::before {
  inset: 4px 7px;
  border-radius: 999px;
}

.portal-shell-volcengine [data-portal-module-icon="certification-review"]::after {
  width: 8px;
  height: 5px;
  left: 9px;
  top: 11px;
  border-left: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(-45deg);
  background: transparent;
}

.portal-shell-volcengine [data-portal-module-icon="card-cert"]::before {
  inset: 7px 4px;
  border-radius: 3px;
}

.portal-shell-volcengine [data-portal-module-icon="card-cert"]::after {
  width: 10px;
  left: 8px;
  top: 13px;
  box-shadow: 0 4px 0 #64748b;
}

.portal-shell-volcengine [data-portal-module-icon="leads-growth"]::before {
  inset: 5px 8px 5px 6px;
  border-radius: 999px 999px 999px 2px;
  transform: rotate(-18deg);
}

.portal-shell-volcengine [data-portal-module-icon="leads-growth"]::after {
  width: 10px;
  height: 2px;
  left: 10px;
  top: 16px;
  transform: rotate(-30deg);
}

.portal-shell-volcengine [data-portal-module-icon="brand-coop"]::before {
  inset: 5px 5px 10px;
  border-radius: 4px 4px 2px 2px;
}

.portal-shell-volcengine [data-portal-module-icon="brand-coop"]::after {
  width: 14px;
  height: 7px;
  left: 6px;
  top: 13px;
  border: 2px solid #64748b;
  border-radius: 0 0 4px 4px;
  background: transparent;
}

.portal-shell-volcengine [data-portal-module-icon="media-coop"]::before {
  inset: 6px 5px;
  border-radius: 3px;
  transform: rotate(-8deg);
}

.portal-shell-volcengine [data-portal-module-icon="media-coop"]::after {
  width: 0;
  height: 0;
  left: 10px;
  top: 9px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid #64748b;
  background: transparent;
}

.portal-shell-volcengine [data-portal-module-icon="coach-base"]::before {
  inset: 5px 6px;
  border-radius: 3px;
  transform: rotate(45deg);
}

.portal-shell-volcengine [data-portal-module-icon="coach-base"]::after {
  width: 12px;
  left: 7px;
  top: 17px;
}

.portal-shell-volcengine [data-portal-module-icon="resources-content"]::before {
  inset: 5px 6px 7px;
  border-radius: 3px;
}

.portal-shell-volcengine [data-portal-module-icon="resources-content"]::after {
  width: 11px;
  height: 2px;
  left: 8px;
  top: 9px;
  box-shadow: 0 4px 0 #64748b, 0 8px 0 #64748b;
}

.portal-shell-volcengine [data-portal-module-icon="account-org"]::before {
  inset: 5px 5px 5px 8px;
  border-radius: 999px;
}

.portal-shell-volcengine [data-portal-module-icon="account-org"]::after {
  width: 7px;
  height: 7px;
  right: 4px;
  bottom: 5px;
  border: 2px solid #64748b;
  border-radius: 999px;
  background: transparent;
}

.portal-shell-volcengine [data-portal-module-icon="audit-system"]::before {
  inset: 4px;
  border-radius: 999px;
}

.portal-shell-volcengine [data-portal-module-icon="audit-system"]::after {
  width: 3px;
  height: 9px;
  left: 11px;
  top: 7px;
  border-radius: 999px;
  box-shadow: 0 8px 0 #64748b;
}

.portal-shell-volcengine .portal-rail-module:hover,
.portal-shell-volcengine .portal-rail-module:focus-visible,
.portal-shell-volcengine .portal-rail-module.is-active {
  border-color: #d8e7ff;
  background: #e9f1ff;
  color: #1d4ed8;
}

.portal-shell-volcengine .portal-rail-module .portal-menu-group-copy strong {
  font-size: 13px;
  font-weight: 850;
}

.portal-shell-volcengine .portal-rail-module.is-active .portal-menu-group-icon {
  background: #dbeafe;
  color: #1d4ed8;
}

.portal-shell-volcengine .portal-rail-module.is-active .portal-menu-group-icon::before,
.portal-shell-volcengine .portal-rail-module.is-active .portal-menu-group-icon::after {
  border-color: #2563eb;
  background-color: #2563eb;
}

.portal-shell-volcengine .portal-rail-module.is-active [data-portal-module-icon="student-enrolment"]::after,
.portal-shell-volcengine .portal-rail-module.is-active [data-portal-module-icon="certification-review"]::after,
.portal-shell-volcengine .portal-rail-module.is-active [data-portal-module-icon="brand-coop"]::after,
.portal-shell-volcengine .portal-rail-module.is-active [data-portal-module-icon="media-coop"]::after,
.portal-shell-volcengine .portal-rail-module.is-active [data-portal-module-icon="account-org"]::after {
  background-color: transparent;
}

.portal-shell-volcengine .portal-rail-module.is-active [data-portal-module-icon="media-coop"]::after {
  border-left-color: #2563eb;
}

.portal-shell-volcengine .portal-rail-module .portal-menu-group-copy small {
  display: none;
}

.portal-shell-volcengine .portal-context-panel-v2,
.portal-shell-volcengine .portal-secondary-panel[hidden] {
  display: none !important;
}

.portal-shell-volcengine .portal-inline-module-panel {
  display: none;
  margin: 2px 0 8px;
  padding: 0;
}

.portal-shell-volcengine .portal-rail-module:focus + .portal-inline-module-panel {
  display: block;
}

.portal-shell-volcengine .portal-inline-module-panel.is-active {
  display: block;
}

.portal-topbar-actions .portal-role-pill {
  display: none !important;
}

.portal-shell-volcengine .portal-module-panel-head {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: -10px -12px 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #edf2f7;
  background: rgba(255, 255, 255, 0.96);
}

.portal-shell-volcengine .portal-nav-section {
  border-left-color: transparent;
  padding: 2px 0;
}

.portal-shell-volcengine .portal-nav-section-toggle {
  width: 100%;
  border-radius: 5px;
  padding: 8px 8px;
  color: #1f2937;
  font-size: 14px;
  font-weight: 800;
  text-align: left;
}

.portal-shell-volcengine .portal-nav-section-toggle:hover {
  background: #f6f8fb;
  color: #111827;
}

.portal-shell-volcengine .portal-nav-level2-link,
.portal-shell-volcengine .portal-nav-level3-link {
  min-height: 34px;
  border-radius: 5px;
  padding: 7px 10px 7px 58px;
  color: #334155;
  font-size: 14px;
}

.portal-shell-volcengine .portal-nav-level2-link.is-active,
.portal-shell-volcengine .portal-nav-level3-link.is-active {
  background: #e9f1ff;
  color: #1d4ed8;
  font-weight: 900;
}

.portal-shell-volcengine .portal-menu-item-dot {
  background: #cbd5e1;
}

.portal-shell-volcengine .portal-nav-level2-link.is-active .portal-menu-item-dot,
.portal-shell-volcengine .portal-nav-level3-link.is-active .portal-menu-item-dot {
  background: #1d4ed8;
}

.portal-shell-volcengine .portal-main {
  background: #f3f6fa;
}

.portal-sidebar-collapsed .portal-shell.portal-shell-v2.portal-shell-volcengine {
  grid-template-columns: 64px minmax(0, 1fr);
}

.portal-sidebar-collapsed .portal-sidebar-brand span,
.portal-sidebar-collapsed .portal-sidebar-context,
.portal-sidebar-collapsed .portal-shell-volcengine .portal-inline-module-panel,
.portal-sidebar-collapsed .portal-shell-volcengine .portal-module-panel-head,
.portal-sidebar-collapsed .portal-shell-volcengine .portal-context-panel-v2,
.portal-sidebar-collapsed .portal-shell-volcengine .portal-rail-module .portal-menu-group-copy small {
  display: none;
}

.portal-sidebar-collapsed .portal-sidebar-service {
  justify-content: center;
  padding: 0;
}

.portal-sidebar-collapsed .portal-sidebar-collapse-button--side {
  display: none;
}

.portal-sidebar-collapsed .portal-shell-volcengine .portal-nav-system-v2 {
  height: calc(100vh - 58px - 62px - 76px);
}

.portal-sidebar-collapsed .portal-sidebar-footer {
  justify-content: center;
  padding-inline: 0;
}

.portal-sidebar-collapsed .portal-sidebar-collapse-button--bottom {
  margin-right: 0;
}

.portal-sidebar-collapsed .portal-sidebar-collapse-icon {
  transform: rotate(180deg);
}

.portal-sidebar-collapsed .portal-shell-volcengine .portal-primary-rail-v2 {
  height: 100%;
  padding: 8px;
  border-bottom: 0;
}

.portal-sidebar-collapsed .portal-shell-volcengine .portal-rail-module {
  min-height: 44px;
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 8px;
}

.portal-sidebar-collapsed .portal-shell-volcengine .portal-rail-module .portal-menu-group-mark {
  display: none;
}

.portal-sidebar-collapsed .portal-shell-volcengine .portal-rail-module .portal-menu-group-icon {
  width: 30px;
  height: 30px;
}

.portal-sidebar-collapsed .portal-shell-volcengine .portal-rail-module .portal-menu-group-copy strong {
  display: none;
}

@media (max-width: 1240px) {
  .portal-topbar-nav {
    display: none;
  }

  .portal-product-context {
    display: none;
  }
}

@media (max-width: 900px) {
  .portal-mobile .portal-topbar-volcengine {
    height: 64px;
    padding: 0 12px;
  }

  .portal-mobile .portal-topbar-left {
    gap: 6px;
  }

  .portal-mobile .portal-topbar-volcengine .portal-brand img {
    width: 76px;
  }

  .portal-mobile .portal-topbar-home-pill {
    min-height: 30px;
    padding: 0 8px;
    font-size: 12px;
  }

  .portal-mobile .portal-topbar-search,
  .portal-mobile .portal-topbar-nav,
  .portal-mobile .portal-project-dropdown {
    display: none;
  }

  .portal-mobile .portal-topbar-volcengine .portal-topbar-actions {
    margin-left: auto;
    gap: 6px;
  }

  .portal-mobile .portal-sidebar-collapse-button--topbar,
  .portal-mobile .portal-sidebar-collapse-button--side,
  .portal-mobile .portal-product-context,
  .portal-mobile .portal-role-pill,
  .portal-mobile .portal-user-center-trigger-copy {
    display: none;
  }

  .portal-mobile .portal-user-center-popover,
  .portal-mobile .portal-topbar-menu {
    position: fixed;
    top: 74px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: calc(100vh - 92px);
    overflow-y: auto;
  }

  .portal-mobile .portal-shell.portal-shell-v2.portal-shell-volcengine {
    display: block;
  }

  .portal-mobile .portal-shell-volcengine .portal-sidebar-volcengine {
    top: 0;
    height: 100vh;
    padding: 0;
    overflow-y: auto;
  }

  .portal-mobile .portal-sidebar-service {
    min-height: 62px;
  }

  .portal-mobile .portal-shell-volcengine .portal-nav-system-v2 {
    height: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
  }

  .portal-mobile .portal-shell-volcengine .portal-primary-rail-v2,
  .portal-mobile .portal-shell-volcengine .portal-context-panel-v2 {
    overflow: visible;
  }

  .portal-mobile .portal-shell-volcengine .portal-context-panel-v2 {
    display: none !important;
  }

  .portal-mobile .portal-user-center-meta,
  .portal-mobile .portal-user-center-links,
  .portal-mobile .portal-user-center-role-form {
    grid-template-columns: 1fr;
  }

  .portal-mobile .portal-message-center {
    min-height: auto;
  }

  .portal-mobile .portal-message-center-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .portal-mobile .portal-message-center-tabs a,
  .portal-mobile .portal-message-center-tabs span {
    white-space: nowrap;
  }

  .portal-mobile .portal-message-filter-row {
    grid-template-columns: 1fr;
  }

  .portal-mobile .portal-message-category-tabs button {
    padding: 0 14px;
  }

  .portal-mobile .portal-message-batch-actions span {
    width: 100%;
    margin-left: 0;
  }
}

/* BUG-V5B portal chrome: notification, sidebar collapse, nav icons, and control rhythm. */
.portal-topbar-notification {
  display: inline-flex;
  align-items: center;
  position: relative;
}

.portal-topbar-notification__button {
  width: 38px;
  min-width: 38px;
  min-height: var(--portal-control-height);
  border-radius: var(--portal-control-radius);
}

.portal-topbar-notification__icon {
  width: 22px;
  height: 22px;
}

.portal-topbar-notification__badge {
  top: -3px;
  right: -3px;
  min-width: 17px;
  min-height: 17px;
  font-size: 10px;
}

.portal-sidebar-toggle {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: var(--portal-control-radius);
}

.portal-sidebar-toggle__icon {
  width: 24px;
  height: 24px;
}

.portal-shell--collapsed .portal-sidebar-toggle__icon,
.portal-sidebar--collapsed .portal-sidebar-toggle__icon {
  transform: rotate(180deg);
}

.portal-nav-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
}

.portal-menu-item[aria-current="page"],
.portal-personal-link[aria-current="page"] {
  outline: 0;
}

.portal-rail-module[aria-current="page"] {
  border-color: #cfe2ff;
}

.portal-filter-form,
.portal-filter-bar,
.portal-table-toolbar,
.portal-page-actions,
.portal-form-actions,
.portal-drawer-footer,
.portal-sticky-action-bar,
.portal-action-zone,
.portal-danger-zone {
  gap: 10px;
}

.portal-filter-form input,
.portal-filter-form select,
.portal-filter-form .portal-input,
.portal-filter-form .portal-select,
.portal-filter-bar input,
.portal-filter-bar select,
.portal-filter-bar .portal-input,
.portal-filter-bar .portal-select {
  min-height: var(--portal-control-height-lg);
  border-radius: var(--portal-control-radius);
  font-size: var(--portal-control-font-size);
}

.portal-btn,
.portal-action-primary,
.portal-action-secondary,
.portal-secondary-button,
.portal-secondary-link.portal-row-action,
.portal-secondary-action,
.portal-filter-form button,
.portal-filter-bar > button,
.portal-filter-bar > a,
.portal-filter-bar .portal-actions > button,
.portal-filter-bar .portal-actions > a,
.portal-page-actions > a,
.portal-page-actions > button,
.portal-drawer-footer > a,
.portal-drawer-footer > button,
.portal-sticky-action-bar > a,
.portal-sticky-action-bar > button,
.portal-form-actions > a,
.portal-form-actions > button {
  min-height: var(--portal-control-height-lg);
  border-radius: var(--portal-control-radius);
  font-size: var(--portal-control-font-size);
  line-height: 1;
}

.portal-table-actions .portal-row-action,
.portal-table-actions .portal-secondary-button.compact,
.portal-table-actions .portal-secondary-link,
.portal-table-actions .portal-secondary-action,
.portal-table-actions button,
.portal-row-action {
  min-height: var(--portal-control-height-sm);
  border-radius: var(--portal-control-radius);
}

.portal-filter-bar > button,
.portal-filter-bar > a,
.portal-filter-bar .portal-actions > button,
.portal-filter-bar .portal-actions > a {
  width: auto;
}

.portal-blocked-action {
  min-height: var(--portal-control-height);
  border-radius: var(--portal-control-radius);
}

@media (max-width: 900px) {
  .portal-mobile .portal-topbar-notification__button,
  .portal-mobile .portal-sidebar-toggle {
    min-width: 44px;
    min-height: 44px;
  }

  .portal-mobile .portal-filter-form button,
  .portal-mobile .portal-filter-bar > button,
  .portal-mobile .portal-filter-bar > a,
  .portal-mobile .portal-filter-bar .portal-actions > button,
  .portal-mobile .portal-filter-bar .portal-actions > a {
    width: 100%;
    min-height: 44px;
  }
}

/* Portal final polish: neutral console headers, stable controls, mobile-safe content. */
.portal-page-head:not(.portal-page-hero) p,
.portal-page-head p,
.portal-panel > p,
.portal-dashboard-card > p,
.portal-r3a-panel > p,
.portal-r3a-section-head p,
.portal-section-subhead p {
  color: var(--portal-color-primary-strong);
  letter-spacing: 0;
}

.portal-panel span,
.portal-page-head span,
.portal-dashboard-card span,
.portal-r3a-panel span,
.portal-r3a-section-head span {
  line-height: 1.55;
}

.portal-page-head:not(.portal-page-hero) h1 {
  font-size: 34px;
}

.portal-page-head:not(.portal-page-hero) {
  min-height: 104px;
  padding: 24px 28px;
}

.portal-filter-form,
.portal-form-grid,
.portal-r3a-form-grid,
.portal-inline-filter-form {
  align-items: end;
}

.portal-form input,
.portal-form select,
.portal-form textarea,
.portal-form-grid input,
.portal-form-grid select,
.portal-form-grid textarea,
.portal-r3a-form-grid input,
.portal-r3a-form-grid select,
.portal-r3a-form-grid textarea,
.portal-inline-filter-form input,
.portal-inline-filter-form select,
.portal-inline-filter-form textarea {
  box-sizing: border-box;
  min-height: var(--portal-control-height-lg);
  border-radius: var(--portal-control-radius);
}

.portal-form textarea,
.portal-form-grid textarea,
.portal-r3a-form-grid textarea {
  min-height: 92px;
}

.portal-form-actions,
.portal-page-actions,
.portal-action-row,
.portal-table-actions {
  align-items: center;
}

.portal-form-actions > a,
.portal-form-actions > button,
.portal-page-actions > a,
.portal-page-actions > button,
.portal-action-row > a,
.portal-action-row > button {
  min-height: var(--portal-control-height-lg);
}

.portal-mobile .portal-main,
.portal-mobile .portal-content,
.portal-mobile .portal-r3a-shell {
  min-width: 0;
  padding-bottom: max(112px, calc(96px + env(safe-area-inset-bottom)));
}

.portal-mobile .portal-page-head:not(.portal-page-hero) {
  min-height: auto;
  padding: 18px 16px;
}

.portal-mobile .portal-page-head:not(.portal-page-hero) h1 {
  font-size: 26px;
  line-height: 1.12;
}

.portal-mobile .portal-page-head:not(.portal-page-hero) span {
  font-size: 13px;
}

.portal-mobile .portal-filter-form,
.portal-mobile .portal-form-grid,
.portal-mobile .portal-r3a-form-grid,
.portal-mobile .portal-inline-filter-form {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.portal-mobile .portal-table,
.portal-mobile .portal-table-shell,
.portal-mobile .portal-table-wrap {
  max-width: 100%;
}

.portal-mobile .portal-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.portal-mobile .portal-state.empty {
  padding: 14px;
}

@media (max-width: 1180px) {
  .portal-r3a-shell,
  .portal-r3a-panel,
  .portal-r3a-wide,
  .portal-r3a-stat-strip,
  .portal-r3a-stat-strip div,
  .portal-table-wrap {
    min-width: 0;
    max-width: 100%;
  }

  .portal-shell,
  .portal-main,
  .portal-r3a-shell {
    overflow-x: hidden;
  }

  .portal-r3a-stat-strip {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .portal-r3a-stat-strip strong,
  .portal-r3a-stat-strip span,
  .portal-section-subhead,
  .portal-table th,
  .portal-table td {
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .portal-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .portal-r3a-panel .portal-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }
}

/* BUG-058 dashboard action button readability */
.portal-dashboard .portal-row-action,
.portal-dashboard a.portal-row-action,
.portal-dashboard .dashboard-row-action,
.portal-dashboard a.dashboard-row-action,
.portal-dashboard [data-dashboard-action],
.portal-dashboard a[data-dashboard-action],
.portal-table .portal-row-action,
.portal-table a.portal-row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(185, 28, 28, 0.18);
  background: #b91c1c;
  color: #ffffff !important;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none !important;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(185, 28, 28, 0.18);
}
.portal-dashboard .portal-row-action:visited,
.portal-dashboard a.portal-row-action:visited,
.portal-dashboard .dashboard-row-action:visited,
.portal-dashboard a.dashboard-row-action:visited,
.portal-dashboard [data-dashboard-action]:visited,
.portal-dashboard a[data-dashboard-action]:visited,
.portal-table .portal-row-action:visited,
.portal-table a.portal-row-action:visited {
  color: #ffffff !important;
}
.portal-dashboard .portal-row-action:hover,
.portal-dashboard .portal-row-action:focus,
.portal-dashboard .portal-row-action:active,
.portal-dashboard a.portal-row-action:hover,
.portal-dashboard a.portal-row-action:focus,
.portal-dashboard a.portal-row-action:active,
.portal-dashboard .dashboard-row-action:hover,
.portal-dashboard .dashboard-row-action:focus,
.portal-dashboard .dashboard-row-action:active,
.portal-dashboard [data-dashboard-action]:hover,
.portal-dashboard [data-dashboard-action]:focus,
.portal-dashboard [data-dashboard-action]:active,
.portal-table .portal-row-action:hover,
.portal-table .portal-row-action:focus,
.portal-table .portal-row-action:active {
  background: #991b1b;
  color: #ffffff !important;
  border-color: rgba(153, 27, 27, 0.28);
  text-decoration: none !important;
  outline: 2px solid rgba(185, 28, 28, 0.22);
  outline-offset: 2px;
}
/* BUG-058 sidebar collapse icon visibility */
.portal-sidebar-collapse,
.portal-sidebar__collapse,
.portal-sidebar [data-sidebar-collapse],
.portal-shell-sidebar [data-sidebar-collapse],
button[data-sidebar-collapse],
button[aria-label*="收起导航"],
button[title*="收起导航"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.portal-sidebar-collapse-icon,
.portal-sidebar__collapse-icon,
[data-sidebar-collapse] .portal-icon,
[data-sidebar-collapse] svg,
button[aria-label*="收起导航"] svg,
button[title*="收起导航"] svg {
  display: inline-block;
  width: 18px;
  height: 18px;
  min-width: 18px;
  opacity: 1;
  visibility: visible;
  color: currentColor;
  fill: currentColor;
  stroke: currentColor;
}
.portal-sidebar-collapse-icon:empty::before,
.portal-sidebar__collapse-icon:empty::before,
[data-sidebar-collapse] .portal-sidebar-collapse-fallback::before {
  content: "‹";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 20px;
  line-height: 1;
  font-weight: 800;
  color: currentColor;
}
.portal-shell.is-sidebar-collapsed .portal-sidebar-collapse-icon:empty::before,
.portal-shell.is-sidebar-collapsed .portal-sidebar__collapse-icon:empty::before,
.portal-shell.is-sidebar-collapsed [data-sidebar-collapse] .portal-sidebar-collapse-fallback::before {
  content: "›";
}


/* BUG-059 profile icon system */

.portal-profile-icon-wrap,

.profile-security-icon,

.account-security-icon,

.security-center-icon {

  display: inline-flex;

  align-items: center;

  justify-content: center;

}

.portal-profile-icon {

  width: 22px;

  height: 22px;

  min-width: 22px;

  color: currentColor;

  fill: currentColor;

  display: inline-block;

  vertical-align: middle;

}

.portal-profile-icon-wrap {

  width: 44px;

  height: 44px;

  min-width: 44px;

  border-radius: 14px;

  background: rgba(185, 28, 28, 0.08);

  color: #b91c1c;

  box-shadow: inset 0 0 0 1px rgba(185, 28, 28, 0.12);

  font-size: 0;

  line-height: 0;

}

.portal-profile-icon-wrap .sr-only,

.portal-profile-icon + .sr-only {

  position: absolute !important;

  width: 1px !important;

  height: 1px !important;

  padding: 0 !important;

  margin: -1px !important;

  overflow: hidden !important;

  clip: rect(0, 0, 0, 0) !important;

  white-space: nowrap !important;

  border: 0 !important;

}

.portal-profile-icon--password { color: #991b1b; }

.portal-profile-icon--phone { color: #0f766e; }

.portal-profile-icon--email { color: #1d4ed8; }

.portal-profile-icon--identity { color: #7c3aed; }

@media (max-width: 640px) {

  .portal-profile-icon-wrap {

    width: 40px;

    height: 40px;

    min-width: 40px;

    border-radius: 12px;

  }

  .portal-profile-icon {

    width: 20px;

    height: 20px;

    min-width: 20px;

  }

}



/* Profile menu discoverability IA */

.portal-profile-discoverability-card {

  border: 1px solid rgba(185, 28, 28, 0.12);

}

.portal-profile-discoverability-card .portal-card__actions {

  margin-top: 14px;

  display: flex;

  flex-wrap: wrap;

  gap: 10px;

}

.portal-profile-discoverability-link {

  min-width: 160px;

}

.profile-completion-modal {
  gap: 20px;
}

.profile-completion-modal .otp-modal-titlebar span:not(.otp-modal-icon) {
  display: block;
  margin-top: 6px;
  color: var(--portal-muted);
  font-size: 14px;
  line-height: 1.55;
}

.profile-completion-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-completion-list li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(203, 213, 225, 0.78);
  border-radius: 8px;
  background: #f8fafc;
}

.profile-completion-list li > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--portal-blue);
  font-size: 12px;
  font-weight: 900;
}

.profile-completion-list li.is-done > span {
  background: #15803d;
}

.profile-completion-list li.is-optional > span {
  color: #1d4ed8;
  background: #dbeafe;
}

.profile-completion-list li strong {
  min-width: 0;
  color: var(--portal-ink);
  font-size: 14px;
  line-height: 1.45;
}

.profile-completion-actions {
  align-items: stretch;
}

@media (max-width: 640px) {
  .profile-completion-list li {
    grid-template-columns: 56px minmax(0, 1fr);
    padding: 10px 12px;
  }
}

/* LOGIN-CLOSURE-001A-R2 account center card layout */
.account-center-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 18px;
  align-items: start;
  max-width: 1180px;
}

.account-center-layout--single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 980px;
}

.account-center-main,
.account-center-side {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.account-center-card {
  display: grid;
  gap: 18px;
  min-width: 0;
  border: 1px solid rgba(203, 213, 225, 0.88);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
  padding: 20px;
}

.account-center-card--identity {
  align-content: start;
}

.account-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.account-card-head p,
.account-card-head h2 {
  margin: 0;
}

.account-card-head p {
  color: #b91c1c;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1.35;
}

.account-card-head h2 {
  margin-top: 5px;
  color: #101828;
  font-size: 21px;
  font-weight: 950;
  line-height: 1.2;
}

.account-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  max-width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.58);
  border-radius: 999px;
  color: #344054;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  padding: 6px 10px;
  white-space: nowrap;
}

.account-status-pill.is-ok {
  border-color: rgba(21, 128, 61, 0.28);
  color: #166534;
  background: #ecfdf3;
}

.account-status-pill.is-warning {
  border-color: rgba(217, 119, 6, 0.3);
  color: #92400e;
  background: #fffbeb;
}

.account-status-pill.is-neutral {
  border-color: rgba(37, 99, 235, 0.2);
  color: #1d4ed8;
  background: #eff6ff;
}

.account-basic-form {
  display: grid;
  grid-template-columns: 72px repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: none;
}

.account-basic-form .account-profile-avatar {
  grid-row: span 2;
}

.account-basic-form label {
  min-width: 0;
}

.account-basic-form .portal-full-field,
.account-basic-form button {
  grid-column: 2 / -1;
}

.account-basic-form button,
.account-preferences-form button {
  justify-self: start;
  width: auto;
  min-width: 148px;
}

.account-profile-avatar {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, #111827 0%, #b91c1c 100%);
  font-size: 24px;
  font-weight: 950;
  line-height: 1;
}

.account-security-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) minmax(116px, auto);
  gap: 14px;
  align-items: center;
  min-width: 0;
  padding: 14px 0;
  border-bottom: 1px solid rgba(226, 232, 240, 0.88);
}

.account-security-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.account-security-row > div {
  min-width: 0;
}

.account-security-row strong {
  display: block;
  color: #101828;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.35;
}

.account-security-row span:not(.account-status-pill):not(.account-row-icon):not(.portal-profile-icon-wrap):not(.sr-only) {
  display: block;
  margin-top: 4px;
  color: #667085;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.account-row-help {
  display: block;
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.account-row-icon {
  align-self: start;
}

.account-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.account-row-actions .portal-secondary-button,
.account-row-actions .portal-secondary-link {
  width: auto;
  min-height: 34px;
  border-radius: 6px;
  padding: 8px 11px;
  white-space: nowrap;
}

.account-preferences-form {
  display: grid;
  gap: 10px;
  max-width: none;
}

.account-preferences-form .portal-checkbox-row {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(226, 232, 240, 0.86);
  border-radius: 8px;
  background: #f8fafc;
}

.account-center-card .portal-card-list {
  gap: 10px;
}

.account-center-card .portal-state {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 1080px) {
  .account-center-layout {
    grid-template-columns: minmax(0, 1fr);
    max-width: 920px;
  }
}

@media (max-width: 720px) {
  .account-center-card {
    gap: 16px;
    padding: 16px;
  }

  .account-card-head {
    display: grid;
    gap: 10px;
  }

  .account-basic-form {
    grid-template-columns: 1fr;
  }

  .account-basic-form .account-profile-avatar,
  .account-basic-form .portal-full-field,
  .account-basic-form button {
    grid-column: 1;
  }

  .account-basic-form .account-profile-avatar {
    grid-row: auto;
  }

  .account-security-row {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 14px 0;
  }

  .account-row-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .account-row-actions .portal-secondary-button,
  .account-row-actions .portal-secondary-link,
  .account-basic-form button,
  .account-preferences-form button {
    width: auto;
    min-width: 0;
  }
}

/* BUG-USER-SHELL-001A-R3 account security self-service mobile layout */
.account-security-self-page {
  display: grid;
  gap: 18px;
  max-width: 980px;
}

.account-security-self-page .portal-page-hero {
  min-height: 0;
  margin-bottom: 0;
  padding: 22px 26px;
}

.account-security-self-page .portal-page-hero__title {
  font-size: clamp(28px, 3vw, 38px);
}

.account-security-self-page .portal-page-hero__description {
  max-width: 660px;
  font-size: 15px;
  line-height: 1.55;
}

.account-security-self-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.account-security-self-card {
  display: grid;
  gap: 0;
  padding: 20px;
  border: 1px solid rgba(191, 202, 220, 0.86);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.account-security-self-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(203, 213, 225, 0.78);
}

.account-security-self-head p,
.account-security-self-head h2 {
  margin: 0;
}

.account-security-self-head p {
  color: #dc2626;
  font-size: 13px;
  font-weight: 900;
}

.account-security-self-head h2 {
  margin-top: 4px;
  color: #101828;
  font-size: 22px;
  line-height: 1.2;
}

.account-security-self-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid rgba(226, 232, 240, 0.82);
}

.account-security-self-row:last-of-type {
  border-bottom: 0;
}

.account-security-self-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.account-security-self-icon svg {
  display: block;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account-security-self-icon--phone { background: rgba(15, 118, 110, 0.1); color: #0f766e; }
.account-security-self-icon--email { background: rgba(29, 78, 216, 0.1); color: #1d4ed8; }
.account-security-self-icon--login { background: rgba(124, 58, 237, 0.1); color: #6d28d9; }
.account-security-self-icon--shield { background: rgba(22, 163, 74, 0.1); color: #15803d; }

.account-security-self-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.account-security-self-copy strong {
  color: #101828;
  font-size: 16px;
  line-height: 1.3;
}

.account-security-self-copy span {
  color: #667085;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.account-security-self-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.account-security-self-return {
  align-self: flex-start;
  white-space: nowrap;
}

.account-security-self-actions .portal-secondary-button,
.account-security-self-actions .account-status-pill {
  min-height: 34px;
  white-space: nowrap;
}

.account-security-self-note {
  margin-top: 12px;
}

@media (max-width: 640px) {
  .account-security-self-page {
    gap: 14px;
  }

  .account-security-self-page .portal-page-hero {
    padding: 16px 18px;
  }

  .account-security-self-page .portal-page-hero__title {
    font-size: 28px;
    line-height: 1.12;
  }

  .account-security-self-page .portal-page-hero__description {
    font-size: 14px;
    line-height: 1.55;
  }

  .account-security-self-grid {
    grid-template-columns: 1fr;
  }

  .account-security-self-card {
    padding: 16px;
  }

  .account-security-self-head {
    display: grid;
    gap: 10px;
  }

  .account-security-self-return {
    justify-self: start;
  }

  .account-security-self-head h2 {
    font-size: 20px;
  }

  .account-security-self-row {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 12px;
    align-items: flex-start;
    padding: 14px 0;
  }

  .account-security-self-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 8px;
    font-size: 15px;
  }

  .account-security-self-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .account-security-self-actions .portal-secondary-button,
  .account-security-self-actions .account-status-pill {
    min-height: 32px;
    padding: 6px 10px;
  }
}

/* OWNER-DIRECT 2026-06-30: course payment amount-due + official WeChat QR block. */
.course-payment-amount {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 4px 0 14px;
  padding: 12px 16px;
  border: 1px solid rgba(200, 162, 74, 0.5);
  border-radius: 10px;
  background: rgba(200, 162, 74, 0.10);
}
.course-payment-amount__label { font-size: 0.92rem; color: #8a6a1f; }
.course-payment-amount__value { font-size: 1.5rem; font-weight: 700; color: #1c1c1c; }
.course-payment-wechat {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid rgba(7, 193, 96, 0.45);
  border-radius: 10px;
  background: rgba(7, 193, 96, 0.06);
}
.course-payment-wechat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.course-payment-wechat__qr { margin: 0; text-align: center; }
.course-payment-wechat__qr img {
  width: 220px;
  max-width: 70%;
  height: auto;
  border-radius: 8px;
  background: #fff;
}
.course-payment-wechat__qr figcaption {
  margin-top: 8px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #3a3a3a;
}
.course-payment-account__caption {
  margin: 6px 0 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #444;
}

/* OWNER-DIRECT 2026-07-01: resource-center pending state (no downloadable content yet). */
.portal-resource-pending {
  display: inline-block;
  padding: 8px 12px;
  border: 1px dashed #b9933f;
  border-radius: 8px;
  background: rgba(185, 147, 63, 0.08);
  color: #7a5a18;
  font-size: 0.9rem;
  line-height: 1.5;
}
