:root {
  --bg: #f3ecdf;
  --panel: rgba(255, 250, 242, 0.82);
  --panel-strong: rgba(255, 252, 247, 0.96);
  --line: rgba(15, 23, 42, 0.12);
  --ink: #0f172a;
  --muted: #52607a;
  --accent: #0b5c7b;
  --accent-soft: #d8eef5;
  --warm: #b45309;
  --warm-soft: #f7dcc0;
  --ok: #166534;
  --ok-soft: #dcfce7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --surface-glow: rgba(255, 255, 255, 0.64);
  --shadow: 0 30px 70px rgba(46, 24, 10, 0.12);
  --shadow-soft: 0 18px 44px rgba(15, 23, 42, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "PingFang SC", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.82), transparent 28%),
    radial-gradient(circle at 85% 10%, rgba(11, 92, 123, 0.18), transparent 22%),
    radial-gradient(circle at 20% 90%, rgba(180, 83, 9, 0.14), transparent 20%),
    linear-gradient(160deg, #f3ecdf 0%, #efe4d5 52%, #e7efe8 100%);
}

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

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 4px rgba(11, 92, 123, 0.14),
    0 10px 24px rgba(11, 92, 123, 0.16);
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 120px;
}

.backdrop {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), transparent 92%);
  pointer-events: none;
}

.app-shell {
  position: relative;
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.app-shell.landing-mode {
  max-width: 1080px;
  min-height: 100vh;
  display: grid;
  align-content: center;
}

.app-shell.portal-mode {
  max-width: 1180px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 20px;
  margin-bottom: 24px;
}

.app-shell.landing-mode .hero {
  grid-template-columns: 1fr;
  margin-bottom: 28px;
}

.app-shell.portal-mode .hero {
  grid-template-columns: 1fr;
  margin-bottom: 22px;
}

.hero-copy,
.hero-side,
.panel {
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 32px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255, 252, 247, 0.98), rgba(248, 238, 223, 0.86)),
    linear-gradient(transparent, transparent);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-copy {
  min-width: 0;
}

.brand-mark {
  position: relative;
  width: 86px;
  height: 86px;
  flex: 0 0 auto;
  border-radius: 28px;
  background:
    radial-gradient(circle at 28% 26%, rgba(255, 255, 255, 0.92), transparent 28%),
    linear-gradient(145deg, #0f6d91 0%, #0e4c63 52%, #b56d1f 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 24px 44px rgba(11, 92, 123, 0.18);
  overflow: hidden;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.brand-orbit {
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.42);
}

.brand-orbit-one {
  inset: 15px 11px 27px;
  transform: rotate(-14deg);
}

.brand-orbit-two {
  inset: 28px 14px 15px;
  transform: rotate(18deg);
}

.brand-core {
  position: absolute;
  inset: 31px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 32%, rgba(255, 255, 255, 0.98), rgba(240, 247, 249, 0.8) 42%, rgba(8, 44, 57, 0.94) 100%);
  box-shadow:
    inset 0 1px 8px rgba(255, 255, 255, 0.4),
    0 6px 14px rgba(8, 44, 57, 0.24);
}

.app-shell.landing-mode .hero-copy {
  padding: 72px 56px 58px;
  text-align: center;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.95), transparent 42%),
    linear-gradient(155deg, rgba(255, 250, 244, 0.98), rgba(236, 244, 246, 0.92));
}

.app-shell.landing-mode .brand-row,
.app-shell.portal-mode .brand-row {
  justify-content: center;
}

.app-shell.portal-mode .hero-copy {
  position: relative;
  padding: 34px 40px;
  text-align: center;
  background:
    radial-gradient(circle at 15% 18%, rgba(19, 130, 170, 0.16), transparent 24%),
    radial-gradient(circle at 84% 22%, rgba(209, 139, 63, 0.18), transparent 26%),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.95), transparent 44%),
    linear-gradient(160deg, rgba(255, 251, 246, 0.97), rgba(237, 244, 246, 0.92));
  overflow: hidden;
}

.app-shell.portal-mode .hero-copy::before,
.app-shell.portal-mode .hero-copy::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0.8;
}

.section-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-divider::before,
.section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(11, 92, 123, 0.16);
}

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

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

.review-step-chip {
  border: 1px solid rgba(11, 92, 123, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  padding: 12px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.review-step-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(11, 92, 123, 0.2);
  color: var(--ink);
}

.review-step-chip.active {
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.76), transparent 56%),
    linear-gradient(135deg, rgba(11, 92, 123, 0.96), rgba(14, 76, 99, 0.9));
  color: #fff;
  border-color: rgba(11, 92, 123, 0.42);
  box-shadow: 0 16px 28px rgba(11, 92, 123, 0.18);
}

.button-row.compact {
  justify-content: flex-start;
}

.review-result-grid,
.review-side-grid {
  display: grid;
  gap: 18px;
}

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

.review-side-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.review-section,
.review-side-panel {
  border-radius: var(--radius-lg);
  background: rgba(255, 252, 247, 0.88);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow-soft);
}

.review-section h3,
.review-side-panel h3 {
  margin: 6px 0 10px;
  font-size: 1.18rem;
}

.review-summary-card {
  background:
    radial-gradient(circle at top right, rgba(11, 92, 123, 0.12), transparent 24%),
    rgba(255, 252, 247, 0.92);
}

.review-guidance-card {
  border-radius: var(--radius-md);
  padding: 18px 20px;
  background:
    radial-gradient(circle at top right, rgba(11, 92, 123, 0.12), transparent 34%),
    linear-gradient(155deg, rgba(235, 246, 250, 0.92), rgba(255, 249, 240, 0.92));
  border: 1px solid rgba(11, 92, 123, 0.12);
}

.review-guidance-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.review-guidance-card p {
  margin: 0;
  line-height: 1.7;
  color: var(--muted);
}

.review-workspace {
  display: grid;
  gap: 22px;
}

.review-workspace-head {
  display: grid;
  gap: 16px;
  border-radius: var(--radius-xl);
  padding: 26px 28px;
  background:
    radial-gradient(circle at 10% 10%, rgba(11, 92, 123, 0.14), transparent 26%),
    radial-gradient(circle at 92% 14%, rgba(180, 83, 9, 0.12), transparent 24%),
    linear-gradient(160deg, rgba(255, 252, 247, 0.98), rgba(239, 246, 248, 0.94));
  border: 1px solid rgba(11, 92, 123, 0.1);
  box-shadow: var(--shadow-soft);
}

.review-workspace-head h2 {
  margin: 6px 0 10px;
  font-size: 1.6rem;
}

.review-workspace-head p:last-child {
  margin: 0;
  line-height: 1.8;
  color: var(--muted);
}

.review-flow-card {
  border-radius: var(--radius-lg);
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(247, 250, 251, 0.93));
  border: 1px solid rgba(11, 92, 123, 0.08);
  box-shadow: var(--shadow-soft);
}

.review-flow-card-head h3 {
  margin: 6px 0 8px;
  font-size: 1.24rem;
}

.review-flow-card-head p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.review-flow-card-body {
  margin-top: 18px;
}

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

.review-submit-card {
  position: sticky;
  bottom: 16px;
  z-index: 3;
}

.review-holdings-grid {
  display: grid;
  gap: 16px;
}

.review-holding-card {
  border-radius: var(--radius-lg);
  padding: 18px;
  background:
    radial-gradient(circle at top right, rgba(11, 92, 123, 0.09), transparent 28%),
    linear-gradient(160deg, rgba(255, 252, 247, 0.96), rgba(239, 246, 248, 0.92));
  border: 1px solid rgba(11, 92, 123, 0.1);
  box-shadow: var(--shadow-soft);
}

.review-holding-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.review-holding-card-top h3 {
  margin: 0;
  font-size: 1rem;
}

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

.review-score {
  margin: 12px 0 8px;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
}

.review-score-pending {
  margin: 12px 0 8px;
  font-size: 1.1rem;
  color: var(--warm);
  font-weight: 600;
}

.review-dimension-grid,
.review-alert-list,
.review-list-block,
.review-sample-list,
.review-audit-list {
  display: grid;
  gap: 12px;
}

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

.review-dimension-card,
.review-alert-card,
.review-audit-card,
.review-missing-card,
.review-data-card {
  border-radius: var(--radius-md);
  padding: 16px;
  background: rgba(244, 248, 249, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.review-dimension-top,
.review-audit-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.review-dimension-card p,
.review-alert-card p,
.review-audit-card p,
.review-missing-card p {
  margin: 8px 0 0;
  line-height: 1.7;
  color: var(--muted);
}

.review-dimension-card small {
  display: block;
  margin-top: 8px;
  color: var(--warm);
}

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

.review-data-card pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--ink);
}

.empty-state.compact {
  min-height: unset;
  padding: 20px;
}

.app-shell.review-mode .hero-copy {
  background:
    radial-gradient(circle at 18% 16%, rgba(11, 92, 123, 0.16), transparent 24%),
    radial-gradient(circle at 84% 18%, rgba(180, 83, 9, 0.14), transparent 24%),
    linear-gradient(160deg, rgba(255, 251, 246, 0.98), rgba(240, 247, 249, 0.94));
}

.app-shell.review-mode .stage {
  max-width: 1100px;
  margin: 0 auto;
}

.app-shell.review-mode .module-panel {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.app-shell.review-mode .hero-side .panel-kicker,
.app-shell.review-mode .control-rail .panel-kicker {
  color: var(--accent);
}

.app-shell.review-mode .control-rail,
.app-shell.review-mode .module-forms,
.app-shell.review-mode .session-panel {
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.94), rgba(247, 250, 251, 0.92));
}

@media (max-width: 1080px) {
  .review-stepper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-import-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  .review-result-grid,
  .review-side-grid,
  .review-data-grid,
  .review-dimension-grid,
  .review-holding-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .review-stepper {
    grid-template-columns: 1fr;
  }
}

.app-shell.portal-mode .hero-copy::before {
  width: 180px;
  height: 180px;
  top: -84px;
  left: -54px;
  background: radial-gradient(circle, rgba(19, 130, 170, 0.12), transparent 68%);
}

.app-shell.portal-mode .hero-copy::after {
  width: 220px;
  height: 220px;
  right: -76px;
  bottom: -112px;
  background: radial-gradient(circle, rgba(209, 139, 63, 0.14), transparent 68%);
}

.hero-copy h1 {
  margin: 8px 0 12px;
  max-width: 16ch;
  font-family: "Baskerville", "Songti SC", serif;
  font-size: clamp(2rem, 4vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.app-shell.landing-mode .hero-copy h1 {
  max-width: none;
  margin: 0;
  font-size: clamp(3rem, 9vw, 5.6rem);
  letter-spacing: -0.06em;
}

.app-shell.portal-mode .hero-copy h1 {
  max-width: none;
  margin: 0;
  font-size: clamp(2.8rem, 7vw, 4.8rem);
  letter-spacing: -0.055em;
}

.eyebrow,
.panel-kicker {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.subtitle {
  margin: 0;
  max-width: 62ch;
  line-height: 1.7;
  color: var(--muted);
}

.app-shell.landing-mode .eyebrow,
.app-shell.landing-mode .subtitle {
  display: none;
}

.app-shell.portal-mode .subtitle {
  display: block;
  margin: 14px auto 0;
  max-width: none;
  font-size: 1.02rem;
  color: rgba(82, 96, 122, 0.9);
}

.hero-side {
  display: grid;
  gap: 16px;
}

.app-shell.landing-mode .hero-side {
  display: none !important;
}

.app-shell.portal-mode .hero-side {
  display: none !important;
}

.status-card,
.metric-strip {
  padding: 24px;
  border-radius: var(--radius-xl);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(238, 247, 250, 0.86));
}

.account-card {
  display: grid;
  gap: 14px;
}

.account-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.account-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.account-form {
  display: grid;
  gap: 10px;
}

.account-input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.account-input-row input {
  flex: 1 1 180px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 241, 232, 0.94)),
    linear-gradient(transparent, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(15, 23, 42, 0.04);
}

.account-user {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-user strong {
  display: block;
  font-size: 1.2rem;
}

.account-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.status-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}

#generatorStatus {
  font-size: 1.15rem;
  line-height: 1.5;
}

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

.metric {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(11, 92, 123, 0.12);
}

.metric strong {
  display: block;
  font-size: 1.35rem;
  margin-bottom: 6px;
}

.metric span {
  color: var(--muted);
  font-size: 0.92rem;
}

.layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 20px;
}

.layout.layout-compact {
  grid-template-columns: 1fr;
}

.app-shell.landing-mode .stage {
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}

.control-rail,
.stage {
  display: grid;
  gap: 20px;
  align-content: start;
}

.panel {
  padding: 24px;
  border-radius: var(--radius-xl);
  background: var(--panel);
}

.module-nav {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.module-tab {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.68);
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.module-tab:hover,
.module-tab:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(11, 92, 123, 0.28);
}

.module-tab.active {
  background: linear-gradient(135deg, rgba(11, 92, 123, 0.12), rgba(180, 83, 9, 0.14));
  border-color: rgba(11, 92, 123, 0.28);
}

.module-tab strong {
  display: block;
  margin-bottom: 6px;
}

.module-tab span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.module-tab-return {
  background: rgba(11, 92, 123, 0.08);
  border-color: rgba(11, 92, 123, 0.18);
}

.module-tab-return strong::before {
  content: "← ";
}

.config-grid {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 241, 232, 0.94)),
    linear-gradient(transparent, transparent);
  color: var(--ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(15, 23, 42, 0.04);
}

.field small {
  color: var(--muted);
  line-height: 1.5;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-soft);
  transition:
    transform 140ms ease,
    opacity 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 22px 40px rgba(15, 23, 42, 0.12);
}

.button.primary {
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.18), transparent 38%),
    linear-gradient(135deg, var(--accent), #1382aa 58%, #1a8db1 100%);
  color: white;
}

.button.secondary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(246, 241, 234, 0.92)),
    linear-gradient(transparent, transparent);
  color: var(--ink);
  border-color: rgba(15, 23, 42, 0.08);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.42);
  border-color: rgba(11, 92, 123, 0.24);
  color: var(--accent);
}

.button.warn {
  background: rgba(185, 28, 28, 0.08);
  color: var(--danger);
  border: 1px solid rgba(185, 28, 28, 0.18);
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.helper {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.helper-success {
  color: var(--ok);
}

.helper-error {
  color: var(--danger);
}

.helper-warn {
  color: var(--warm);
  font-weight: 600;
}

.progress-shell {
  display: grid;
  gap: 16px;
  padding: 20px 22px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(11, 92, 123, 0.12), rgba(255, 255, 255, 0.92)),
    linear-gradient(160deg, rgba(255, 252, 247, 0.9), rgba(255, 255, 255, 0.82));
  border: 1px solid rgba(11, 92, 123, 0.18);
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.progress-title {
  font-weight: 700;
}

.progress-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(11, 92, 123, 0.98), rgba(29, 145, 190, 0.95)),
    linear-gradient(transparent, transparent);
  background-size: 120% 100%;
  position: relative;
}

.progress-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.18) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.18) 50%,
    rgba(255, 255, 255, 0.18) 75%,
    transparent 75%,
    transparent
  );
  background-size: 28px 28px;
  animation: stripes 1.2s linear infinite;
}

@keyframes stripes {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 28px 0;
  }
}

.progress-meta {
  color: var(--muted);
  line-height: 1.6;
}

.overview-grid,
.report-grid,
.history-grid,
.mistake-grid {
  display: grid;
  gap: 16px;
}

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

.app-portal-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  align-items: stretch;
}

.feature-card,
.report-card,
.history-card,
.mistake-card,
.summary-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.feature-card h3,
.report-card h3,
.summary-card h3 {
  margin: 0 0 10px;
}

.feature-card p,
.report-card p,
.summary-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.login-page-card {
  display: grid;
  gap: 18px;
  padding: 28px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(241, 247, 249, 0.92)),
    linear-gradient(transparent, transparent);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow);
}

.login-role-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
}

.login-role-chip {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.login-role-chip:hover,
.login-role-chip:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(11, 92, 123, 0.16);
  color: var(--ink);
}

.login-role-chip.active {
  background: linear-gradient(135deg, rgba(11, 92, 123, 0.12), rgba(180, 83, 9, 0.12));
  border-color: rgba(11, 92, 123, 0.2);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.login-role-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.app-shell.landing-mode .login-page-card {
  padding: 30px;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(246, 242, 235, 0.94)),
    linear-gradient(transparent, transparent);
}

.app-shell.landing-mode .login-page-card::before {
  content: "";
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(11, 92, 123, 0.22), transparent);
}

.app-shell.landing-mode .account-form {
  gap: 14px;
}

.app-shell.landing-mode .account-input-row {
  display: grid;
  gap: 12px;
}

.app-shell.landing-mode .account-input-row input {
  padding: 15px 16px;
  border-radius: 14px;
}

.app-shell.landing-mode .button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.app-shell.landing-mode .button-row.single-action {
  grid-template-columns: 1fr;
}

.config-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(11, 92, 123, 0.2), transparent);
}

.admin-user-grid {
  display: grid;
  gap: 12px;
}

.admin-user-card {
  padding: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.admin-user-card strong {
  display: block;
  margin-bottom: 6px;
}

.admin-user-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.admin-user-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.app-portal-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  min-height: 320px;
  height: 100%;
  padding: 30px;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.92), transparent 30%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(241, 247, 249, 0.92)),
    linear-gradient(transparent, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.68),
    0 26px 48px rgba(15, 23, 42, 0.08);
  position: relative;
  overflow: hidden;
}

.app-portal-card::before {
  content: "";
  position: absolute;
  inset: -20% auto auto -30%;
  width: 58%;
  height: 160%;
  transform: rotate(18deg) translateX(-110%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  opacity: 0;
  pointer-events: none;
}

.app-portal-card.interactive {
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background-position 220ms ease;
}

.app-portal-card.interactive:hover,
.app-portal-card.interactive:focus-visible {
  transform: translateY(-6px) scale(1.01);
  border-color: rgba(11, 92, 123, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 34px 64px rgba(15, 23, 42, 0.14);
  outline: none;
}

.app-portal-card.interactive:hover::before,
.app-portal-card.interactive:focus-visible::before {
  opacity: 1;
  transform: rotate(18deg) translateX(260%);
  transition: transform 720ms ease, opacity 220ms ease;
}

.app-portal-card.afp-card {
  background:
    radial-gradient(circle at top right, rgba(214, 240, 248, 0.96), transparent 30%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(237, 246, 249, 0.94));
}

.app-portal-card.wealth-card {
  background:
    radial-gradient(circle at top right, rgba(249, 234, 214, 0.96), transparent 30%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(249, 243, 235, 0.94));
}

.app-portal-card.review-card {
  background:
    radial-gradient(circle at top right, rgba(227, 239, 221, 0.96), transparent 30%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(240, 247, 235, 0.94));
}

.app-portal-card.is-disabled {
  opacity: 0.72;
}

.app-portal-card::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, rgba(11, 92, 123, 0.92), rgba(180, 83, 9, 0.7));
}

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

.portal-kicker {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
}

.portal-head h2 {
  margin: 0;
  font-family: "Baskerville", "Songti SC", serif;
  font-size: 1.45rem;
}

.portal-user {
  display: inline-flex;
}

.project-card-visual {
  position: relative;
  min-height: 92px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.project-spotlight {
  position: absolute;
  right: -18px;
  top: -24px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.7;
  pointer-events: none;
}

.project-spotlight.afp {
  background: radial-gradient(circle, rgba(19, 130, 170, 0.18), transparent 62%);
}

.project-spotlight.wealth {
  background: radial-gradient(circle, rgba(209, 139, 63, 0.2), transparent 62%);
}

.project-spotlight.review {
  background: radial-gradient(circle, rgba(78, 140, 61, 0.2), transparent 62%);
}

.project-card-body {
  display: grid;
  gap: 16px;
}

.project-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 0;
}

.project-icon {
  width: 84px;
  height: 84px;
  flex: 0 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  color: white;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 14px 34px rgba(15, 23, 42, 0.14);
}

.project-icon.afp {
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.3), transparent 24%),
    linear-gradient(145deg, #0b5c7b, #1382aa);
}

.project-icon.wealth {
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.26), transparent 24%),
    linear-gradient(145deg, #8d4f15, #d18b3f);
}

.project-icon.review {
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.28), transparent 24%),
    linear-gradient(145deg, #2f6a1f, #69a046);
}

.project-icon-core {
  position: relative;
  z-index: 2;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.project-icon-orbit {
  position: absolute;
  inset: 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  z-index: 1;
}

.project-icon-orbit.orbit-a {
  transform: rotate(14deg);
}

.project-icon-orbit.orbit-b {
  inset: 20px;
  border-radius: 16px;
  opacity: 0.76;
  transform: rotate(-12deg);
}

.project-card-label,
.project-card-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-card-label {
  background: rgba(255, 255, 255, 0.66);
  color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.project-card-status {
  background: rgba(20, 83, 45, 0.08);
  color: var(--ok);
}

.project-card-status.muted {
  background: rgba(15, 23, 42, 0.06);
  color: var(--muted);
}

.project-card-copy h3 {
  margin: 0 0 10px;
  font-size: 1.72rem;
  line-height: 1.02;
}

.project-card-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
  max-width: 30ch;
}

.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.project-card-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.84rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.app-shell.portal-mode .module-panel {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.app-shell.portal-mode .button-row {
  margin-top: 4px;
}

.project-card-cta {
  align-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  min-width: 148px;
  padding: 0 18px 0 20px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(246, 241, 234, 0.9)),
    linear-gradient(transparent, transparent);
  font-weight: 700;
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.project-card-arrow {
  font-size: 1rem;
  transition: transform 180ms ease;
}

.app-portal-card.afp-card.interactive .project-card-cta {
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.18), transparent 38%),
    linear-gradient(135deg, var(--accent), #1382aa 58%, #1a8db1 100%);
  border-color: transparent;
  color: white;
}

.app-portal-card.wealth-card.interactive .project-card-cta {
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.18), transparent 38%),
    linear-gradient(135deg, #8d4f15, #c47b2e 58%, #d79b5c 100%);
  border-color: transparent;
  color: white;
}

.app-portal-card.review-card.interactive .project-card-cta {
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.18), transparent 38%),
    linear-gradient(135deg, #2f6a1f, #5f9440 58%, #86b862 100%);
  border-color: transparent;
  color: white;
}

.app-portal-card.interactive:hover .project-card-arrow,
.app-portal-card.interactive:focus-visible .project-card-arrow {
  transform: translateX(4px);
}

.app-portal-card.interactive:hover .project-icon,
.app-portal-card.interactive:focus-visible .project-icon {
  transform: translateY(-2px) scale(1.02);
}

.project-icon,
.project-spotlight {
  transition: transform 180ms ease, opacity 180ms ease;
}

.app-portal-card.interactive:hover .project-spotlight,
.app-portal-card.interactive:focus-visible .project-spotlight {
  opacity: 0.92;
  transform: scale(1.08);
}

.app-portal-card.is-disabled .project-card-cta {
  color: var(--muted);
}

.app-portal-card {
  animation: portal-card-rise 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.app-portal-card:nth-child(2) {
  animation-delay: 80ms;
}

.app-portal-card:nth-child(3) {
  animation-delay: 160ms;
}

@keyframes portal-card-rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-portal-card,
  .project-icon,
  .project-spotlight,
  .project-card-arrow {
    transition: none;
  }

  .app-portal-card {
    animation: none;
  }
}

.app-selection-status {
  padding: 18px 20px;
}

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

.session-title {
  margin: 4px 0 8px;
  font-size: 1.6rem;
  font-family: "Baskerville", "Songti SC", serif;
}

.session-meta,
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(11, 92, 123, 0.1);
  color: var(--accent);
  font-size: 0.9rem;
}

.status-pill.ready {
  background: var(--ok-soft);
  color: var(--ok);
}

.status-pill.pending {
  background: rgba(180, 83, 9, 0.12);
  color: var(--warm);
}

.status-pill.wrong {
  background: var(--danger-soft);
  color: var(--danger);
}

.question-list {
  display: grid;
  gap: 18px;
}

.question-list-shell {
  position: relative;
}

.question-list-shell.locked .question-list {
  user-select: none;
}

.question-list-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: transparent;
}

.question-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.question-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.question-top h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.65;
}

.question-path {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.92rem;
}

.option-list {
  display: grid;
  gap: 10px;
}

.option-button {
  width: 100%;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.option-button[disabled] {
  cursor: default;
}

.option-button.selected {
  border-color: rgba(11, 92, 123, 0.32);
  background: rgba(216, 238, 245, 0.8);
}

.option-button.correct {
  border-color: rgba(22, 101, 52, 0.32);
  background: var(--ok-soft);
}

.option-button.wrong {
  border-color: rgba(185, 28, 28, 0.28);
  background: var(--danger-soft);
}

.option-index {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.06);
  font-weight: 700;
}

.explanation {
  margin-top: 14px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(11, 92, 123, 0.08);
  border: 1px solid rgba(11, 92, 123, 0.12);
  line-height: 1.7;
}

.explanation strong {
  display: block;
  margin-bottom: 8px;
}

.source-note {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(11, 92, 123, 0.12);
  color: var(--warm);
  font-size: 0.92rem;
}

.history-card,
.mistake-card {
  display: grid;
  gap: 12px;
}

.history-card-header,
.mistake-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.history-card h3,
.mistake-card h3 {
  margin: 0;
}

.meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.meta-list span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.report-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 18px;
}

.report-value {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.report-card ul,
.summary-card ul {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.empty-state {
  padding: 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(248, 238, 223, 0.72));
  border: 1px dashed rgba(15, 23, 42, 0.14);
}

.empty-state h3 {
  margin: 0 0 8px;
  font-family: "Baskerville", "Songti SC", serif;
  font-size: 1.35rem;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.split-line {
  height: 1px;
  margin: 18px 0;
  background: rgba(15, 23, 42, 0.08);
}

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

  .control-rail {
    order: 2;
  }

  .stage {
    order: 1;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 18px 14px 32px;
  }

  .hero-copy,
  .panel,
  .status-card,
  .metric-strip {
    padding: 20px;
    border-radius: 20px;
  }

  .brand-row,
  .portal-head,
  .project-card-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-shell.landing-mode .brand-row,
  .app-shell.portal-mode .brand-row {
    align-items: center;
  }

  .app-shell.landing-mode .button-row {
    grid-template-columns: 1fr;
  }

  .metric-strip {
    grid-template-columns: 1fr;
  }

  .question-top,
  .session-head,
  .history-card-header,
  .mistake-card-header,
  .progress-head {
    flex-direction: column;
  }

  .button-row {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }
}
