:root {
  --app-bg: #eef7f0;
  --app-surface: #fffdf6;
  --app-surface-alt: #f4f7ef;
  --app-border: #d8d2bf;
  --app-text: #0F172A;
  --app-text-soft: #5e6470;
  --app-navy: #14253d;
  --app-teal: #1b48d8;
  --app-green: #19782e;
  --app-gold: #fdd215;
  --app-blue: #1b48d8;
  --app-yellow: #fdd215;
  --app-red: #b91c1c;
  --app-shadow: 0 14px 0 rgba(20, 37, 61, 0.08), 0 18px 40px rgba(20, 37, 61, 0.12);
  --app-radius: 10px;
  --app-radius-sm: 6px;
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  background:
    linear-gradient(135deg, rgba(253, 210, 21, 0.10) 0 18%, transparent 18% 100%),
    linear-gradient(180deg, #eef7f0 0%, #e4f0e7 100%);
  color: var(--app-text);
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.gate-screen {
  display: none;
  min-height: 100vh;
  padding: 28px;
  align-items: center;
  justify-content: center;
}

.gate-screen.active {
  display: flex;
}

.gate-panel {
  width: min(640px, 100%);
  background: rgba(255, 253, 246, 0.98);
  border: 2px solid var(--app-navy);
  border-radius: 28px;
  box-shadow: var(--app-shadow);
  padding: 36px;
  position: relative;
  overflow: hidden;
}

.gate-panel--wide {
  width: min(820px, 100%);
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--app-navy);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

.app-brand strong {
  font-weight: 800;
}

.app-brand__regular {
  font-weight: 400;
}

.app-brand img {
  flex-shrink: 0;
}

.app-brand--compact {
  margin-bottom: 2px;
  font-size: 1rem;
}

.app-brand__suffix {
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-left: 6px;
  vertical-align: middle;
}

.gate-kicker,
.section-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--app-green);
}

.gate-panel h1,
.gate-panel h2,
.card h2,
.card h3,
.overlay-panel h2 {
  margin: 0;
  line-height: 1.1;
}

.gate-panel h1 {
  font-size: clamp(2.15rem, 4.6vw, 3.65rem);
  max-width: 16ch;
}

.gate-title__regular {
  font-weight: 400;
}

.gate-title__light {
  font-weight: 400;
}

.gate-panel h2 {
  font-size: clamp(1.85rem, 4vw, 2.8rem);
}

.gate-copy,
.helper-copy {
  margin: 16px 0 0;
  color: var(--app-text-soft);
  line-height: 1.6;
}

.founder-space-copy {
  font-size: 1.05rem;
}

.gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.gate-links {
  display: grid;
  justify-items: start;
  gap: 12px;
  margin-top: 22px;
}

.gate-link {
  font-size: 1rem;
  font-weight: 700;
}

.setup-grid,
.profile-list {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

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

.field span {
  font-size: 13px;
  font-weight: 700;
  color: var(--app-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.founder-identity-field span {
  color: var(--app-green);
}

.plan-page-block .section-kicker {
  color: var(--app-green);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff;
  color: var(--app-text);
}

.field textarea {
  min-height: 112px;
  resize: vertical;
}

.field-toggle {
  justify-self: start;
  font-size: 0.95rem;
  font-weight: 700;
}

.text-link.field-toggle::after,
button.field-toggle::after {
  content: none !important;
}

.choice-group,
.pill-row,
.toolbar__chips,
.recent-searches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.choice-pill,
.filter-pill,
.recent-search,
.progress-chip {
  border: 1px solid var(--app-border);
  background: #fff;
  color: var(--app-text);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 14px;
}

.choice-pill.active,
.filter-pill.active,
.recent-search.active,
.progress-chip.active {
  background: var(--app-navy);
  border-color: var(--app-navy);
  color: #fff;
}

.app-btn,
.app-icon-btn,
.quick-tile,
.bottom-tab,
.section-tab,
.text-link,
.search-chip,
.close-btn {
  border: 0;
  border-radius: 14px;
}

.app-btn {
  padding: 13px 18px;
  font-weight: 700;
  border: 2px solid transparent;
}

.app-btn--primary {
  background: var(--app-green);
  color: #fffdf6;
  border-color: var(--app-green);
}

.app-btn--primary:hover,
.app-btn--primary:active,
.app-btn--primary:focus-visible {
  background: #145f24;
  border-color: #145f24;
}

.app-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-btn--secondary {
  background: var(--app-blue);
  color: #fffdf6;
  border-color: var(--app-blue);
}

.app-btn--secondary:hover,
.app-btn--secondary:active,
.app-btn--secondary:focus-visible {
  background: #163fbf;
  border-color: #163fbf;
}

.app-btn--income {
  background: var(--app-green);
  color: #fffdf6;
  border-color: var(--app-green);
}

.app-btn--income:hover,
.app-btn--income:active,
.app-btn--income:focus-visible {
  background: #145f24;
  border-color: #145f24;
}

.app-btn--knowledge {
  background: var(--app-blue);
  color: #fffdf6;
  border-color: var(--app-blue);
}

.app-btn--knowledge:hover,
.app-btn--knowledge:active,
.app-btn--knowledge:focus-visible {
  background: #163fbf;
  border-color: #163fbf;
}

.app-btn--support {
  background: var(--app-yellow);
  color: var(--app-navy);
  border-color: #c8a700;
}

.app-btn--support:hover,
.app-btn--support:active,
.app-btn--support:focus-visible {
  background: #e0bc09;
  border-color: #b79600;
}

.app-btn--official {
  background: #243244;
  color: #fffdf6;
  border-color: #243244;
}

.app-btn--official:hover,
.app-btn--official:active,
.app-btn--official:focus-visible {
  background: #1c2736;
  border-color: #1c2736;
}

.app-btn--danger {
  background: #b91c1c;
  color: #fffdf6;
  border-color: #b91c1c;
}

.app-btn--danger:hover,
.app-btn--danger:active,
.app-btn--danger:focus-visible {
  background: #991b1b;
  border-color: #991b1b;
}

.app-btn--ghost,
.text-link,
.app-icon-btn,
.close-btn {
  background: transparent;
  color: var(--app-navy);
}

.app-shell__main {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
}

.offline-banner {
  display: none;
  width: 100%;
  background: #78350f;
  color: #fef3c7;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  padding: 7px 16px;
  letter-spacing: 0.01em;
  position: relative;
  z-index: 20;
}
.offline-banner.visible {
  display: block;
}

.install-banner {
  width: 100%;
  background: var(--app-navy);
  color: #fffdf6;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 20;
}
.install-banner.hidden {
  display: none;
}
.install-banner__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.install-banner__btn {
  background: var(--app-gold);
  color: var(--app-navy);
  border: 0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
}
.install-banner__dismiss {
  background: transparent;
  border: 0;
  color: rgba(255,253,246,0.6);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
}

.app-topbar {
  position: relative;
  z-index: 15;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 20px 8px;
  background: rgba(25, 120, 46, 0.14);
  backdrop-filter: blur(18px);
  border-bottom: 2px solid var(--app-navy);
  box-shadow: 0 8px 0 rgba(253, 210, 21, 0.18);
}

.app-topbar__brand {
  display: grid;
  gap: 0;
}

.app-topbar__title {
  margin-top: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.95rem);
}

.app-topbar__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.app-mode-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--app-navy);
  background: rgba(255, 253, 246, 0.88);
  border: 2px solid var(--app-navy);
}

.app-mode-badge--guest {
  background: rgba(253, 210, 21, 0.34);
}

.app-mode-badge--founder {
  background: rgba(25, 120, 46, 0.18);
}

.app-icon-btn {
  padding: 8px 12px;
  font-weight: 700;
  background: rgba(255, 253, 246, 0.88);
  border: 2px solid var(--app-navy);
}

.view {
  display: none;
  padding: 20px;
  padding-bottom: 132px;
  min-height: calc(100vh - 170px);
}

.view.active {
  display: block;
}

.card,
.overlay-panel {
  background: rgba(255, 253, 246, 0.97);
  border: 2px solid var(--app-navy);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
}

.card {
  padding: 20px;
}

.card + .card,
.card-grid,
.toolbar,
.section-tabs,
.search-strip,
.compare-table-wrap,
#exploreContent,
#savedSections,
#notesList,
#progressStages,
#searchResults {
  margin-top: 18px;
}

#savedSections {
  min-height: 360px;
}

#planHubHeader {
  margin-top: 18px;
}

.test-controls {
  margin-top: 18px;
}

.plan-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.plan-page-column {
  display: grid;
  align-content: start;
  gap: 18px;
}

.plan-page-column--left {
  grid-column: 1;
}

.plan-page-column--right {
  grid-column: 2;
}

.plan-page-block--template,
.plan-page-block--fullwidth {
  grid-column: 1 / -1;
}

.plan-page-block {
  display: grid;
  align-content: start;
  gap: 12px;
}

.plan-page-block .plain-list,
.plan-page-block .saved-groups {
  margin-top: 0;
}

.plan-page-block .section-kicker {
  margin: 0;
}

.plan-page-block .field,
.plan-page-block .mini-card,
.plan-page-block .empty-state,
.plan-page-block .saved-groups,
.plan-page-block .plain-list {
  margin-top: 0;
}

.plan-saved-group + .plan-saved-group {
  margin-top: 14px;
}

.plan-saved-group h5 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--app-text-soft);
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  background: linear-gradient(90deg, rgba(25, 120, 46, 0.65) 0 54%, rgba(27, 72, 216, 0.65) 54% 100%);
  color: #fffdf6;
  position: relative;
  overflow: hidden;
}

.hero-card h2,
.hero-card p,
.feature-card h3 {
  color: inherit;
}

.hero-card--dashboard {
  padding: 28px;
  min-height: 240px;
}

.hero-card__content,
.feature-band__content {
  position: relative;
  z-index: 1;
  max-width: 34rem;
}

.hero-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.app-btn--ghost-light {
  color: #fffdf6;
  border-color: rgba(255, 253, 246, 0.5);
  background: rgba(255, 253, 246, 0.08);
}

.hero-stats {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  min-width: 220px;
}

.hero-stat {
  appearance: none;
  width: 100%;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 253, 246, 0.28);
  background: rgba(20, 37, 61, 0.14);
  backdrop-filter: blur(8px);
  color: #fffdf6;
  text-align: left;
}

.hero-stat__label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.78;
}

.hero-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 1.15rem;
}

.hero-stat:hover,
.hero-stat:focus-visible {
  border-color: rgba(253, 210, 21, 0.55);
  background: rgba(20, 37, 61, 0.22);
}

.card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.card-grid {
  display: grid;
  gap: 18px;
}

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

.home-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "quiz articles"
    "pbpp pbpp"
    "recent recent";
  gap: 18px;
  align-items: stretch;
  margin-top: 18px;
}

.home-panel {
  display: flex;
  flex-direction: column;
  padding: 20px;
  justify-content: flex-start;
}

.home-panel--pbpp {
  grid-area: pbpp;
  min-height: 420px;
}

.home-panel--quiz {
  grid-area: quiz;
  min-height: 150px;
  justify-content: space-between;
  gap: 14px;
}

.home-panel--articles {
  grid-area: articles;
  min-height: 150px;
}

.home-panel--recent {
  grid-area: recent;
  min-height: 150px;
}

.home-panel .card-header {
  margin-bottom: 14px;
}

.home-panel p {
  margin: 0;
}

.home-panel .section-kicker {
  margin-bottom: 6px;
}

.home-panel .text-link,
.home-panel .utility-link {
  align-self: flex-start;
  font-size: 16px;
}

#founderSpaceLink {
  text-decoration: none;
}

.home-panel--articles {
  justify-content: space-between;
  gap: 14px;
}

.home-panel--pbpp .stack-list,
.home-panel--recent #recentlyViewed {
  margin-top: 4px;
}

.home-panel--pbpp .stack-list li,
.home-panel--recent .mini-card {
  padding: 14px;
}

.founder-space-label {
  font-size: inherit;
  font-weight: 700;
}

.home-panel--articles .text-link {
  margin-top: auto;
}

.home-section {
  margin-top: 20px;
}

.guest-upgrade {
  margin-top: 18px;
  background: linear-gradient(135deg, rgba(253, 210, 21, 0.18), rgba(25, 120, 46, 0.08));
}

.section-headline {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 10px;
}

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

.browse-card {
  display: grid;
  gap: 10px;
  padding: 18px 16px;
  min-height: 170px;
  text-align: left;
  align-content: start;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  border: 2px solid var(--app-navy);
  box-shadow: 0 10px 0 rgba(20, 37, 61, 0.08);
}

.browse-card strong {
  font-size: 1.1rem;
  line-height: 1.15;
}

.browse-card span:last-child {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.45;
}

.browse-card__eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.browse-card--income {
  background: rgba(25, 120, 46, 0.35);
  color: var(--app-green);
}

.browse-card--training {
  background: rgba(27, 72, 216, 0.35);
  color: var(--app-blue);
}

.browse-card--services {
  background: rgba(253, 210, 21, 0.35);
  color: #8b6d00;
}

.browse-card--official {
  background: rgba(15, 23, 42, 0.22);
  color: #243244;
  border-color: #243244;
}

.stack-list,
.saved-groups,
.detail-links,
.plain-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.overview-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
  color: var(--app-text-soft);
}

.overview-list li {
  margin: 0;
}

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

.stack-list li,
.mini-card,
.saved-block,
.note-card,
.progress-stage,
.result-group {
  padding: 16px;
  border: 2px solid rgba(20, 37, 61, 0.12);
  border-radius: 8px;
  background: var(--app-surface-alt);
}

.mini-card,
.result-group,
.list-item {
  box-shadow: 0 6px 0 rgba(20, 37, 61, 0.05);
  position: relative;
}

.mini-card::before,
.result-group::before,
.list-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: rgba(20, 37, 61, 0.16);
}

.card--stacked {
  min-height: 100%;
}

.mini-card + .mini-card,
.saved-block + .saved-block,
.note-card + .note-card,
.result-group + .result-group,
.progress-stage + .progress-stage {
  margin-top: 12px;
}

.mini-card__meta,
.result-meta,
.item-tags,
.item-links,
.compare-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.inline-actions--saved {
  align-items: center;
}

.inline-actions--saved .app-btn {
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.1;
  min-height: 36px;
  flex: 0 0 auto;
}

.utility-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--app-text-soft);
  font-size: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.utility-link-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 14px;
  border: 1.5px solid var(--app-navy);
  border-radius: 999px;
  background: transparent;
  color: var(--app-text-soft);
  font-size: inherit;
  font-weight: 700;
  text-decoration: none;
}

.utility-link--save-file {
  text-decoration: none;
}

.quick-links-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 10px;
}

.quick-links-row__label {
  margin: 0;
  white-space: nowrap;
}

.founder-note-actions {
  justify-content: space-between;
  align-items: center;
}

.utility-link::after,
.text-link::after,
.detail-links a::after {
  content: " \2192";
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: inherit;
}

.utility-link--active {
  color: var(--app-blue);
}

.utility-link--danger {
  color: #8b3a3a;
}

.utility-link--detail-save {
  font-size: 1.17em;
  font-weight: 800;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #fffdf6;
  border: 1px solid var(--app-navy);
  color: var(--app-navy);
}

.founder-note-link-card {
  display: grid;
  gap: 4px;
}

.founder-note-link {
  justify-self: start;
}

.founder-note-link__meta {
  margin: 0;
  font-size: 0.92rem;
  color: var(--app-text-soft);
}

.toolbar,
.section-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.toolbar__chips--stacked {
  display: grid;
  gap: 10px;
}

.feature-card--quiz,
.feature-band {
  background:
    linear-gradient(180deg, rgba(255, 253, 246, 0.96), rgba(228, 240, 231, 0.96));
}

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

.explore-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.explore-rail {
  position: sticky;
  top: 88px;
  align-self: start;
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 108px);
  overflow-y: auto;
  padding-right: 0;
  scrollbar-width: thin;
  justify-items: stretch;
}

.explore-rail__block,
.explore-panel {
  background: rgba(255, 253, 246, 0.97);
  border: 2px solid var(--app-navy);
  border-radius: 0;
  box-shadow: var(--app-shadow);
}

.explore-rail__block {
  padding: 18px 16px;
  width: 100%;
  box-sizing: border-box;
}

.section-tabs--explore {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  border: 2px solid var(--app-navy);
  border-radius: 0;
  background: rgba(255, 253, 246, 0.97);
  box-shadow: var(--app-shadow);
  width: 100%;
  box-sizing: border-box;
  justify-self: stretch;
}

.section-tabs--explore .section-tab {
  display: block;
  width: 100%;
  min-width: 100%;
  margin: 0;
  box-sizing: border-box;
  text-align: left;
  border: 0;
  border-top: 2px solid rgba(20, 37, 61, 0.78);
  border-radius: 0;
  padding: 18px 18px;
  color: var(--app-navy);
  font-size: 1.05rem;
  line-height: 1.15;
  box-shadow: none;
  appearance: none;
}

.section-tabs--explore .section-tab:first-child {
  border-top: 0;
}

.section-tabs--explore .section-tab:last-child {
  border-bottom: 2px solid rgba(20, 37, 61, 0.78);
}

.section-tabs--explore .section-tab[data-section="income"] {
  background: rgba(25, 120, 46, 0.34);
}

.section-tabs--explore .section-tab[data-section="training"] {
  background: rgba(27, 72, 216, 0.28);
}

.section-tabs--explore .section-tab[data-section="services"] {
  background: rgba(253, 210, 21, 0.28);
  color: var(--app-navy);
}

.section-tabs--explore .section-tab[data-section="official"] {
  background: rgba(36, 50, 68, 0.22);
}

.section-tabs--explore .section-tab.active {
  font-weight: 800;
  transform: none;
  box-shadow: inset 6px 0 0 var(--app-navy);
}

.explore-panel {
  padding: 20px;
}

.filter-select-wrap {
  display: grid;
  gap: 10px;
}

.filter-select-wrap__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--app-navy);
}

.rail-linkout {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 2px solid rgba(20, 37, 61, 0.12);
  display: grid;
  gap: 10px;
}

.rail-linkout__copy {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--app-text-soft);
}

.rail-linkout__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 2px solid var(--app-navy);
  background: rgba(255, 253, 246, 0.96);
  color: var(--app-navy);
  font-weight: 700;
  text-align: center;
}

.rail-linkout__cta:hover,
.rail-linkout__cta:focus-visible {
  background: rgba(25, 120, 46, 0.12);
}

#filterPanel[data-section="income"] {
  background: rgba(25, 120, 46, 0.16);
}

#filterPanel[data-section="training"] {
  background: rgba(27, 72, 216, 0.16);
}

#filterPanel[data-section="services"] {
  background: rgba(253, 210, 21, 0.18);
}

#filterPanel[data-section="official"] {
  background: rgba(36, 50, 68, 0.14);
}

#filterSelect {
  width: 100%;
  border: 2px solid var(--app-navy);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 253, 246, 0.94);
  color: var(--app-navy);
  font-weight: 700;
}

.explore-rail::-webkit-scrollbar {
  width: 8px;
}

.explore-rail::-webkit-scrollbar-thumb {
  background: rgba(20, 37, 61, 0.25);
  border-radius: 999px;
}

.toolbar--explore {
  margin-top: 0;
  margin-bottom: 16px;
}

.section-tab,
.search-chip {
  background: rgba(255, 253, 246, 0.95);
  border: 2px solid var(--app-navy);
  color: var(--app-text-soft);
  font-weight: 700;
  padding: 12px 16px;
}

.section-tab.active {
  background: var(--app-yellow);
  border-color: var(--app-navy);
  color: var(--app-navy);
}

.section-tabs--explore .section-tab,
.section-tabs--explore .section-tab.active {
  display: block;
  width: 100%;
  min-width: 100%;
  margin: 0;
  place-self: stretch;
  box-sizing: border-box;
  border-radius: 0;
  color: var(--app-navy);
}

.section-tabs--explore .section-tab.active {
}
.search-chip--wide {
  width: 100%;
  text-align: left;
}

.list-grid {
  display: grid;
  gap: 14px;
}

.list-item {
  padding: 16px;
  border-radius: 8px;
  border: 2px solid var(--app-navy);
  background: rgba(255, 253, 246, 0.98);
  box-shadow: 0 10px 0 rgba(20, 37, 61, 0.06);
}

.list-item h3,
.list-item h4,
.saved-block h4,
.note-card h4,
.progress-stage h4 {
  margin: 0;
}

.list-item p,
.saved-block p,
.note-card p,
.progress-stage p {
  margin: 8px 0 0;
  color: var(--app-text-soft);
}

#progressStages {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.progress-stage {
  min-height: 420px;
  display: grid;
  align-content: start;
  gap: 12px;
  background: rgba(255, 253, 246, 0.98);
  border: 2px solid var(--app-navy);
  box-shadow: 0 8px 0 rgba(20, 37, 61, 0.06);
}

.progress-stage--overview {
  grid-column: 1 / -1;
  min-height: auto;
  background: linear-gradient(135deg, rgba(25, 120, 46, 0.10), rgba(27, 72, 216, 0.08));
}

.progress-stage + .progress-stage {
  margin-top: 0;
}

.progress-stage h4 {
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(20, 37, 61, 0.12);
}

.progress-stage .mini-card,
.progress-stage .empty-state {
  margin-top: 0;
}

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

.plan-draft-field {
  gap: 8px;
}

.plan-draft-field textarea {
  min-height: 132px;
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.98);
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.48);
}

.overlay-panel {
  width: min(860px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 22px;
}

.overlay-panel--detail {
  width: min(960px, 100%);
}

.overlay-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.detail-section + .detail-section {
  margin-top: 18px;
}

.detail-section h3 {
  margin-bottom: 8px;
}

.article-detail-shell {
  max-width: 720px;
  margin: 0 auto;
}

.article-detail-meta {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--app-blue);
}

.article-detail-intro {
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(20, 37, 61, 0.12);
}

.article-detail-description,
.article-detail-lead {
  margin: 0;
  color: var(--app-text);
  line-height: 1.8;
}

.article-detail-lead {
  margin-top: 12px;
  font-size: 19px;
  color: var(--app-text-soft);
}

.article-live-content {
  display: grid;
  gap: 0;
  max-width: 720px;
  margin: 0 auto;
  font-size: 17px;
}

.article-live-content h2,
.article-live-content h3,
.article-live-content h4 {
  margin: 34px 0 12px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.article-live-content h2 {
  font-size: 32px;
}

.article-live-content h3 {
  font-size: 25px;
}

.article-live-content h4 {
  font-size: 21px;
}

.article-live-content h2:first-child,
.article-live-content h3:first-child,
.article-live-content h4:first-child {
  margin-top: 0;
}

.article-live-content p,
.article-live-content li {
  color: var(--app-text);
  line-height: 1.8;
}

.article-live-content p {
  margin: 0 0 18px;
}

.article-live-content ul,
.article-live-content ol {
  margin: 4px 0 24px;
  padding-left: 28px;
}

.article-live-content li + li {
  margin-top: 10px;
}

.article-live-content img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid rgba(20, 37, 61, 0.12);
  margin: 10px auto 24px;
}

.article-live-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin: 22px 0;
  background: rgba(255, 253, 246, 0.98);
}

.article-live-content th,
.article-live-content td {
  border: 1px solid rgba(20, 37, 61, 0.16);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.article-live-content a {
  color: var(--app-blue);
  text-decoration: underline;
}

.article-live-content hr {
  border: 0;
  border-top: 1px solid rgba(20, 37, 61, 0.12);
  margin: 26px 0;
}

.article-detail-footer {
  max-width: 720px;
  margin: 24px auto 0;
  padding-top: 22px;
  border-top: 1px solid rgba(20, 37, 61, 0.12);
}

.article-directory-shell {
  max-width: 760px;
  margin: 0 auto;
}

.article-directory-copy {
  margin: 0 0 18px;
  color: var(--app-text-soft);
  line-height: 1.7;
}

.article-directory-list {
  display: grid;
  gap: 14px;
}

.article-live-content blockquote {
  margin: 22px 0;
  padding: 0 0 0 18px;
  border-left: 3px solid rgba(27, 72, 216, 0.4);
  color: var(--app-text-soft);
}

.article-live-content strong {
  color: var(--app-navy);
}

.detail-links {
  padding-left: 18px;
}

.detail-links li {
  color: var(--app-text-soft);
}

.detail-links a {
  color: var(--app-navy);
  text-decoration: underline;
}

.state-browser-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.state-browser-card {
  width: 100%;
  display: grid;
  gap: 6px;
  text-align: left;
  border: 1px solid rgba(20, 37, 61, 0.16);
  background: linear-gradient(135deg, rgba(25, 120, 46, 0.10), rgba(27, 72, 216, 0.06));
  color: var(--app-navy);
  padding: 14px 16px;
}

.state-browser-card--current {
  border-color: rgba(25, 120, 46, 0.45);
  background: linear-gradient(135deg, rgba(25, 120, 46, 0.18), rgba(25, 120, 46, 0.08));
}

.state-browser-card__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--app-green);
}

.state-browser-card__meta {
  font-size: 13px;
  color: var(--app-text-soft);
}

.inline-actions--state-browser {
  margin-top: 4px;
}

.inline-actions--state-browser .app-btn {
  min-width: 0;
  flex: 1 1 auto;
}

.note-editor {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.quiz-progress {
  margin-bottom: 16px;
}

.quiz-progress__bar {
  width: 100%;
  height: 10px;
  overflow: hidden;
  background: #e7edf6;
  border-radius: 999px;
}

.quiz-progress__bar span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--app-teal), var(--app-navy));
  border-radius: inherit;
}

.quiz-question {
  display: grid;
  gap: 14px;
}

.quiz-options {
  display: grid;
  gap: 10px;
}

.quiz-option {
  width: 100%;
  text-align: left;
  padding: 16px;
  border-radius: 16px;
  border: 2px solid var(--app-navy);
  background: #fffdf6;
}

.quiz-option.selected {
  border-color: var(--app-blue);
  background: rgba(27, 72, 216, 0.35);
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.compare-table th,
.compare-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--app-border);
  text-align: left;
  vertical-align: top;
}

.compare-table th {
  color: var(--app-text-soft);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.app-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: min-content;
  align-items: center;
  gap: 0;
  width: 100%;
  margin: 0;
  padding: 0 env(safe-area-inset-right, 0px) calc(env(safe-area-inset-bottom, 0px)) env(safe-area-inset-left, 0px);
  background: rgba(25, 120, 46, 0.14);
  backdrop-filter: none;
  border-top: 2px solid rgba(25, 120, 46, 0.18);
  box-shadow: none;
  height: auto;
}

.bottom-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #3a9e52;
  border: 0;
  border-radius: 0;
  border-right: 2px solid rgba(255, 253, 246, 0.25);
  color: #fffdf6;
  font-weight: 700;
  padding: 18px 8px;
  min-height: 72px;
  height: 72px;
  white-space: nowrap;
  text-align: center;
}

.bottom-tab:last-child {
  border-right: 0;
}

.bottom-tab.active {
  background: var(--app-yellow);
  color: var(--app-navy);
}

.bottom-tab:active,
.bottom-tab:focus-visible {
  background: rgba(253, 210, 21, 0.24);
  color: var(--app-navy);
}

.empty-state {
  padding: 18px;
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.98);
  border: 2px dashed rgba(20, 37, 61, 0.24);
  color: var(--app-text-soft);
}

@media (max-width: 1100px) {
  .browse-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-dashboard-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "quiz"
      "articles"
      "pbpp"
      "recent";
  }

  .home-panel--pbpp {
    min-height: 300px;
  }

  .hero-card {
    align-items: stretch;
  }
}

@media (max-width: 860px) {
  .card-grid--two,
  .explore-shell,
  .plan-page-grid,
  .plan-template-grid {
    grid-template-columns: 1fr;
  }

  .plan-page-block--template {
    grid-column: auto;
  }

  .hero-card {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .hero-card--dashboard {
    min-height: auto;
    padding: 22px;
  }

  .hero-card__content,
  .feature-band__content {
    max-width: none;
  }

  .hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
  }

  .app-topbar {
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding: 12px 16px 10px;
  }

  .app-topbar__brand {
    min-width: 0;
    flex: 1 1 260px;
  }

  .app-topbar__actions {
    width: auto;
    flex: 0 0 auto;
  }

  .overlay-header,
  .feature-band {
    align-items: stretch;
    flex-direction: column;
  }

  .explore-rail {
    position: static;
    max-height: none;
    overflow: visible;
  }

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

@media (max-width: 640px) {
  .gate-screen,
  .view,
  .overlay {
    padding: 12px;
  }

  .gate-panel,
  .card,
  .overlay-panel {
    padding: 16px;
    border-radius: 14px;
  }

  .gate-panel h1 {
    font-size: clamp(2rem, 8.6vw, 2.8rem);
    max-width: 15ch;
  }

  .gate-copy,
  .helper-copy {
    font-size: 0.97rem;
    line-height: 1.55;
  }

  .app-topbar {
    padding: 10px 12px 8px;
  }

  .app-topbar__brand {
    width: 100%;
    flex: 1 1 100%;
  }

  .app-topbar__actions {
    display: none !important;
  }
  #topPlannerButton {
    display: none !important;
  }

  .app-mode-badge {
    width: 100%;
    text-align: center;
  }

  .view {
    padding-bottom: 104px;
    min-height: calc(100vh - 148px);
  }

  .browse-strip,
  .home-dashboard-grid,
  .hero-stats,
  #progressStages {
    grid-template-columns: 1fr;
  }

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

  .home-dashboard-stack {
    grid-template-rows: auto;
    height: auto;
    gap: 18px;
  }

  .home-panel--pbpp,
  .home-panel--quiz,
  .home-panel--articles,
  .home-panel--recent {
    min-height: auto;
  }

  .browse-card {
    min-height: 138px;
    padding: 16px 14px;
  }

  .explore-panel {
    padding: 16px;
  }

  .section-tabs--explore .section-tab {
    padding: 16px 14px;
    font-size: 1rem;
  }

  .overlay {
    padding: 0;
    place-items: end stretch;
  }

  .overlay-panel,
  .overlay-panel--detail {
    width: 100%;
    max-height: 92vh;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  }

  .article-live-content,
  .article-detail-shell,
  .article-detail-footer,
  .article-directory-shell {
    max-width: none;
  }

  .article-live-content {
    font-size: 16px;
  }

  .article-live-content h2 {
    font-size: 28px;
  }

  .article-live-content h3 {
    font-size: 22px;
  }

  .article-live-content h4 {
    font-size: 19px;
  }

  .app-bottom-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-bottom: calc(env(safe-area-inset-bottom, 0px));
  }

  .bottom-tab {
    min-height: 64px;
    height: 64px;
    padding: 10px 3px;
    font-size: 11px;
    line-height: 1.1;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .bottom-tab[data-view="saved"] {
    font-size: 10.5px;
  }
}
