:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --page-bg: #efe6de;
  --surface: #fffaf6;
  --surface-muted: #f8eee7;
  --ink: #9a0002;
  --muted: #8a4a45;
  --accent: #9a0002;
  --accent-soft: #f4d8d5;
  --accent-border: #d99b95;
  --border: #e1cfc7;
  --border-strong: #cfb5ac;
  background: var(--page-bg);
  color: var(--ink);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page-bg);
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

main {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
}

.download-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 82% 8%, rgba(154, 0, 2, 0.12), transparent 28%),
    linear-gradient(145deg, var(--page-bg), #fff7f1);
}

.download-panel {
  width: min(100%, 640px);
  display: grid;
  gap: 18px;
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 250, 246, 0.94);
  box-shadow: 0 22px 60px rgba(74, 31, 27, 0.12);
}

.download-panel h1 {
  margin: 0;
  max-width: 560px;
  color: var(--ink);
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1;
  letter-spacing: 0;
}

.download-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.download-brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
}

.download-eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.download-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 6px;
}

.download-button {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 900;
}

.download-button.secondary {
  background: var(--surface-muted);
  color: var(--ink);
  border-color: var(--border-strong);
}

.download-button span {
  display: grid;
  gap: 4px;
}

.download-button small {
  color: inherit;
  opacity: 0.76;
  font-size: 12px;
  font-weight: 700;
}

.download-button.disabled {
  pointer-events: none;
  opacity: 0.55;
}

.download-warning {
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  background: #fff1ed;
  padding: 12px;
  font-size: 13px;
}

.download-browser-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.download-inapp-shell {
  align-items: start;
  padding-top: 86px;
}

.browser-arrow {
  position: fixed;
  top: 10px;
  right: 10px;
  color: var(--accent);
  z-index: 4;
  filter: drop-shadow(0 8px 18px rgba(154, 0, 2, 0.16));
  animation: point-to-browser-menu 1.15s ease-in-out infinite;
  transform-origin: 70% 30%;
}

@keyframes point-to-browser-menu {
  0%,
  100% {
    transform: translate(-10px, 12px) scale(1);
  }
  50% {
    transform: translate(0, 0) scale(1.08);
  }
}

.instruction-panel {
  width: min(100%, 560px);
}

.open-browser-preview {
  display: block;
  width: min(100%, 360px);
  margin: 0 auto 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.instruction-steps {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.instruction-steps div {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-muted);
}

.instruction-steps strong {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
}

.instruction-steps span {
  color: var(--ink);
  font-weight: 800;
}

.branded-download-shell {
  min-height: 100vh;
  display: block;
  padding: 0;
  background: #e9e9df;
}

.download-card-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 14px;
  padding: 96px 24px 34px;
  background: #e9e9df;
  color: #070707;
}

.floating-share-icon {
  position: absolute;
  top: 26px;
  right: 24px;
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 22px;
  background: #fff;
  color: #070707;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
}

.download-logo {
  width: 86px;
  height: 86px;
  object-fit: cover;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

.main-logo {
  width: 166px;
  height: 166px;
}

.download-card-shell h1 {
  margin: 12px 0 0;
  color: #050505;
  font-size: 42px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0;
  text-align: center;
}

.download-tagline {
  width: min(100%, 540px);
  margin: 0;
  color: #111;
  font-size: 28px;
  line-height: 1.2;
  text-align: center;
}

.download-community-count {
  width: min(100%, 520px);
  margin: 0 0 44px;
  color: rgba(0, 0, 0, 0.64);
  font-size: 17px;
  line-height: 1.35;
  font-weight: 500;
  text-align: center;
}

.download-event-promo {
  width: min(100%, 572px);
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  color: #101714;
  box-shadow: 0 18px 40px rgba(18, 42, 32, 0.12);
}

.download-event-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.download-event-content {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.download-event-kicker {
  margin: 0;
  color: #1b7557;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.download-event-content h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.12;
  letter-spacing: 0;
}

.download-event-summary {
  margin: 0;
  color: #53605a;
  font-size: 15px;
  line-height: 1.5;
}

.download-event-details {
  display: grid;
  gap: 9px;
  padding: 3px 0;
}

.download-event-details span {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #27332e;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 650;
}

.download-event-details svg {
  flex: 0 0 auto;
  margin-top: 1px;
  color: #1b7557;
}

.download-event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 2px;
}

.download-event-action {
  min-height: 44px;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 15px;
  border-radius: 8px;
  background: #176449;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: background 160ms ease, transform 160ms ease;
}

.download-event-action:hover {
  background: #0f5039;
  transform: translateY(-1px);
}

.download-event-whatsapp {
  background: #087b60;
}

.download-event-whatsapp:hover {
  background: #05634d;
}

.download-inapp-shell .download-event-promo {
  margin-top: 18px;
}

.download-option-list {
  width: min(100%, 572px);
  display: grid;
  gap: 14px;
}

.download-option-card {
  min-height: 122px;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border: 1.5px solid rgba(255, 255, 255, 0.92);
  border-radius: 38px;
  background: rgba(255, 255, 255, 0.14);
  color: #070707;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.download-option-card img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 28px;
  background: #000;
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.16);
}

.download-option-card div {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.download-option-card strong {
  overflow-wrap: anywhere;
  font-size: 25px;
  line-height: 1.1;
  font-weight: 500;
}

.download-option-card span {
  overflow-wrap: anywhere;
  color: rgba(0, 0, 0, 0.58);
  font-size: 18px;
  line-height: 1.25;
}

.download-option-card.disabled {
  pointer-events: none;
  opacity: 0.58;
}

.download-option-card.download-option-available {
  background: #fff;
  border-color: #fff;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.12);
}

.branded-download-shell .download-warning,
.branded-download-shell .download-browser-note {
  width: min(100%, 572px);
}

.branded-download-shell .download-browser-note {
  justify-content: center;
  margin-top: 4px;
}

@media (max-width: 560px) {
  .download-card-shell {
    min-height: 100vh;
    padding: 76px 18px 28px;
  }

  .floating-share-icon {
    top: 18px;
    right: 18px;
    width: 58px;
    height: 58px;
    border-radius: 18px;
  }

  .main-logo {
    width: 134px;
    height: 134px;
  }

  .download-card-shell h1 {
    font-size: 36px;
  }

  .download-tagline {
    font-size: 24px;
  }

  .download-community-count {
    margin-bottom: 36px;
    font-size: 16px;
  }

  .download-event-content {
    padding: 18px;
  }

  .download-event-content h2 {
    font-size: 23px;
  }

  .download-event-actions,
  .download-event-action {
    width: 100%;
  }

  .download-event-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .download-event-action {
    min-height: 52px;
    padding: 8px;
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
  }

  .download-option-card {
    grid-template-columns: 74px minmax(0, 1fr) 24px;
    min-height: 108px;
    border-radius: 30px;
    gap: 14px;
    padding: 16px;
  }

  .download-option-card img {
    width: 74px;
    height: 74px;
    border-radius: 22px;
  }

  .download-option-card strong {
    font-size: 22px;
  }

  .download-option-card span {
    font-size: 16px;
  }
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 24px;
  background: var(--page-bg);
}

.login-embedded {
  min-height: auto;
  background: transparent;
  padding: 0;
  place-items: start center;
}

.login-panel {
  width: min(100%, 430px);
  display: grid;
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 18px 48px rgba(35, 46, 42, 0.06);
}

.login-brand p,
.login-copy {
  margin: 0;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 16px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.signup-legal-note {
  max-width: 720px;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  min-width: 0;
}

.signup-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -4px;
  padding: 2px 2px 0;
  color: var(--muted);
  font-size: 13px;
}

.text-button {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 800;
}

.input-wrap {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface-muted);
  color: var(--muted);
}

.input-wrap input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  color: var(--ink);
}

.form-error {
  margin: 0;
  color: #9a2d22;
  background: #fff0ed;
  border: 1px solid #f0c1ba;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
}

.form-success {
  margin: 0;
  color: var(--accent);
  background: #e3f8eb;
  border: 1px solid #bfe7ce;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
}

.single-panel {
  display: grid;
}

.uploader-form {
  display: grid;
  gap: 16px;
}

.uploader-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.uploader-form input,
.uploader-form select,
.uploader-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  padding: 11px 12px;
  outline: 0;
}

.uploader-form textarea {
  resize: vertical;
}

.uploader-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.chapter-preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px;
  background: var(--surface-muted);
}

.chapter-preview span,
.chapter-preview li {
  color: var(--muted);
  font-size: 13px;
}

.chapter-preview ol {
  margin: 0;
  padding-left: 20px;
}

.upload-file-list {
  display: grid;
  gap: 8px;
}

.upload-file-row {
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px 12px;
}

.upload-file-row.failed {
  background: #fff7f5;
  border-color: #efc6bd;
}

.upload-file-row.success {
  background: #f1fbf5;
  border-color: #bfe7ce;
}

.upload-file-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.upload-file-main strong,
.upload-file-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-file-main strong {
  color: var(--ink);
  font-size: 13px;
}

.upload-file-main span {
  color: var(--muted);
  font-size: 12px;
}

.upload-file-track {
  background: #e6ece9;
  border-radius: 999px;
  height: 5px;
  overflow: hidden;
}

.upload-file-track span {
  background: var(--accent);
  display: block;
  height: 100%;
  transition: width 160ms ease;
}

.upload-file-row.failed .upload-file-track span {
  background: #ba4a35;
}

.upload-file-actions {
  display: inline-flex;
  gap: 6px;
}

.upload-file-actions .icon-button {
  height: 34px;
  min-width: 34px;
  width: 34px;
}

.danger-icon-button {
  color: #a64225;
}

.payout-callout {
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-top: 16px;
  padding: 14px;
}

.payout-callout p {
  margin: 4px 0 0;
}

.payout-callout button {
  white-space: nowrap;
}

.id-preview-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.id-preview-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 10px;
  pointer-events: none;
}

.id-preview-card img {
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  display: block;
  object-fit: cover;
  width: 100%;
}

.id-preview-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.module-intro {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.fee-summary {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.fee-summary p {
  margin: 0;
}

main.portal-shell {
  grid-template-columns: 300px minmax(0, 1fr);
}

main.portal-top-shell {
  grid-template-columns: minmax(0, 1fr);
}

.portal-sidebar nav {
  gap: 8px;
}

.portal-sidebar nav button {
  width: 100%;
  justify-content: flex-start;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid transparent;
}

.portal-sidebar nav button:hover,
.portal-sidebar nav button.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-border);
}

.portal-sidebar {
  overflow-y: auto;
  overscroll-behavior: contain;
}

.portal-content {
  max-width: 1440px;
}

.top-nav-bar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--page-bg);
}

.top-nav-left {
  min-width: 0;
}

.top-nav-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.public-header {
  padding: 0 0 10px;
}

.portal-mode-login {
  align-content: start;
  gap: 14px;
  padding-top: 10px;
}

.portal-mode-login .public-header {
  padding-bottom: 8px;
}

.public-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.public-back-button {
  flex: 0 0 auto;
}

.top-nav-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(280px, calc(100vw - 32px));
  max-height: min(72vh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(35, 46, 42, 0.12);
}

.top-nav-group {
  display: grid;
  gap: 5px;
}

.top-nav-menu button,
.top-nav-menu a {
  width: 100%;
  justify-content: flex-start;
  min-height: 40px;
}

.top-nav-menu button.active,
.top-nav-menu button:hover,
.top-nav-menu a.active,
.top-nav-menu a:hover {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
}

.portal-stack {
  display: grid;
  gap: 18px;
}

.portal-hero {
  display: grid;
  gap: 18px;
  align-items: start;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-muted) 100%);
}

.portal-hero-copy h1 {
  font-size: 32px;
  line-height: 1.1;
  margin-top: 8px;
}

.portal-hero-copy p,
.policy-card p,
.role-card p,
.portal-steps p {
  color: var(--muted);
  margin: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.signup-hero {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  align-items: center;
}

.signup-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.signup-role-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.signup-role-card.active {
  border-color: #bfe7ce;
  background: var(--accent-soft);
}

.signup-role-card strong {
  display: block;
  font-size: 14px;
}

.signup-role-card span {
  color: var(--muted);
  font-size: 12px;
}

.signup-summary {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.signup-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.signup-summary strong {
  font-size: 15px;
}

.role-card {
  width: 100%;
  display: grid;
  gap: 12px;
  text-align: left;
  padding: 18px;
  border-radius: 8px;
  background: var(--surface-muted);
  min-width: 0;
}

.role-card-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.role-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  flex: 0 0 auto;
}

.role-card strong,
.policy-card strong,
.application-badge strong {
  display: block;
  color: var(--ink);
}

.role-card p {
  line-height: 1.45;
}

.role-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  display: grid;
  gap: 6px;
}

.role-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 800;
}

.role-accent {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
}

.application-badge span,
.policy-card-summary p {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.policy-grid {
  display: grid;
  gap: 12px;
}

.policy-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  overflow: hidden;
}

.policy-card[open] {
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(35, 46, 42, 0.05);
}

.policy-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.policy-card-summary {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 18px 18px;
  cursor: pointer;
  list-style: none;
}

.policy-card-summary::-webkit-details-marker {
  display: none;
}

.policy-card-summary strong {
  font-size: 16px;
}

.policy-summary-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.policy-card-body {
  display: grid;
  gap: 14px;
  padding: 0 18px 18px;
  max-height: min(620px, 68vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.policy-sections {
  display: grid;
  gap: 10px;
}

.policy-section {
  border: 1px solid #e7ece9;
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.policy-section[open] {
  border-color: #cfe4d8;
}

.policy-section summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  font-weight: 800;
  color: var(--ink);
}

.policy-section summary::-webkit-details-marker {
  display: none;
}

.policy-section summary::after {
  content: '+';
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
}

.policy-section[open] summary::after {
  content: '–';
}

.markdown-blocks {
  padding: 0 14px 14px;
  color: var(--ink);
}

.markdown-blocks p {
  margin: 0 0 12px;
  line-height: 1.6;
}

.markdown-blocks h4 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 14px;
}

.markdown-list {
  margin: 0 0 12px;
  padding-left: 20px;
  display: grid;
  gap: 6px;
  color: var(--ink);
}

.policy-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.portal-form {
  display: grid;
  gap: 18px;
}

.contributor-module-panel {
  display: grid;
  gap: 16px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.compact-field-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.field-grid label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  min-width: 0;
}

.field-grid input,
.field-grid textarea,
.field-grid select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--ink);
}

.field-grid textarea {
  min-height: 120px;
  resize: vertical;
  overflow-wrap: anywhere;
}

.field-grid input:focus,
.field-grid textarea:focus,
.field-grid select:focus,
.login-form input:focus {
  outline: 2px solid rgba(154, 0, 2, 0.18);
  border-color: var(--accent-border);
}

.field-wide {
  grid-column: 1 / -1;
}

.field-section {
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.checkbox-row {
  display: grid;
  gap: 10px;
}

.checkbox-row label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 13px;
}

.application-badge {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.role-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.role-switch button {
  background: var(--surface);
}

.role-switch button.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-border);
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  color: var(--ink);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand > span {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
}

.brand strong {
  display: block;
  font-size: 15px;
}

.brand p,
.topbar p,
.stat-card p,
.stat-card span,
.muted,
.service-row span,
.funnel-row span,
.mini-kpi span,
.last-refresh span {
  margin: 0;
  color: var(--muted);
}

nav {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.nav-group {
  display: grid;
  gap: 5px;
}

.nav-group-toggle,
.top-nav-group-toggle {
  width: 100%;
  min-height: 34px;
  justify-content: space-between;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-group-toggle:hover,
.top-nav-group-toggle:hover {
  background: #f1f6f4;
  color: var(--accent);
}

.nav-group-items,
.top-nav-group-items {
  display: grid;
  gap: 5px;
}

nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 11px;
  text-decoration: none;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 750;
  font-size: 14px;
}

nav a.active,
nav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.session-box {
  margin-top: auto;
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.session-box span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.session-box strong {
  display: block;
  color: var(--ink);
  overflow-wrap: anywhere;
  font-size: 13px;
}

.last-refresh {
  display: grid;
  gap: 5px;
  color: var(--accent);
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.last-refresh strong {
  color: var(--ink);
  font-size: 20px;
}

.secondary-button {
  justify-content: center;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
}

.content {
  padding: 34px 32px 44px;
  display: grid;
  gap: 22px;
  max-width: 1380px;
  width: 100%;
  min-width: 0;
}

.contributor-content {
  align-content: start;
  gap: 12px;
  padding-top: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0 10px;
  background: var(--page-bg);
}

.dashboard-title {
  min-width: 0;
}

.dashboard-title p {
  margin: 6px 0 0;
  color: var(--muted);
}

.icon-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
  justify-content: center;
}

.mobile-menu-button {
  display: inline-flex;
}

.mobile-section-signout {
  margin-top: 6px;
  border-color: #f0ded9;
  background: #fff8f6;
  color: #a64225;
}

.mobile-section-signout:hover {
  background: #fff0eb;
  border-color: #e8c7bc;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  font-size: 17px;
}

button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  font-weight: 800;
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.alert,
.panel,
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(35, 46, 42, 0.04);
}

.alert {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  color: #684a05;
  background: #fff9e7;
  border-color: #f0dca5;
}

.alert p {
  margin: 2px 0 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

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

.stat-card {
  display: flex;
  gap: 14px;
  padding: 20px;
  min-height: 122px;
}

button.stat-card {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
}

.stat-card.actionable {
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.stat-card.actionable:hover,
.stat-card.actionable:focus-visible {
  border-color: #b8ded0;
  box-shadow: 0 18px 42px rgba(35, 46, 42, 0.08);
  transform: translateY(-1px);
}

.stat-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  flex: 0 0 auto;
}

.stat-card strong {
  display: block;
  margin: 7px 0;
  font-size: 26px;
  line-height: 1.1;
}

.stat-card p,
.stat-card span {
  font-size: 13px;
}

.stat-trend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.stat-trend b {
  font-size: 12px;
}

.stat-trend span {
  font-size: 10px;
}

.stat-trend.up {
  color: #146c43;
}

.stat-trend.down {
  color: #9a0002;
}

.stat-trend.flat {
  color: var(--accent);
}

.stat-trend.average {
  color: var(--muted);
  font-weight: 800;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.panel {
  padding: 20px;
  min-width: 0;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-heading > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  min-height: 38px;
  padding: 0 10px;
  background: var(--surface-muted);
  color: var(--muted);
}

.search input {
  border: 0;
  background: transparent;
  outline: 0;
  min-width: 180px;
}

.service-list,
.funnel-list {
  display: grid;
  gap: 12px;
  max-height: min(480px, 54vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.scrollable-panel-body {
  max-height: min(520px, 58vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.compact-scroll {
  max-height: 340px;
}

.service-row,
.funnel-row {
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.service-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.service-row:last-child,
.funnel-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.service-row strong,
.service-row span,
.funnel-row strong,
.funnel-row span {
  display: block;
}

.service-row b {
  white-space: nowrap;
}

.service-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  max-height: min(640px, 64vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.service-card-grid.no-scroll-grid {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.service-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.service-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--border);
}

.challenge-card {
  display: grid;
}

.challenge-card summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 14px;
  grid-template-columns: 76px minmax(0, 1fr);
  list-style: none;
}

.challenge-card summary::-webkit-details-marker {
  display: none;
}

.challenge-card summary::after {
  align-self: center;
  color: var(--accent);
  content: '+';
  font-size: 22px;
  font-weight: 900;
  grid-column: 1 / -1;
  justify-self: end;
  line-height: 1;
}

.challenge-card[open] summary::after {
  content: '-';
}

.challenge-card .kpi-strip {
  margin-top: 12px;
}

.challenge-thumb {
  width: 64px;
  height: 64px;
  display: block;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--border);
}

.book-cover-image,
.book-cover-placeholder {
  aspect-ratio: 3 / 4;
  max-height: 260px;
}

.book-cover-placeholder {
  display: grid;
  place-items: center;
  color: var(--accent);
}

.table-cover-image {
  width: 42px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--border);
}

.media-row-actions {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.icon-menu-button {
  width: 32px;
  height: 32px;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--ink);
}

.row-action-menu {
  position: absolute;
  z-index: 5;
  top: 36px;
  right: 0;
  min-width: 132px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(35, 46, 42, 0.12);
}

.danger-menu-item {
  width: 100%;
  min-height: 34px;
  justify-content: flex-start;
  gap: 8px;
  border: 0;
  padding: 0 9px;
  color: #9a0002;
  background: transparent;
}

.danger-menu-item:hover,
.danger-menu-item:focus-visible {
  background: #fdeaea;
}

.pending-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.pending-actions button {
  min-height: 32px;
  padding: 0 10px;
}

.pending-actions .reviewed-button {
  border-color: var(--border);
  background: var(--surface-muted);
  color: var(--muted);
}

.group-cell {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 220px;
}

.group-cell strong,
.group-cell span {
  display: block;
}

.group-cell span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.group-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--border);
  color: var(--accent);
}

.service-card h3 {
  margin: 10px 0 6px;
  font-size: 18px;
  line-height: 1.25;
}

.service-card p {
  margin: 0;
  color: var(--muted);
}

.service-card-meta {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

.service-card-price {
  display: grid;
  gap: 4px;
}

.service-card-price strong {
  font-size: 22px;
}

.service-card-price span {
  color: var(--muted);
  font-size: 13px;
}

.badge-card-grid {
  display: grid;
  gap: 12px;
}

.badge-domain-list {
  display: grid;
  gap: 16px;
}

.badge-domain {
  display: grid;
  gap: 10px;
}

.badge-domain-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.badge-domain-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.badge-card {
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  padding: 14px;
}

.badge-card img,
.badge-card > span {
  align-items: center;
  aspect-ratio: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--accent);
  display: grid;
  height: 64px;
  justify-items: center;
  object-fit: contain;
  padding: 6px;
  width: 64px;
}

.badge-card strong,
.badge-card p {
  display: block;
  margin: 0;
}

.badge-card p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.badge-card b {
  white-space: nowrap;
}

.danger-button {
  border-color: #f0ded9;
  background: #fff8f6;
  color: #a64225;
}

.danger-button:hover {
  border-color: #e8c7bc;
  background: #fff0eb;
}

.funnel-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.bar-track {
  height: 8px;
  background: #eef4f1;
  border-radius: 999px;
  overflow: hidden;
}

.bar-track span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.kpi-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.relaxed-kpi-strip {
  grid-template-columns: minmax(0, 1fr);
}

.mini-kpi {
  display: grid;
  gap: 7px;
  min-height: 84px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  min-width: 0;
}

.mini-kpi.actionable {
  text-align: left;
  cursor: pointer;
}

.mini-kpi.actionable:hover {
  border-color: #bfe7ce;
  background: var(--accent-soft);
}

.mini-kpi strong {
  font-size: 24px;
  overflow-wrap: anywhere;
}

.mini-kpi span {
  font-size: 12px;
  font-weight: 750;
}

.table-wrap {
  width: 100%;
  max-height: min(640px, 64vh);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  background: var(--surface-muted);
}

.empty-cell {
  color: var(--muted);
  text-align: center;
  padding: 24px 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  background: #edf1ef;
  color: var(--ink);
  white-space: nowrap;
}

.pill.good {
  background: #dff6ea;
  color: var(--accent);
}

.pill.warn {
  background: #fff1ce;
  color: #805500;
}

.payout-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-muted);
}

.payout-panel-head,
.row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.payout-panel-head {
  margin-bottom: 14px;
}

.payout-panel-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.row-actions button {
  min-height: 34px;
  padding: 0 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 29, 27, 0.32);
}

.modal-card {
  width: min(100%, 420px);
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(23, 29, 27, 0.2);
}

.modal-card label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

.modal-card input {
  min-height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0 12px;
}

@media (max-width: 1180px) {
  .stats-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .kpi-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .portal-hero {
    grid-template-columns: 1fr;
  }

  .role-grid {
    grid-template-columns: 1fr;
  }

  .signup-hero {
    grid-template-columns: 1fr;
  }

  .signup-role-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  main {
    grid-template-columns: 1fr;
  }

  main > .sidebar {
    display: none;
  }

  .dashboard-header {
    align-items: flex-start;
  }

  .dashboard-title h1 {
    max-width: 100%;
  }

  .split {
    grid-template-columns: 1fr;
  }

  main.portal-shell {
    grid-template-columns: 1fr;
  }

  .portal-sidebar {
    position: static;
    height: auto;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .portal-sidebar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .policy-card-summary {
    align-items: start;
    flex-direction: column;
  }

  .policy-summary-meta {
    justify-items: start;
  }
}

@media (max-width: 640px) {
  body {
    overflow-x: hidden;
  }

  .content {
    padding: 18px 16px 28px;
  }

  .portal-mode-login {
    gap: 12px;
    padding-top: 6px;
  }

  .topbar,
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-header {
    align-items: flex-start;
    gap: 10px;
    padding-top: 0;
  }

  .top-nav-actions > button:not(.mobile-menu-button) {
    min-width: 42px;
    padding: 0 12px;
  }

  .top-nav-actions > button:not(.mobile-menu-button) span {
    display: none;
  }

  .dashboard-title p {
    font-size: 13px;
  }

  .stats-grid,
  .kpi-strip {
    grid-template-columns: 1fr;
  }

  .overview-stats-grid {
    grid-template-columns: 1fr;
  }

  .portal-sidebar nav {
    width: 100%;
  }

  .portal-sidebar nav button {
    width: 100%;
    justify-content: flex-start;
  }

  h1 {
    font-size: 24px;
  }

  .stat-card strong {
    font-size: 22px;
  }

  .portal-hero-copy h1 {
    font-size: 26px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .signup-role-grid {
    grid-template-columns: 1fr;
  }

  .search input {
    min-width: 0;
    width: 100%;
  }

  .search {
    width: 100%;
  }

  .form-actions {
    width: 100%;
  }

  .form-actions button {
    width: 100%;
    justify-content: center;
  }

  .payout-callout {
    align-items: stretch;
    flex-direction: column;
  }

  .payout-callout button {
    width: 100%;
    justify-content: center;
  }

  .id-preview-grid {
    grid-template-columns: 1fr;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .policy-card-summary {
    padding: 16px;
  }

  .policy-card-body {
    padding: 0 16px 16px;
  }

  .policy-meta,
  .signup-inline,
  .service-row,
  .funnel-row > div:first-child {
    gap: 8px;
  }

  .policy-meta,
  .policy-card-summary,
  .service-row,
  .funnel-row > div:first-child {
    align-items: flex-start;
    flex-direction: column;
  }

  .session-box,
  .last-refresh {
    width: 100%;
  }

  .session-box strong,
  .last-refresh strong {
    font-size: 14px;
  }

  .stat-card {
    padding: 16px;
  }

  .mini-kpi {
    min-height: 74px;
  }

  .table-wrap {
    margin-right: -2px;
  }

  .payout-panel-head,
  .row-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .row-actions {
    justify-self: stretch;
  }

  .row-actions button {
    width: 100%;
    justify-content: center;
  }
}
