:root {
  --portal-bg: #f6f8fb;
  --portal-surface: #ffffff;
  --portal-border: #dbe3ee;
  --portal-ink: #0f172a;
  --portal-muted: #475569;
  --portal-brand: #0f1b4a;
  --portal-brand-2: #1e3a8a;
  --portal-success: #166534;
  --portal-warning: #92400e;
  --portal-danger: #991b1b;
  --portal-radius: 14px;
  --portal-shadow: 0 8px 28px rgba(15, 23, 42, 0.07);
}
* { box-sizing: border-box; }
body.portal-body {
  margin: 0;
  background: var(--portal-bg);
  color: var(--portal-ink);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Helvetica Neue, Arial, sans-serif;
}
.portal-topbar {
  background: var(--portal-surface);
  border-bottom: 1px solid var(--portal-border);
  position: sticky;
  top: 0;
  z-index: 30;
}
.portal-topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.brand-link {
  color: var(--portal-brand);
  font-weight: 800;
  text-decoration: none;
}
.portal-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.portal-main,
.portal-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 20px 40px;
}
.page-header { margin-bottom: 20px; }
.page-title {
  margin: 0;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  color: var(--portal-brand);
}
.page-subtitle { margin-top: 8px; color: var(--portal-muted); max-width: 780px; }
.build-info-badge {
  margin-top: 6px;
  margin-bottom: 0;
  color: #64748b;
  font-size: 0.75rem;
  letter-spacing: 0.01em;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card {
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  box-shadow: var(--portal-shadow);
  padding: 18px;
}
.metric-value {
  margin: 6px 0 2px;
  color: var(--portal-brand);
  font-size: 1.75rem;
  font-weight: 800;
}
.meta { color: var(--portal-muted); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--portal-border);
  background: #fff;
  color: var(--portal-ink);
  border-radius: 11px;
  text-decoration: none;
  padding: 10px 14px;
  font-weight: 650;
  cursor: pointer;
}
.btn-primary {
  background: var(--portal-brand-2);
  border-color: var(--portal-brand-2);
  color: #fff;
}
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid #c6d2e4;
  border-radius: 11px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}
.textarea { min-height: 110px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-1 { grid-column: 1 / -1; }
.form-stack { display: grid; gap: 8px; }
.form-section { margin-bottom: 20px; }
.label { font-weight: 650; color: #1e293b; }
.table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  box-shadow: var(--portal-shadow);
}
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid #edf1f6; vertical-align: top; }
th { color: var(--portal-brand); background: #f7f9fc; font-size: .92rem; }
tr:last-child td { border-bottom: 0; }
.status-pill {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid #cad5e5;
  background: #f8fbff;
  color: #1e293b;
  font-size: 0.8rem;
  font-weight: 700;
}
.status-awaiting-signature,
.status-waiting-for-documents,
.status-data-review-needed,
.status-on-hold,
.status-escalated-for-cpa-review { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.status-ready-to-file,
.status-filed,
.status-accepted,
.status-documents-received { background: #ecfdf3; border-color: #bbf7d0; color: #166534; }
.staff-layout { display: grid; grid-template-columns: 250px 1fr; gap: 18px; }
.sidebar {
  background: #fff;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  box-shadow: var(--portal-shadow);
  padding: 16px;
  align-self: start;
  position: sticky;
  top: 84px;
}
.sidebar h3 { margin: 0 0 10px; color: var(--portal-brand); font-size: 1rem; }
.sidebar a {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: #1e293b;
  margin-bottom: 4px;
}
.sidebar a.active,
.sidebar a:hover { background: #eff4ff; color: var(--portal-brand-2); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.steps li { padding: 10px; border: 1px solid var(--portal-border); border-radius: 10px; background: #fff; }
.steps li.active { border-color: #9db2d9; background: #f2f7ff; color: #0f1b4a; font-weight: 700; }
.tip-list { margin: 0; padding-left: 18px; color: var(--portal-muted); }
.portal-hero {
  background: linear-gradient(145deg, #0f1b4a, #1e3a8a);
  color: #fff;
  border-radius: 18px;
  padding: 34px;
  box-shadow: var(--portal-shadow);
}
.portal-hero h1 { margin: 0; font-size: clamp(1.8rem, 2.8vw, 2.5rem); }
.portal-hero p { margin: 12px 0 0; max-width: 760px; color: #dbe7ff; }
.eyebrow { font-size: .84rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; opacity: .9; }
.feature-list { margin: 0; padding-left: 18px; color: var(--portal-muted); display: grid; gap: 8px; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.step-card { border: 1px solid var(--portal-border); border-radius: 12px; padding: 14px; background: #fff; }
.step-card h3 { margin: 0 0 8px; color: var(--portal-brand); font-size: 1.05rem; }
.section-space { margin-top: 22px; }
.checklist-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; color: #1e293b; }
.muted-note { color: var(--portal-muted); font-size: .94rem; }
.radio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.choice-chip {
  border: 1px solid #c6d2e4;
  border-radius: 11px;
  padding: 10px 12px;
  background: #fff;
}
.choice-chip input { margin-right: 8px; }
.hidden { display: none !important; }
.gate-banner {
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  border-radius: 12px;
  padding: 14px;
}
.gate-banner h3 { margin: 0 0 8px; color: #1e3a8a; }
@media (max-width: 980px) {
  .grid-2, .grid-3, .staff-layout, .how-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  table { min-width: 620px; }
  .sidebar { position: static; }
  .portal-hero { padding: 24px; }
}

.workspace-note {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 12px;
  padding: 12px;
  margin: 0;
}
.upload-list-wrap {
  border: 1px dashed #93c5fd;
  border-radius: 12px;
  background: #f8fbff;
  padding: 14px;
}
.staged-file-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}
.staged-file-list li {
  display: grid;
  gap: 3px;
}
.sso-stack {
  display: grid;
  gap: 10px;
  max-width: 420px;
}
.btn-provider {
  font-weight: 700;
}
.btn-provider-google {
  background: #fff;
  border-color: #d4d8df;
}
.btn-provider-facebook {
  background: #1877f2;
  border-color: #1877f2;
  color: #fff;
}
.email-fallback {
  border-top: 1px solid var(--portal-border);
  padding-top: 12px;
}
.email-fallback summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--portal-brand);
}
.auth-card {
  max-width: 560px;
}
.value-card {
  border-color: #c7d2fe;
  background: linear-gradient(180deg, #f8faff 0%, #ffffff 100%);
}
.value-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  gap: 12px;
}
.value-list li {
  border: 1px solid #dbe3ee;
  border-radius: 11px;
  padding: 12px;
  display: grid;
  gap: 4px;
}
.custom-file-input {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #c6d2e4;
  border-radius: 11px;
  background: #fff;
  padding: 8px;
}
.custom-file-trigger {
  margin: 0;
}
.custom-file-name {
  color: var(--portal-muted);
  font-size: 0.95rem;
  min-width: 0;
  overflow-wrap: anywhere;
}
.sr-only-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.sr-only-file-input:focus-visible + .custom-file-trigger {
  outline: 2px solid #1e3a8a;
  outline-offset: 2px;
}

.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.case-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  background: linear-gradient(180deg, #f9fbff, #fff);
}
.secure-note {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 11px;
  padding: 10px 12px;
  font-size: .95rem;
}
.request-list h2 { margin-top: 0; }
.task-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 12px;
}
.task-list li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid #c7d2fe;
  border-radius: 11px;
  background: linear-gradient(180deg, #f9fbff, #fff);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.timeline li {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 10px;
  padding: 10px;
  border-left: 3px solid #bfd1f5;
  background: #f8fbff;
  border-radius: 8px;
}
.timeline span {
  font-weight: 700;
  color: #1e3a8a;
}
.case-detail-list p { margin: 0 0 8px; }
.status-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}
.message-thread {
  display: grid;
  gap: 12px;
}
.message-item {
  border: 1px solid var(--portal-border);
  border-radius: 11px;
  padding: 12px;
  background: #fff;
}
.message-item.from-staff { background: #f8fbff; border-color: #cfe0ff; }
.message-meta {
  margin: 0 0 8px;
  color: #334155;
  font-size: .9rem;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  padding: 7px 12px;
  font: inherit;
  cursor: pointer;
}
.signature-checklist {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: #334155;
}

@media (max-width: 980px) {
  .grid-4, .case-meta-grid, .quick-actions { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; }
  .task-list li { flex-direction: column; }
}

.benefit-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.benefit-strip span {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.9rem;
}
.highlight-note {
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  border-radius: 12px;
  color: #1e3a8a;
  padding: 12px 14px;
}
.trust-callout {
  border-left: 4px solid #1e3a8a;
  background: #f8faff;
}
.conversion-note {
  border: 1px solid #bfdbfe;
  background: #f8fbff;
  border-radius: 12px;
  color: #1e3a8a;
  padding: 12px 14px;
}
.benefit-stack {
  display: grid;
  gap: 8px;
}
.benefit-stack p {
  margin: 0;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  padding: 10px;
  background: #fbfdff;
}
.benefit-hero {
  background: linear-gradient(180deg, #f8faff 0%, #fff 100%);
  border: 1px solid #c7d2fe;
  border-radius: var(--portal-radius);
  padding: 18px;
  box-shadow: var(--portal-shadow);
}
.benefit-hero h2 {
  margin: 0;
  color: var(--portal-brand);
}
.benefit-card-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.benefit-card {
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}
.benefit-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: #0f1b4a;
}
.benefit-card p {
  margin: 0;
  color: var(--portal-muted);
  font-size: 0.94rem;
}
.btn-provider-apple {
  background: #111827;
  border-color: #111827;
  color: #fff;
}
.btn-provider-microsoft {
  background: #fff;
  border-color: #94a3b8;
  color: #0f172a;
}
.btn-paypal {
  background: #0070ba;
  border-color: #0070ba;
  color: #fff;
}
.payment-note {
  border: 1px dashed #93c5fd;
  background: #f8fbff;
  border-radius: 10px;
  padding: 10px;
  color: #1e3a8a;
}
.payment-box {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  border-radius: 11px;
  padding: 12px;
  display: grid;
  gap: 10px;
}
.invoice-summary {
  border: 1px solid #dbe3ee;
  background: #fcfdff;
  border-radius: 11px;
  padding: 12px;
}
.invoice-summary h3 {
  margin: 0 0 8px;
  color: #0f1b4a;
}
.invoice-summary p {
  margin: 6px 0;
}
.payment-next-step {
  border: 1px dashed #93c5fd;
  border-radius: 11px;
  background: #f8fbff;
  color: #1e3a8a;
  padding: 10px 12px;
  font-size: .94rem;
}
.profile-chip {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  background: #fff;
  padding: 6px 10px;
  min-width: 220px;
}
.profile-chip-compact {
  min-width: auto;
}
.profile-avatar-img,
.profile-avatar-fallback {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}
.profile-avatar-img {
  object-fit: cover;
  border: 1px solid #cbd5e1;
}
.profile-avatar-fallback {
  display: grid;
  place-items: center;
  background: #dbeafe;
  color: #1e3a8a;
  font-weight: 800;
  font-size: .83rem;
}
.profile-name {
  margin: 0;
  font-weight: 700;
  color: #0f172a;
  font-size: .92rem;
}
.profile-meta {
  margin: 0;
  color: #64748b;
  font-size: .8rem;
}
.provider-badge {
  display: inline-block;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e40af;
  border-radius: 999px;
  padding: 2px 8px;
  margin-right: 4px;
  font-weight: 700;
}
.date-fieldset {
  border: 1px solid #dbe3ee;
  border-radius: 11px;
  padding: 12px;
}
.signature-date-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .profile-chip {
    order: 3;
    width: 100%;
    margin-left: 0;
  }
}
@media (max-width: 980px) {
  .benefit-card-grid,
  .signature-date-grid {
    grid-template-columns: 1fr;
  }
}

.task-center-list {
  display: grid;
  gap: 12px;
}
.task-center-item {
  border-color: #c7d2fe;
  background: linear-gradient(180deg, #f9fbff, #fff);
}
.task-escalate-row {
  justify-content: space-between;
  border: 1px dashed #c7d2fe;
  border-radius: 10px;
  padding: 10px;
}
.auth-page-shell {
  max-width: 820px;
}
.auth-card-block h2 {
  margin-top: 0;
  color: var(--portal-brand);
}
.delta-mode-guide {
  border: 1px solid #bfdbfe;
  background: #f8fbff;
  border-radius: 10px;
  padding: 10px 12px;
}

.task-center-item {
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
  margin-bottom: 12px;
}
.task-center-item.task-urgent {
  border-color: #f59e0b;
  background: #fffbeb;
}
.task-urgency {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 0.8rem;
}
.task-urgency-overdue {
  background: #fef2f2;
  color: #b91c1c;
}
.history-item {
  opacity: 0.94;
}

.primary-cta-card {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #f8fbff, #fff);
}
.focused-case-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.compact-switcher {
  min-width: 250px;
}
.sr-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.local-conflict-card {
  border-color: #f59e0b;
  background: #fffbeb;
}
.replacement-alert {
  border: 1px solid #f59e0b;
  background: #fff7ed;
  color: #9a3412;
  border-radius: 10px;
  padding: 10px;
  margin: 0;
}
.escalation-card {
  border-color: #fcd34d;
  background: #fffbeb;
}
.recommended-flag {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 10px;
  padding: 8px 10px;
  margin: 8px 0;
}
.trust-note {
  border-left: 4px solid #1e40af;
  padding-left: 10px;
}
.branch-guide {
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  border-radius: 10px;
  padding: 10px 12px;
}
.gate-state-banner {
  border-radius: 10px;
  padding: 12px;
  border: 1px solid #dbe3ee;
  background: #f8fafc;
}
.gate-open {
  color: #166534;
  margin: 0 0 6px;
}
.gate-blocked {
  color: #991b1b;
  margin: 0 0 6px;
}

@media (max-width: 980px) {
  .focused-case-row {
    flex-direction: column;
  }
  .compact-switcher {
    min-width: 100%;
  }
}

.preview-main {
  max-width: 980px;
  padding-top: 18px;
}
.preview-topbar-inner {
  max-width: 980px;
}
.preview-header .page-title {
  font-size: clamp(2rem, 2.6vw, 2.35rem);
}
.preview-step-card {
  box-shadow: none;
  border-radius: 12px;
}
.preview-step-card h2 {
  margin: 0;
  color: var(--portal-brand);
  font-size: 1.8rem;
}
.preview-step-card h3 {
  margin: 0;
  color: var(--portal-brand);
  font-size: 1.35rem;
}
.guided-intake-form {
  display: grid;
  gap: 8px;
}
.step-block h2 {
  margin: 0 0 10px;
  color: var(--portal-brand);
  font-size: 1.7rem;
}
.income-pill-fieldset {
  margin: 0;
  border: 1px solid #cfd8ea;
  border-radius: 10px;
  padding: 10px;
}
.income-pill-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.income-pill {
  border: 1px solid #c6d2e4;
  border-radius: 8px;
  padding: 8px;
  font-size: 0.94rem;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  background: #fff;
}
.income-pill input {
  margin-top: 2px;
}
.inline-heading {
  margin: 0 0 8px;
  font-weight: 700;
}
.cta-guide-card {
  border: 1px solid #bdcdf6;
  border-radius: 10px;
  background: #f2f6ff;
  padding: 14px;
}
.cta-guide-card h3 {
  font-size: 1.45rem;
}
.cta-guide-card p {
  margin: 8px 0 0;
  color: #334155;
}
.upload-refine-card {
  border: 1px solid #d7dfed;
  border-radius: 10px;
  background: #f9fbff;
  padding: 14px;
}
.preview-readiness-banner {
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: linear-gradient(180deg, #eff6ff, #ffffff);
  padding: 14px;
}
.preview-readiness-score {
  margin: 6px 0;
  font-size: 2rem;
  font-weight: 800;
  color: #1e3a8a;
}

@media (max-width: 980px) {
  .income-pill-grid {
    grid-template-columns: 1fr;
  }
}
