:root {
    --brand-primary: #047857;
    --brand-primary-dark: #064E3B;
    --brand-secondary: #047857;
    --brand-secondary-dark: #064E3B;
    --brand-accent: #FCD34D;
    --surface: #FFFFFF;
    --surface-muted: #ECFDF3;
    --surface-soft: #F5FFF8;
    --surface-glass: rgba(255, 255, 255, 0.82);
    --border-soft: rgba(100, 116, 139, 0.15);
    --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.08);
    --shadow-strong: 0 32px 60px rgba(4, 120, 87, 0.18);
    --dashboard-sticky-offset: 0px;
    --text-primary: #161C2D;
    --text-secondary: #475467;
    --text-muted: #6B7280;
    --gradient-hero: linear-gradient(135deg, #064E3B, #047857);
    --gradient-card: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(4, 120, 87, 0.16));
    --radius-lg: 26px;
    --radius-md: 20px;
    --radius-sm: 14px;
    /* one page width for every page: navbar, content and footer line up and
       stop growing past this on big screens (founder 2026-10-05) */
    --pf-page-max: 1360px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.22), transparent 40%),
                radial-gradient(circle at 20% 0%, rgba(4, 120, 87, 0.22), transparent 45%),
                var(--surface-soft);
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.7;
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(120deg, rgba(229, 246, 234, 0.75), rgba(255, 255, 255, 0.4));
    pointer-events: none;
    z-index: -2;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--brand-primary);
}

a:hover {
    color: var(--brand-primary-dark);
    text-decoration: none;
}

.text-brand {
    color: var(--brand-primary);
}

strong {
    color: var(--text-primary);
}

/* === TYPOGRAPHY === */
.hero h1,
.hero-title,
h1,
.section-title {
    font-family: 'Manrope', sans-serif;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

h1 { font-size: 2.4rem; font-weight: 700; }
h2 { font-size: 1.9rem; font-weight: 600; color: var(--text-primary); }
h3 { font-size: 1.45rem; font-weight: 600; color: var(--text-primary); }

p,
li { color: var(--text-secondary); }

.lead {
    font-size: 1.12rem;
    color: var(--text-secondary);
}

/* === NAVIGATION === */
header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: transparent;
}

.navbar.site-navbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 1rem 1.5rem;
}

.navbar.site-navbar > .container-fluid,
footer > .container {
    max-width: var(--pf-page-max);
    margin-left: auto;
    margin-right: auto;
}

.navbar.site-navbar .navbar-brand {
    display: flex;
    align-items: center;
    font-weight: 700;
    color: var(--text-primary);
}

.navbar.site-navbar .navbar-brand img {
    height: 40px;
    width: auto;
    transition: transform 0.3s ease;
}

/* Logo (fi wordmark, 2026-10-11): colour version on light, reversed version in dark mode */
.navbar.site-navbar .navbar-brand .logo--dark { display: none; }
html[data-theme="dark"] .navbar.site-navbar .navbar-brand .logo--light { display: none; }
html[data-theme="dark"] .navbar.site-navbar .navbar-brand .logo--dark { display: block; }

@media (max-width: 575.98px) {
    .navbar.site-navbar .navbar-brand img { height: 32px; }
}

.navbar.site-navbar .navbar-brand:hover img {
    transform: translateY(-2px);
}

.navbar.site-navbar .navbar-toggler {
    border: none;
}

.navbar.site-navbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(4,120,87,0.85)' stroke-width='2' stroke-linecap='round' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

.navbar-nav {
    align-items: center;
    gap: 0.6rem;
}

.navbar-nav .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    transition: background 0.3s ease, color 0.3s ease;
}

/* 2026-10-12 (founder: "Don't like how How you compare has a big gap to About"): a label never wraps
   onto two lines (a wrapped item kept its one-line width, leaving a gap); tighter spacing on mid widths */
.navbar-nav .nav-link { white-space: nowrap; }
.navbar.site-navbar .navbar-brand { flex-shrink: 0; }
@media (min-width: 992px) and (max-width: 1279.98px) {
    .navbar-nav { gap: 0.15rem; }
    .navbar-nav .nav-link { padding: 0.4rem 0.5rem; font-size: 0.93rem; }
    .navbar.site-navbar .navbar-brand { margin-right: 0.5rem; }
    .navbar.site-navbar > .container-fluid { padding-left: 1.25rem !important; padding-right: 1.25rem !important; }
}
@media (min-width: 992px) and (max-width: 1099.98px) {
    .navbar.site-navbar #profileMenu > span { display: none; }   /* just the profile icon on the narrowest desktop widths */
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus,
.navbar-nav .nav-link.active {
    background: rgba(16, 185, 129, 0.14);
    color: var(--brand-primary) !important;
}

.navbar .profile-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid rgba(16, 185, 129, 0.45);
    margin-right: 0.4rem;
}

.navbar .dropdown-menu {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
    padding: 0.5rem;
}

.navbar .dropdown-item {
    border-radius: var(--radius-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.navbar .dropdown-item:hover {
    background: rgba(16, 185, 129, 0.12);
    color: var(--brand-secondary-dark);
}

.navbar .login-link {
    color: var(--brand-primary);
    font-weight: 600;
}

.navbar .signup-btn {
    background: var(--brand-primary);
    color: #fff !important;
    padding: 0.55rem 1.3rem;
    border-radius: 999px;
    font-weight: 600;
    box-shadow: 0 15px 30px rgba(4, 120, 87, 0.28);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.navbar .signup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 40px rgba(4, 120, 87, 0.32);
    color: #fff !important;
}

/* Dashboard pills */
.nav-pills .nav-link {
    color: var(--brand-primary) !important;
    border-color: var(--brand-primary);
}

.nav-pills .nav-link:hover,
.nav-pills .nav-link:focus,
.nav-pills .nav-link.active {
    background-color: var(--brand-primary);
    color: #fff !important;
}

/* Forecast category toggles */
.forecast-toggle.active {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

.forecast-toggle.active .badge {
  background-color: rgba(255, 255, 255, 0.22) !important;
  color: #fff !important;
}

.forecast-sort-button {
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font: inherit;
  font-weight: 700;
  padding: 0;
  text-align: left;
}

.forecast-sort-button:hover,
.forecast-sort-button:focus-visible {
  color: var(--brand-primary);
}

.forecast-sort-button:focus-visible {
  outline: 2px solid rgba(40, 167, 69, 0.35);
  outline-offset: 3px;
}

.forecast-sort-indicator {
  display: inline-flex;
  justify-content: center;
  min-width: 0.75rem;
  color: var(--brand-primary);
}
/* === BUTTONS === */
.btn-primary,
.btn-personafi,
.hero-btn {
    background: var(--brand-primary);
    border: none;
    border-radius: 14px;
    padding: 0.85rem 1.6rem;
    font-weight: 600;
    color: #fff !important;
    box-shadow: 0 18px 40px rgba(4, 120, 87, 0.22);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-primary:hover,
.btn-personafi:hover,
.hero-btn:hover {
    background: var(--brand-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 24px 50px rgba(4, 120, 87, 0.28);
    color: #fff !important;
}

.btn-outline-primary {
    color: var(--brand-secondary);
    border: 2px solid rgba(16, 185, 129, 0.35);
    border-radius: 14px;
    font-weight: 600;
    padding: 0.78rem 1.5rem;
    transition: background 0.3s ease, color 0.3s ease;
}

.btn-outline-primary:hover {
    background: #ECFDF5;
    border-color: #A7F3D0;
    color: var(--brand-secondary-dark);
}

.btn-success {
    background: #047857;
    border: none;
    font-weight: 600;
    border-radius: 14px;
}

.btn-success:hover {
    background: #064E3B;
}

/* === GLOBAL LAYOUT === */
.content-wrapper {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    /* keep a gutter either side on screens narrower than the page width */
    max-width: min(var(--pf-page-max), calc(100% - 3rem));
    margin: 40px auto;
    padding: 48px 50px;
}

.content-wrapper.dashboard-shell {
    max-width: min(var(--pf-page-max), 100vw - 0.75rem);
    padding-left: clamp(0.5rem, 1.4vw, 1.25rem);
    padding-right: clamp(0.5rem, 1.4vw, 1.25rem);
}

.content-wrapper > .hero.home-hero {
    margin: -48px -50px 4rem;
    border-radius: var(--radius-lg);
}

@media (max-width: 992px) {
    .content-wrapper {
        max-width: none;
        padding: 36px 26px;
        margin: 30px 16px;
    }

    .content-wrapper.dashboard-shell {
        max-width: 100%;
        padding-left: clamp(0.5rem, 2.8vw, 1.4rem);
        padding-right: clamp(0.5rem, 2.8vw, 1.4rem);
    }

    .content-wrapper > .hero.home-hero {
        margin: -36px -26px 3.5rem;
        border-radius: var(--radius-lg);
    }
}

.alert {
    border-radius: var(--radius-sm);
    border: none;
    padding: 0.85rem 1.1rem;
}

.alert.glass {
    background: rgba(16, 185, 129, 0.08);
    color: var(--text-primary);
}

/* === HERO SECTION === */
.hero {
    position: relative;
    padding: 6rem 0 5rem;
    color: #fff;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--gradient-hero);
    z-index: 0;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.16), transparent 60%);
    opacity: 0.6;
    z-index: 0;
}

.hero .hero-inner {
    position: relative;
    z-index: 1;
    max-width: 1080px;
    margin: 0 auto;
    display: grid;
    gap: 3rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-items: center;
}

.hero.home-hero.dashboard-hero {
    padding: 3.25rem 0 2.75rem;
}

/* the dashboard shell has narrower side padding than other pages: bleed the
   hero only that far, so the page doesn't scroll sideways */
.content-wrapper.dashboard-shell > .hero.home-hero {
    margin-left: calc(-1 * clamp(0.5rem, 1.4vw, 1.25rem));
    margin-right: calc(-1 * clamp(0.5rem, 1.4vw, 1.25rem));
}
@media (max-width: 992px) {
    .content-wrapper.dashboard-shell > .hero.home-hero {
        margin-left: calc(-1 * clamp(0.5rem, 2.8vw, 1.4rem));
        margin-right: calc(-1 * clamp(0.5rem, 2.8vw, 1.4rem));
    }
}

.hero.home-hero.dashboard-hero .hero-inner {
    max-width: 760px;
    gap: 1.25rem;
}

.dashboard-hero__title {
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: clamp(1.75rem, 1.35rem + 1.2vw, 2.25rem);
    letter-spacing: -0.01em;
    color: #fff;
}

.dashboard-hero__subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.78);
    max-width: 640px;
    margin: 0 auto;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.hero-note {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    max-width: 420px;
}

.hero-showcase {
    display: flex;
    justify-content: center;
}

.hero-showcase-card {
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(26px);
    border-radius: var(--radius-md);
    padding: 2.2rem;
    color: #fff;
    box-shadow: 0 28px 55px rgba(15, 23, 42, 0.28);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.hero-showcase-card h3 {
    color: #fff;
    font-size: 1.45rem;
    line-height: 1.35;
}

.hero-showcase-card p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0;
}

.hero-metric-list {
    display: grid;
    gap: 0.8rem;
}

.hero-metric {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
}

.metric-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
}

.metric-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.78);
    text-align: right;
    flex: 1;
}

.hero-progress {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.hero-progress-header {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.78);
    text-transform: uppercase;
}

.hero-progress-bar {
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    overflow: hidden;
}

.hero-progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.92), rgba(16, 185, 129, 0.95));
    box-shadow: 0 12px 25px rgba(16, 185, 129, 0.25);
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
}

.hero h1 {
    font-size: clamp(2.6rem, 4vw, 3.4rem);
    line-height: 1.1;
    color: #fff;
    margin-bottom: 1rem;
}

.hero p.lead {
    color: rgba(255, 255, 255, 0.84);
    font-size: 1.15rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 2rem 0 1.5rem;
}

.hero-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.hero-pill {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    padding: 0.4rem 0.95rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
}

.hero-highlight-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(22px);
    border-radius: var(--radius-md);
    padding: 2rem;
    color: #fff;
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.25);
}

.hero-highlight-card h3 {
    color: #fff;
    font-size: 1.35rem;
}

.hero-highlight-card ul {
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.hero-highlight-card li {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.95rem;
}

.hero-highlight-card li:last-child {
    border-bottom: none;
}

.hero-highlight-card .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 0.35rem;
    background: linear-gradient(135deg, var(--brand-accent), #F97316);
    flex-shrink: 0;
}

/* === SECTIONS === */
section {
    padding: 4.5rem 0;
}

.section-heading {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 3rem;
}

.section-heading h2 {
    margin-bottom: 0.75rem;
}

.section-heading p {
    color: var(--text-muted);
}

.section-muted {
    background: var(--surface-muted);
}

.container-narrow {
    max-width: 960px;
}

.journey-grid {
    display: grid;
    gap: 1.6rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.journey-step {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.journey-step-number {
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--brand-secondary);
}

.journey-step p {
    margin-bottom: 0;
}

.journey-points {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--text-muted);
}

.journey-points li {
    margin-bottom: 0.35rem;
}

.experience-layout {
    display: grid;
    gap: 3rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-items: center;
}

.experience-copy {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.experience-list {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--text-muted);
}

.experience-panel {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2.4rem 2.2rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(148, 163, 184, 0.18);
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.experience-quote {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--brand-primary);
    line-height: 1.6;
}

.experience-panel .insight-pills {
    justify-content: flex-start;
}

/* === FEATURE GRID === */
.feature-grid {
    display: grid;
    gap: 1.6rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.feature-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(16, 185, 129, 0.12);
    position: relative;
    overflow: hidden;
    min-height: 250px;
}

.feature-card::before {
    content: "";
    position: absolute;
    inset: -30% 40% 60% -30%;
    background: var(--gradient-card);
    opacity: 0.8;
    z-index: 0;
    transition: transform 0.6s ease;
}

.feature-card:hover::before {
    transform: translate3d(5%, -5%, 0);
}

.feature-card > * {
    position: relative;
    z-index: 1;
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: rgba(16, 185, 129, 0.12);
    display: grid;
    place-items: center;
    color: var(--brand-primary);
    font-size: 1.4rem;
    margin-bottom: 1.2rem;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.65rem;
}

.feature-card p {
    color: var(--text-muted);
    margin-bottom: 0;
}

/* === INSIGHT CALLOUTS === */
.insight-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 2rem;
    justify-content: center;
}

.insight-pill {
    background: #fff;
    border-radius: 999px;
    padding: 0.65rem 1.1rem;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
    font-weight: 600;
    color: var(--text-secondary);
}

/* === CTA PANEL === */
.cta-panel {
    background: linear-gradient(120deg, rgba(4, 120, 87, 0.94), rgba(16, 185, 129, 0.9));
    border-radius: var(--radius-lg);
    padding: 3.8rem 3.2rem;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-strong);
}

.cta-panel::after {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 70%);
    top: -120px;
    right: -60px;
}

.cta-panel h2 {
    color: #fff;
    font-size: clamp(2rem, 4vw, 2.7rem);
    margin-bottom: 1rem;
}

.cta-panel p {
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.1rem;
    margin-bottom: 1.8rem;
}

.cta-panel .btn-outline-primary {
    border-color: rgba(255, 255, 255, 0.55);
    color: #fff;
}

.cta-panel .btn-outline-primary:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* === ABOUT & CONTENT STYLING === */
.about-content ul,
.about-content ol,
.profile-info {
    padding-left: 1.4rem;
    color: var(--text-secondary);
}

.about-content hr {
    border: none;
    border-top: 1px solid rgba(16, 185, 129, 0.2);
    margin: 2.5rem 0;
}

.quote {
    font-size: 1.4rem;
    font-weight: 600;
    font-family: 'Manrope', sans-serif;
    color: var(--brand-primary);
    text-align: center;
}

/* === INSIGHTS FORM & COMPONENTS === */
.insights-generator {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.insights-generator label {
    font-weight: 600;
    color: var(--text-primary);
}

#insight-result {
    background: var(--surface-muted);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid rgba(16, 185, 129, 0.18);
}

#loading-spinner,
#loading-audio {
    color: var(--brand-primary);
}

/* === FORM ELEMENTS === */
.form-control {
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    padding: 0.75rem 1rem;
}

.auth-card select.form-control {
    min-height: 3.1rem;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
    line-height: 1.3;
}

.form-control:focus {
    border-color: rgba(4, 120, 87, 0.4);
    box-shadow: 0 0 0 0.25rem rgba(16, 185, 129, 0.18);
}

/* === AUTHENTICATION === */
.auth-wrapper {
    display: flex;
    justify-content: center;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    max-width: 100%;
    margin: 0 auto;
    padding: clamp(4rem, 6vw, 6.5rem) 1.5rem clamp(3.5rem, 6vw, 5.5rem);
}

.auth-section {
    width: 100%;
    max-width: 560px;
}

.auth-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: clamp(2.6rem, 5vw, 3.5rem) clamp(2.2rem, 5vw, 3.4rem);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(16, 185, 129, 0.16);
}

.login-card {
    background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.12), transparent 65%), var(--surface);
}

.login-header {
    text-align: center;
    margin-bottom: 2.2rem;
}

.login-eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--brand-primary);
    background: rgba(16, 185, 129, 0.12);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    margin-bottom: 1rem;
}

.login-header h2 {
    margin-bottom: 0.65rem;
}

.login-subtitle {
    color: var(--text-secondary);
    max-width: 420px;
    margin: 0 auto;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-bottom: 0;
}

.auth-form label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.auth-form .required-indicator {
    color: var(--brand-primary);
    font-weight: 700;
}

.form-label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.form-label-action {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--brand-primary);
}

.form-label-action:hover,
.form-label-action:focus {
    color: var(--brand-primary-dark);
}

@media (max-width: 575.98px) {
    .form-label-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .form-label-action {
        padding-left: 0;
    }
}

.auth-card .form-control {
    background: var(--surface-soft);
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-card .form-control:focus {
    background: #fff;
    border-color: rgba(4, 120, 87, 0.45);
}

.login-submit {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.85rem 1.2rem;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 999px;
    box-shadow: 0 20px 38px rgba(4, 120, 87, 0.22);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.login-submit:hover,
.login-submit:focus {
    transform: translateY(-1px);
    box-shadow: 0 26px 48px rgba(4, 120, 87, 0.26);
}

.auth-card-footer {
    margin-top: 2rem;
    text-align: center;
}

.signup-card {
    max-width: 840px;
    margin: 0 auto;
    padding: 3.5rem 3.4rem;
    background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.08), transparent 60%), var(--surface);
}

@media (max-width: 767.98px) {
    .signup-card {
        padding: 2.4rem 1.75rem;
    }
}

.signup-header {
    margin-bottom: 2.5rem;
}

.signup-eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--brand-primary);
    background: rgba(16, 185, 129, 0.12);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    margin-bottom: 1rem;
}

.signup-header h2 {
    margin-bottom: 0.65rem;
}

.signup-subtitle {
    max-width: 520px;
    margin: 0 auto;
    color: var(--text-secondary);
}

.signup-section + .signup-section {
    margin-top: 2.5rem;
    padding-top: 2.1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.signup-section-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.signup-section-helper {
    margin-top: -0.4rem;
    margin-bottom: 1.3rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.signup-grid {
    display: grid;
    gap: 1.35rem;
}

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

@media (min-width: 768px) {
    .signup-grid.two-column {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.signup-grid .full-width {
    grid-column: 1 / -1;
}

.signup-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0;
}

.signup-form label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.signup-form .required-indicator {
    color: var(--brand-primary);
    font-weight: 700;
}

.signup-form .form-control {
    background: var(--surface-soft);
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.signup-form .form-control:focus {
    background: #fff;
    border-color: rgba(4, 120, 87, 0.45);
    box-shadow: 0 0 0 0.25rem rgba(16, 185, 129, 0.18);
}

.form-note {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-footer {
    margin-top: 2.4rem;
    text-align: center;
}

.signup-submit {
    padding: 0.85rem 1.2rem;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 999px;
    box-shadow: 0 20px 38px rgba(4, 120, 87, 0.22);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.signup-submit:hover,
.signup-submit:focus {
    transform: translateY(-1px);
    box-shadow: 0 26px 48px rgba(4, 120, 87, 0.26);
}

.login-cta {
    margin-top: 1.4rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.login-cta a {
    font-weight: 600;
}

.signup-card {
    max-width: 840px;
    margin: 0 auto;
    padding: 3.5rem 3.4rem;
    background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.08), transparent 60%), var(--surface);
}

@media (max-width: 767.98px) {
    .signup-card {
        padding: 2.4rem 1.75rem;
    }
}

.signup-header {
    margin-bottom: 2.5rem;
}

.signup-eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--brand-primary);
    background: rgba(16, 185, 129, 0.12);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    margin-bottom: 1rem;
}

.signup-header h2 {
    margin-bottom: 0.65rem;
}

.signup-subtitle {
    max-width: 520px;
    margin: 0 auto;
    color: var(--text-secondary);
}

.signup-section + .signup-section {
    margin-top: 2.5rem;
    padding-top: 2.1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.signup-section-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.signup-section-helper {
    margin-top: -0.4rem;
    margin-bottom: 1.3rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.signup-grid {
    display: grid;
    gap: 1.35rem;
}

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

@media (min-width: 768px) {
    .signup-grid.two-column {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.signup-grid .full-width {
    grid-column: 1 / -1;
}

.signup-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0;
}

.signup-form label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.signup-form .required-indicator {
    color: var(--brand-primary);
    font-weight: 700;
}

.signup-form .form-control {
    background: var(--surface-soft);
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.signup-form .form-control:focus {
    background: #fff;
    border-color: rgba(4, 120, 87, 0.45);
    box-shadow: 0 0 0 0.25rem rgba(16, 185, 129, 0.18);
}

.form-note {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-footer {
    margin-top: 2.4rem;
    text-align: center;
}

.signup-submit {
    padding: 0.85rem 1.2rem;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 999px;
    box-shadow: 0 20px 38px rgba(4, 120, 87, 0.22);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.signup-submit:hover,
.signup-submit:focus {
    transform: translateY(-1px);
    box-shadow: 0 26px 48px rgba(4, 120, 87, 0.26);
}

.login-cta {
    margin-top: 1.4rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.login-cta a {
    font-weight: 600;
}

/* === PROFILE === */
.profile-hero,
.features-hero,
.about-hero,
.insights-hero,
.hero.home-hero {
    position: relative;
    padding: 5rem 0 4rem;
}

.profile-hero::before,
.features-hero::before,
.about-hero::before,
.insights-hero::before,
.hero.home-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--gradient-hero);
    opacity: 0.96;
}

.profile-hero .hero-inner,
.features-hero .hero-inner,
.about-hero .hero-inner,
.insights-hero .hero-inner,
.hero.home-hero .hero-inner {
    position: relative;
    z-index: 1;
}

.profile-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2.2rem;
    box-shadow: var(--shadow-soft);
}

.profile-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 4px solid rgba(16, 185, 129, 0.35);
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.12);
}

.profile-info li {
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    padding: 0.75rem 0;
}

.profile-actions .btn {
    margin: 0.35rem;
}

/* === DASHBOARD === */
.nav-tabs {
    border-bottom: 1px solid rgba(16, 185, 129, 0.16);
    gap: 0.4rem;
}

.nav-tabs .nav-link {
    border-radius: 999px 999px 0 0;
    border: none;
    padding: 0.7rem 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.nav-tabs .nav-link.active {
    background: rgba(16, 185, 129, 0.16);
    color: var(--brand-primary);
}

.dashboard-tabs-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dashboard-tabs-nav {
    min-width: 0;
}

.dashboard-tabs-nav .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
    border-bottom: 1px solid rgba(16, 185, 129, 0.16);
    padding-bottom: 0.35rem;
    gap: 0.4rem;
}

.dashboard-tabs-nav .nav-tabs::-webkit-scrollbar {
    height: 6px;
}

.dashboard-tabs-nav .nav-tabs::-webkit-scrollbar-thumb {
    background: rgba(4, 120, 87, 0.25);
    border-radius: 999px;
}

.dashboard-tabs-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dashboard-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    border: 1px solid rgba(16, 185, 129, 0.42);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(4, 120, 87, 0.1));
    color: var(--brand-primary);
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 12px 28px rgba(16, 185, 129, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    cursor: pointer;
}

.dashboard-refresh-btn:hover:not(:disabled),
.dashboard-refresh-btn:focus-visible:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 18px 32px rgba(16, 185, 129, 0.28);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.26), rgba(4, 120, 87, 0.16));
    color: var(--brand-primary);
    outline: none;
}

.dashboard-refresh-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.dashboard-refresh-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 6px 20px rgba(148, 163, 184, 0.18);
}

.dashboard-refresh-btn.is-refreshing {
    cursor: progress;
}

.dashboard-refresh-icon {
    width: 1.25rem;
    height: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.18);
    color: var(--brand-primary);
    font-weight: 700;
    font-size: 0.95rem;
    transition: transform 0.3s ease;
}

.dashboard-refresh-btn.is-refreshing .dashboard-refresh-icon {
    animation: dashboardRefreshSpin 0.9s linear infinite;
}

@keyframes dashboardRefreshSpin {
    to {
        transform: rotate(1turn);
    }
}

.dashboard-tabs-feedback {
    min-width: 14rem;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: color 0.2s ease;
}

.dashboard-tabs-feedback:empty {
    display: none;
}

.dashboard-tabs-feedback[data-variant="info"] {
    color: var(--text-muted);
}

.dashboard-tabs-feedback[data-variant="success"] {
    color: var(--brand-primary);
}

.dashboard-tabs-feedback[data-variant="error"] {
    color: #dc2626;
}

.dashboard-tabs-dropdown {
    position: relative;
}

.dashboard-tabs-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: clamp(12.5rem, 28vw, 18rem);
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.08);
    color: var(--text-secondary);
    padding: 0.85rem 1.5rem;
    font-weight: 600;
    text-transform: none;
    box-shadow: none;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-tabs-toggle:hover,
.dashboard-tabs-dropdown.show .dashboard-tabs-toggle {
    background: rgba(16, 185, 129, 0.18);
    color: var(--brand-primary);
    box-shadow: var(--shadow-soft);
}

.dashboard-tabs-toggle:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

.dashboard-tabs-label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    text-align: left;
}

.dashboard-tabs-title {
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.dashboard-tabs-active-label {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.dashboard-tabs-caret {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid currentColor;
    transition: transform 0.2s ease;
}

.dashboard-tabs-dropdown.show .dashboard-tabs-caret {
    transform: rotate(180deg);
}

.dashboard-tabs-menu {
    min-width: clamp(14rem, 32vw, 20rem);
    padding: 0.35rem 0;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: var(--shadow-soft);
    margin-top: 0.5rem;
    background: var(--surface);
    z-index: 20;
}

.dashboard-tabs-menu .nav-link {
    border-radius: 0;
    width: 100%;
    text-align: left;
    padding: 0.65rem 1.15rem;
    color: var(--text-secondary);
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.dashboard-tabs-menu .nav-link:hover,
.dashboard-tabs-menu .nav-link:focus-visible {
    background: rgba(16, 185, 129, 0.12);
    color: var(--brand-primary);
    outline: none;
}

.dashboard-tabs-menu .nav-link.active {
    background: rgba(16, 185, 129, 0.16);
    color: var(--brand-primary);
}

@media (max-width: 768px) {
    .dashboard-tabs-toggle {
        min-width: clamp(10rem, 60vw, 16rem);
    }
}

@media (max-width: 576px) {
    .dashboard-tabs-nav {
        border-bottom: none;
        padding-bottom: 0;
    }

    .dashboard-tabs-dropdown {
        width: 100%;
    }

    .dashboard-tabs-toggle {
        width: 100%;
        border-radius: var(--radius-md);
        padding: 0.9rem 1.25rem;
    }

    .dashboard-tabs-menu {
        position: static;
        width: 100%;
        margin-top: 0.75rem;
        box-shadow: none;
    }
}

.tab-content {
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
    box-shadow: var(--shadow-soft);
    background: var(--surface);
}

/* === FOOTER === */
footer {
    background: rgba(15, 23, 42, 0.92);
    color: rgba(255, 255, 255, 0.88);
    padding: 2.5rem 0;
    margin-top: 4rem;
}

footer a {
    color: #fff;
    font-weight: 600;
}

footer a:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* === UTILITIES === */
.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.12);
    color: var(--brand-primary);
    border-radius: 999px;
    padding: 0.55rem 0.95rem;
    font-weight: 600;
    font-size: 0.85rem;
}

.shadow-soft {
    box-shadow: var(--shadow-soft);
}

/* === MEDIA QUERIES === */
@media (max-width: 992px) {
    .navbar.site-navbar {
        border-radius: 0;
    }

    .navbar-nav {
        align-items: flex-start;
        padding-top: 1rem;
    }

    .navbar-nav .nav-link {
        padding: 0.65rem 0.95rem;
        width: 100%;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .experience-panel .insight-pills {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    section { padding: 3.5rem 0; }

    .hero-showcase-card {
        padding: 2rem;
    }

    .hero-metric {
        flex-direction: column;
        align-items: flex-start;
    }

    .metric-label {
        text-align: left;
    }

    .experience-panel {
        padding: 2rem 1.8rem;
    }
}

@media (max-width: 576px) {
    .content-wrapper {
        margin: 24px 12px;
        padding: 28px 20px;
    }

    .content-wrapper > .hero.home-hero {
        margin: -28px -20px 3rem;
        border-radius: var(--radius-lg);
    }

    .hero {
        padding: 5rem 0 4rem;
    }

    .journey-step {
        padding: 1.8rem;
    }
}

/* Wider frame for the Full Year View */
.wide-container {
  width: min(2600px, 100vw - 0.5rem);  /* Give the dashboard more breathing room without running edge-to-edge */
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(0.5rem, 1.4vw, 1.25rem);
  padding-right: clamp(0.5rem, 1.4vw, 1.25rem);
}

.wide-container #dashboardTabsContent {
  padding-left: clamp(0.4rem, 1.2vw, 1.25rem);
  padding-right: clamp(0.4rem, 1.2vw, 1.25rem);
}

@media (min-width: 1600px) {
  .wide-container {
    width: min(3200px, 100vw - 0.75rem);
  }

  .wide-container #dashboardTabsContent {
    padding-left: clamp(0.4rem, 0.9vw, 1.1rem);
    padding-right: clamp(0.4rem, 0.9vw, 1.1rem);
  }
}

/* Numeric legibility */
.num {
  font-variant-numeric: tabular-nums; /* aligns digits vertically */
  white-space: nowrap;                /* keeps $ and number together */
}

/* Red negatives (Bootstrap's .text-danger tone, but works without BS too) */
.neg { color: #dc3545; }
.pos { color: inherit; }

/* Make the wide table pleasant to scroll */
.table-responsive {
  overflow-x: auto;
}

/* Dashboard data table styling */
.report-table {
  width: 100%;
  margin-bottom: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  font-size: 0.8rem;
}

.report-table thead th {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
  color: #fff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.68rem;
  border-bottom: none;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.report-table thead .month-status-cell {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.report-table td,
.report-table th {
  padding: 0.45rem 0.75rem;
  vertical-align: middle;
  border: none;
}

.report-table tbody tr {
  --row-bg-color: #ffffff;
  background-color: var(--row-bg-color);
}

.report-table tbody tr:nth-of-type(odd) {
  --row-bg-color: #f6fdf9;
}

.report-table tbody tr:nth-of-type(even) {
  --row-bg-color: #fafcfc;
}

/* Full Year View table enhancements */
.full-year-table-wrapper {
  position: relative;
  max-height: min(75vh, 900px);
  overflow: auto;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.full-year-table {
  min-width: 960px;
}

.full-year-table thead th {
  position: sticky;
  top: 0;
  z-index: 6;
  background-color: #fff;
  --sticky-header-bg: #fff;
}

.full-year-table thead tr.month-status-row th {
  background-color: #f8fafc;
  --sticky-header-bg: #f8fafc;
  z-index: 5;
}

.full-year-table thead tr.month-status-row th.report-table__total-col {
  background-color: #e5e7eb;
}

.full-year-table tbody td.report-table__total-col,
.full-year-table tfoot td.report-table__total-col {
  background-color: #f1f5f9;
  font-weight: 600;
}

.full-year-table tbody td.report-table__total-col .num,
.full-year-table tfoot td.report-table__total-col .num {
  font-weight: 600;
}

.full-year-table thead th.report-table__total-col {
  font-weight: 700;
}

.full-year-table thead th[data-col-key="section"],
.full-year-table tbody td[data-col-key="section"],
.full-year-table thead th[data-col-key="category"],
.full-year-table tbody td[data-col-key="category"],
.full-year-table thead th[data-col-key="line_item"],
.full-year-table tbody td[data-col-key="line_item"] {
  position: sticky;
  z-index: 4;
}

.full-year-table thead th[data-col-key="section"],
.full-year-table thead th[data-col-key="category"],
.full-year-table thead th[data-col-key="line_item"] {
  background-color: var(--sticky-header-bg, #fff);
  z-index: 9;
}

.full-year-table tbody td[data-col-key="section"],
.full-year-table tbody td[data-col-key="category"],
.full-year-table tbody td[data-col-key="line_item"] {
  background-color: inherit;
}

.full-year-table [data-col-key="section"] {
  left: var(--sticky-left-section, 0px);
}

.full-year-table [data-col-key="category"] {
  left: var(--sticky-left-category, 0px);
}

.full-year-table [data-col-key="line_item"] {
  left: var(--sticky-left-line_item, 0px);
}

.full-year-table [data-col-key="category"],
.full-year-table [data-col-key="line_item"] {
  box-shadow: 2px 0 0 rgba(15, 23, 42, 0.08);
}

.full-year-table thead th[data-col-key="category"],
.full-year-table thead th[data-col-key="line_item"] {
  box-shadow: 2px 0 0 rgba(15, 23, 42, 0.12);
}

.cashflow-table thead tr.month-status-row th {
  background: #ffffff;
  color: #0f172a;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cashflow-table thead tr.month-status-row th.report-table__total-col {
  background-color: #e5e7eb;
  font-weight: 700;
}

.report-table tbody tr:hover {
  background: rgba(4, 120, 87, 0.08);
}

.report-table td.line-item-clickable {
  cursor: pointer;
  text-decoration: underline dotted transparent;
  transition: background-color 0.2s ease, text-decoration-color 0.2s ease;
}

.report-table td.line-item-clickable:hover,
.report-table tr.transactions-open td.line-item-clickable,
.report-table tr.forecast-open td.line-item-clickable {
  text-decoration-color: currentColor;
  background-color: rgba(4, 120, 87, 0.12) !important;
}

.report-table__summary-row td {
  font-weight: 600;
  border-top: 2px solid rgba(4, 120, 87, 0.25);
}

.report-table__summary-row td:first-child {
  color: var(--brand-primary);
}

.report-table__balance-row td {
  background-color: #1f2937; /* dark blue-grey background */
  color: #000000; /* black text */
}

.report-table__balance-row td:first-child {
  color: #000000; /* black text for first column */
}

.report-table__balance-row td .num:not(.neg) {
  color: #000000; /* black text for positive numbers */
}

.report-table__balance-row td.line-item-clickable:hover,
.report-table__balance-row.transactions-open td.line-item-clickable {
  background-color: #1f2937 !important; /* same dark background on hover */
}


.report-table__net-row .num.pos {
  color: #047857;
}

.report-table__section-spacer td {
  padding: 0.35rem 0;
  border: none;
  background: transparent !important;
}

.report-table__section-heading td {
  border: none;
  background: transparent !important;
  padding-top: 0.9rem;
  padding-bottom: 0.25rem;
}

.report-table__section-heading td:first-child {
  padding-right: 0;
}

.report-table__section-heading .section-heading-label {
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: var(--brand-primary-dark, var(--brand-primary));
}

.report-table td.month-act,
.report-table th.month-act {
  background-color: #f3f4f6 !important;
  color: var(--text-primary, #0f172a);
}

.report-table th.month-cur {
  background: linear-gradient(135deg, #a3e635, #65a30d) !important;
  color: #1a2e05;
}

.report-table td.month-cur {
  background-color: rgba(163, 230, 53, 0.18) !important;
  color: #3f6212;
}

.transaction-detail-row td {
  background: #eff6ff !important;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.transaction-detail-row__content {
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border-radius: 0.75rem;
}

.forecast-detail-row td {
  background: #eff6ff !important;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.forecast-detail-row__content {
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border-radius: 0.75rem;
}

.forecast-detail-row__header {
  background: transparent;
  border-radius: 0.65rem;
  padding: 0.5rem 0.85rem;
}

.forecast-detail-row__header strong {
  font-size: 0.85rem;
}

.forecast-detail-row__body {
  padding: 0 1rem 1rem;
}

.forecast-detail-row__body p {
  color: #374151;
}

.forecast-detail-table-wrapper {
  overflow-x: auto;
}

.forecast-detail-table {
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: #1f2937;
}

.forecast-detail-table thead th {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f9fafb;
  border-bottom: 1px solid rgba(17, 24, 39, 0.35);
  background: #374151;
  padding: 0.5rem 0.75rem;
}

.forecast-detail-table tbody td {
  font-size: 0.78rem;
  padding: 0.6rem 0.75rem;
  vertical-align: middle;
  border-top: none;
  border-bottom: 1px dashed rgba(15, 23, 42, 0.12);
  color: #0f172a;
}

.forecast-detail-table__cell {
  position: relative;
}

.forecast-detail-table__cell--method .forecast-detail-method-group {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.forecast-detail-table__cell--method .forecast-detail-value--editable {
  width: auto;
  flex: 1 1 auto;
}

.forecast-detail-table__cell--method .forecast-detail-input {
  min-width: 0;
}

.forecast-detail-value {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: inherit;
}

.forecast-detail-value--forecast-amount {
  font-weight: 700;
}

.forecast-detail-value--forecast-amount .forecast-detail-input {
  font-weight: 700;
}

.forecast-detail-value--forecast-amount .forecast-detail-input--disabled {
  opacity: 1;
}

.forecast-detail-value--muted {
  color: #64748b;
  opacity: 0.85;
}

.forecast-detail-table__row--active {
  background: rgba(4, 120, 87, 0.08);
  font-weight: 600;
  color: #1f2937;
}

.forecast-detail-table__row--base {
  background: rgba(148, 163, 184, 0.15);
  color: #1f2937;
}

.forecast-detail-table__row--base .forecast-detail-value {
  opacity: 0.95;
}

.forecast-detail-value--editable {
  width: 100%;
}

.forecast-detail-input {
  min-width: 7.5rem;
  font-size: 0.8rem;
}

input.forecast-detail-input,
select.forecast-detail-input {
  min-width: 9rem;
}

input.forecast-detail-input[type='number'] {
  min-width: 6.5rem;
  max-width: 8rem;
}

.forecast-detail-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.forecast-detail-input--disabled {
  opacity: 0.65;
}

.forecast-detail-input:disabled {
  cursor: not-allowed;
}

.forecast-detail-switch .form-check-input {
  width: 2.4rem;
  height: 1.2rem;
  margin-top: 0;
}

.forecast-detail-switch__label {
  margin-left: 0.15rem;
}

.forecast-detail-table__row--active .forecast-detail-table__cell:nth-child(6) {
  text-align: center;
}

.forecast-detail-table__row--active .forecast-detail-switch {
  justify-content: center;
  width: 100%;
}

.forecast-detail-table__row--active .forecast-detail-switch__label {
  color: transparent;
}

.forecast-detail-table__row--empty .forecast-detail-value {
  color: #6b7280;
  font-style: italic;
}

.forecast-detail-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.6rem;
  margin-right: 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 999px;
}

.forecast-detail-badge--active {
  background: #047857;
  color: #ecfdf5;
}

.forecast-detail-badge--base {
  background: rgba(15, 23, 42, 0.15);
  color: #0f172a;
}

/* one-month change editor (Cash forecast), calmer layout 2026-10-07 */
.forecast-detail--oneoff .forecast-detail-row__header strong { font-size: 0.95rem; }
.forecast-detail--oneoff .forecast-detail-table thead { display: none; }
.forecast-detail--oneoff .forecast-detail-table-wrapper { overflow: visible; }
.forecast-detail--oneoff .forecast-detail-table { min-width: 0; width: auto; }
.forecast-detail--oneoff .forecast-detail-table tbody td { border-bottom: none; padding: 0.25rem 0; }
.forecast-detail--oneoff .forecast-detail-table__row--active { background: transparent; }
.forecast-detail--oneoff .forecast-detail-table tr,
.forecast-detail--oneoff .forecast-detail-table td { background: transparent !important; border-right: none !important; box-shadow: none !important; }
.forecast-oneoff__intro { font-size: 0.8rem; color: #475569; margin: 0 0 0.6rem; }
.forecast-oneoff__label { font-size: 0.8rem; font-weight: 600; color: #334155; margin-right: 0.25rem; }
.forecast-detail--oneoff .forecast-detail-input[data-field="forecast_amount"] { font-size: 1rem; max-width: 11rem; }
.forecast-oneoff__facts { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; font-size: 0.75rem; color: #64748b; margin: 0.35rem 0 0.75rem; }
.forecast-oneoff__tag { background: #fef3c7; color: #92400e; border-radius: 999px; padding: 0 0.5rem; font-weight: 600; }
/* months changed for that month only, in the Cash forecast table */
td[data-forecast-method*="ONE_OFF_CHANGE"] { position: relative; }
td[data-forecast-method*="ONE_OFF_CHANGE"]::after {
  content: ""; position: absolute; top: 4px; right: 4px; width: 6px; height: 6px;
  border-radius: 50%; background: #d97706;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .forecast-oneoff__intro,
  :root:not([data-theme="light"]) .forecast-oneoff__label { color: #cbd5e1; }
}
:root[data-theme="dark"] .forecast-oneoff__intro,
:root[data-theme="dark"] .forecast-oneoff__label { color: #cbd5e1; }

/* Set forecast: add a line */
.pf-addline { border: 1px solid rgba(15, 23, 42, 0.12); border-radius: 0.75rem; padding: 0.85rem 1rem; margin-bottom: 1rem; }
.pf-addline__title { font-weight: 600; margin-bottom: 0.15rem; }
.pf-addline__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.6rem 0.85rem; }
.pf-addline__field { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.75rem; color: #64748b; margin: 0; }
.pf-addline__hint { margin-top: 0.4rem; }
.pf-fs-after select { min-width: 0; }
.forecast-row.pf-fs-flash > td { background: #fef9c3 !important; transition: background 0.3s; }

.forecast-detail-note {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: #64748b;
}

.forecast-detail-note--empty {
  text-align: center;
  font-size: 0.8rem;
  margin-top: 0.75rem;
}

.forecast-editor-form {
  background: rgba(209, 250, 229, 0.55);
  border-radius: 0.75rem;
  padding: 0.6rem 0.85rem;
}

.forecast-editor-grid {
  display: grid;
  gap: 0.5rem 0.65rem;
}

@media (min-width: 768px) {
  .forecast-editor-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
  }
}

.forecast-editor-grid .form-label {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: #047857;
}

.forecast-editor-grid .form-select,
.forecast-editor-grid .form-control {
  font-size: 0.85rem;
}

.forecast-editor-grid .form-control.is-readonly,
.forecast-editor-grid .form-control[readonly] {
  background-color: rgba(236, 253, 245, 0.85);
  border-color: rgba(16, 185, 129, 0.65);
  color: #047857;
}

.forecast-editor-grid .form-select.is-disabled,
.forecast-editor-grid .form-control.is-disabled {
  background-color: #f1f5f9;
  border-color: #cbd5f5;
  color: #6b7280;
  cursor: not-allowed;
}

.forecast-editor-grid .form-label.is-disabled {
  color: #6b7280;
}

.forecast-editor-grid .is-disabled {
  opacity: 0.7;
}

.forecast-editor-frequency-custom {
  display: none;
  gap: 0.5rem;
  align-items: center;
}

.forecast-editor-frequency-custom input {
  max-width: 5rem;
  text-align: center;
}

.forecast-editor-frequency-custom select {
  text-align: center;
  text-align-last: center;
}

.forecast-editor-actions {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.forecast-editor-actions .btn {
  padding: 0.3rem 0.85rem;
  line-height: 1.2;
}

.forecast-editor-summary {
  color: #047857;
}

.transaction-detail-row__header {
background: transparent;

  border-radius: 0.65rem;
  padding: 0.5rem 0.85rem;
}

.transaction-detail-row__header strong {
  font-size: 0.85rem;
}

.transaction-detail-row__title {
  gap: 0.35rem;
}

.transaction-detail-row__title .text-muted {
  font-size: 0.75rem;
}

.transaction-detail-table thead th {
  background: #374151;
  color: #f9fafb;
}

.transaction-detail-table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #1f2937;
}

.transaction-detail-table td {
  font-size: 0.78rem;
}

.transaction-detail-table .transaction-category-cell {
  font-size: 0.72rem;
}

.transaction-detail-table tbody tr:hover {
  background: rgba(4, 120, 87, 0.08);
}

.transaction-category-select {
  min-width: 100%;
}

.transaction-detail-table .transaction-scope-select {
  min-width: 8.5rem;
}

.transaction-detail-table .transaction-apply-column,
.transaction-detail-table .transaction-apply-cell {
  white-space: nowrap;
}

.transaction-detail-table .transaction-override-apply {
  white-space: nowrap;
  min-width: 4.5rem;
  padding: 0.125rem 0.5rem;
  line-height: 1.1;
}

.transaction-detail-table .transaction-override-apply:disabled {
  opacity: 0.7;
}

@media (max-width: 576px) {
  .transaction-detail-table .transaction-scope-select,
  .transaction-detail-table .transaction-apply-cell .transaction-override-apply {
    width: 100%;
  }
}

.report-table__major-heading.section-transfers .section-heading-label {
  color: #000;
}

.table-footnote {
  margin-top: 0.5rem;
  color: var(--text-muted);
}

.rules-status {
  font-size: 0.85rem;
}

.rules-table th {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

.rules-table thead th {
  background: var(--brand-primary, #047857);
  color: #ffffff;
  border-color: var(--brand-primary, #047857);
}

.rules-table thead th:first-child {
  border-top-left-radius: 0.25rem;
}

.rules-table thead th:last-child {
  border-top-right-radius: 0.25rem;
}

.rules-table td {
  font-size: 0.85rem;
  vertical-align: middle;
}

.rules-table td .btn + .btn {
  margin-left: 0.35rem;
}

.rule-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1055;
}

.rule-modal[data-visible="1"] {
  display: flex;
}

.rule-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.rule-modal__dialog {
  position: relative;
  width: min(640px, calc(100% - 2rem));
  max-height: calc(100% - 3rem);
  background: #ffffff;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
}

.rule-modal__form {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.rule-modal__header,
.rule-modal__footer {
  padding: 1rem 1.5rem;
  background: #f8fafc;
}

.rule-modal__header {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.rule-modal__title {
  font-size: 1.05rem;
  margin-bottom: 0;
}

.rule-modal__body {
  padding: 1rem 1.5rem;
  overflow-y: auto;
}

.rule-modal__summary {
  background: rgba(59, 130, 246, 0.08);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
}

.rule-modal__constraints .form-check {
  margin-bottom: 0.35rem;
}

.rule-modal__amount-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.rule-modal__amount-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.rule-modal__amount-input {
  max-width: 8rem;
}

.rule-modal__amount-separator {
  font-size: 0.875rem;
}

.rule-modal__feedback {
  margin: 0 1.5rem;
}

.rule-modal__footer {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.rule-modal__close {
  font-size: 1.5rem;
  font-weight: 400;
  color: #0f172a;
  opacity: 0.6;
}

.rule-modal__close:hover {
  opacity: 1;
}

.rule-modal-open {
  overflow: hidden;
}

@media (max-width: 576px) {
  .rule-modal__dialog {
    width: calc(100% - 1rem);
    max-height: calc(100% - 2rem);
  }

  .rule-modal__body,
  .rule-modal__header,
  .rule-modal__footer {
    padding: 0.85rem 1rem;
  }
}

/* === BUDGET TAB HEADER OVERRIDES (put at the very end) === */
:root {
  --budget-header-bg: #064E3B;  /* dark green */
  --budget-header-fg: #ffffff;  /* white */
}

/* Catch ALL header rows/cells, including sticky + status rows */
#dashboardTabsContent #budget table thead,
#dashboardTabsContent #budget table thead tr,
#dashboardTabsContent #budget table thead th {
  background: var(--budget-header-bg) !important;
  color: var(--budget-header-fg) !important;
}

/* If your table has these classes, be extra explicit */
#dashboardTabsContent #budget .report-table.full-year-table thead th,
#dashboardTabsContent #budget .report-table.full-year-table thead tr.month-status-row th {
  background: var(--budget-header-bg) !important;
  color: var(--budget-header-fg) !important;
}

/* Ensure sticky headers use the same colour */
#dashboardTabsContent #budget .full-year-table thead th {
  --sticky-header-bg: var(--budget-header-bg);
}

/* Nuke any gradient previously set on report-table headers */
#dashboardTabsContent #budget .report-table thead th {
  background-image: none !important;
}

/* No dashboard banner (founder 2026-10-04: it took too much of the page).
   Overview keeps a small greeting; the shell's top padding shrinks to match. */
.content-wrapper.dashboard-shell {
    margin-top: 1.25rem;
    padding-top: 1rem;
}
.pf-greeting {
    margin: 0 0 0.25rem;
    padding-left: 1.5rem;
    font-family: 'Manrope', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--pf-brand, #047857);
}
@media (max-width: 992px) {
    .content-wrapper.dashboard-shell { margin-top: 0.75rem; }
    .pf-greeting { padding-left: 0.5rem; }
}

/* One card per dashboard page (founder 2026-10-05: "a block behind a block").
   The page card (main) takes the panel colour; the tab container and each
   tab's top-level .pf-ui panel no longer draw their own background, border,
   shadow or padding. Cards inside the panel (e.g. "Cash forecast") stay. */
html[data-theme] main.content-wrapper.dashboard-shell {
    background: #ECFDF3;
    padding: 1.5rem 1.75rem 2rem;
}
html[data-theme="dark"] main.content-wrapper.dashboard-shell { background: var(--d-canvas, #0D1915); }
html[data-theme] #dashboardTabsContent {
    background: transparent;
    border: 0 !important;
    border-radius: 0;
    box-shadow: none;
    padding: 0 !important;
}
html[data-theme] #dashboardTabsContent .pf-ui:not(.pf-ui .pf-ui) {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    max-width: none;
}
@media (max-width: 992px) {
    html[data-theme] main.content-wrapper.dashboard-shell { padding: 1rem .75rem 1.5rem; }
}
html[data-theme] .dashboard-shell .pf-greeting { padding-left: 0; }

/* Forecast tab only (founder 2026-10-05): wide enough for the full 12-month
   table with the category column on big screens (the table needs ~1630px; the
   page card adds ~150px). Navbar and footer widen with it so the edges still
   line up. Smaller screens are unchanged: the table scrolls inside the page. */
:root { --pf-page-max-forecast: 1840px; }
body:has(#dashboardTabsContent > #forecast.active) main.content-wrapper.dashboard-shell {
    max-width: min(var(--pf-page-max-forecast), 100vw - 0.75rem);
}
body:has(#dashboardTabsContent > #forecast.active) .navbar.site-navbar > .container-fluid,
body:has(#dashboardTabsContent > #forecast.active) footer > .container {
    max-width: var(--pf-page-max-forecast);
}

/* Logged-in text size (founder 2026-10-05: "why is the font smaller once you log in?").
   The dashboard and profile were built as dense number screens: nearly every panel sets text
   at 0.8-0.85rem, so most of it rendered at 12.8-13.6px against 14.4-16px on the public pages.
   Scaling the root size on these pages brings every rem-based size (text and spacing) up by
   10% in one place; the navbar and footer stay at the public pages' size. */
html:has(main.dashboard-shell), html:has(.pf-profile) { font-size: 17.6px; }
html:has(main.dashboard-shell) .site-navbar, html:has(.pf-profile) .site-navbar,
html:has(main.dashboard-shell) footer, html:has(.pf-profile) footer { font-size: 16px; }
html:has(main.dashboard-shell) .site-navbar .nav-link, html:has(.pf-profile) .site-navbar .nav-link,
html:has(main.dashboard-shell) .site-navbar .dropdown-item, html:has(.pf-profile) .site-navbar .dropdown-item { font-size: 16px; }
/* keep the navbar where it was (its padding is in rem) */
html:has(main.dashboard-shell) .navbar.site-navbar, html:has(.pf-profile) .navbar.site-navbar { padding: 16px 24px; }
@media (min-width: 992px) {
  html:has(main.dashboard-shell) .site-navbar > .container-fluid, html:has(.pf-profile) .site-navbar > .container-fluid { padding-left: 48px !important; padding-right: 48px !important; }
}
/* the 12-month cash statement keeps its spreadsheet size so all 12 months still fit on a
   1920px screen (founder 2026-10-05, Forecast tab width) */
html:has(main.dashboard-shell) .pf-fc #tbl-cashflow-statement td,
html:has(main.dashboard-shell) .pf-fc #tbl-cashflow-statement tbody th { font-size: 13.6px; padding-left: 4.8px; padding-right: 4.8px; }
html:has(main.dashboard-shell) .pf-fc #tbl-cashflow-statement thead th { font-size: 12.5px !important; padding-left: 4.8px; padding-right: 4.8px; }
html:has(main.dashboard-shell) .pf-fc #tbl-cashflow-statement thead th.month-status-cell { font-size: 11.5px !important; }
/* Overview's category tables: a little less side padding so the bigger text still fits */
html:has(main.dashboard-shell) .finance-overview .mix-table th,
html:has(main.dashboard-shell) .finance-overview .mix-table td { padding-left: 3px; padding-right: 3px; }

/* Spending commitments (2026-10-05; static/js/pf-commit.js) */
/* one white panel with dividers, one line per commitment (founder 2026-10-06: too busy) */
.pf-cmts { background: #fff; border: 1px solid #D1FAE5; border-radius: 14px; margin: .25rem 0 .9rem; overflow: hidden; }
.pf-cmt { padding: .6rem .9rem; }
.pf-cmt + .pf-cmt { border-top: 1px solid #E3F1EA; }
.pf-cmt__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .6rem; color: #0F2A21; }
.pf-cmt__head .pf-cmt__line { margin-top: 0; }
.pf-cmt__badge { font-size: .68rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; background: #047857; color: #fff; border-radius: 999px; padding: .05rem .5rem; }
.pf-cmt__status { font-size: .74rem; font-weight: 700; border-radius: 999px; padding: .05rem .5rem; }
.pf-cmt__status.is-on { background: #D1FAE5; color: #064E3B; }
.pf-cmt__status.is-off { background: #FEF3C7; color: #92400E; }
.pf-cmt__status.is-upcoming { background: #E0F2FE; color: #075985; }
.pf-cmt__line { font-size: .84rem; color: #3F5A50; margin-top: .15rem; }
.pf-cmt__months { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; align-items: center; }
.pf-cmt__m { font-size: .74rem; border-radius: 8px; padding: .1rem .45rem; background: #fff; border: 1px solid #D1FAE5; color: #0F2A21; font-variant-numeric: tabular-nums; }
.pf-cmt__m.is-met { border-color: #6EE7B7; }
.pf-cmt__m.is-miss { border-color: #FCD34D; background: #FFFBEB; }
.pf-cmt__m.is-now { border-style: dashed; }
.pf-cmt__saved { font-size: .78rem; font-weight: 700; color: #047857; margin-left: .25rem; }
.pf-cmt__coach { font-size: .84rem; color: #1F3B32; margin-top: .45rem; font-style: italic; }
.pf-cmt__warn { font-size: .82rem; color: #92400E; background: #FFFBEB; border: 1px solid #FCD34D; border-radius: 10px; padding: .35rem .6rem; margin-top: .5rem; }
.pf-cmt.is-lapsed { background: #F8FAFC; }
.pf-cmt__status.is-ended { background: #E2E8F0; color: #334155; }
html[data-theme="dark"] .pf-cmt__warn { background: #2A2210; border-color: #4A3A12; color: #FCD34D; }
html[data-theme="dark"] .pf-cmt.is-lapsed { background: #141B19; }
html[data-theme="dark"] .pf-cmt__status.is-ended { background: #263330; color: #CBD5D1; }
html[data-theme="dark"] .pf-cmts { background: #12201B; border-color: #23493B; }
html[data-theme="dark"] .pf-cmt + .pf-cmt { border-top-color: #23493B; }
html[data-theme="dark"] .pf-cmt__head { color: #DCEFE7; }
html[data-theme="dark"] .pf-cmt__line, html[data-theme="dark"] .pf-cmt__coach { color: #A9C4B9; }
html[data-theme="dark"] .pf-cmt__m { background: #0D1915; border-color: #264033; color: #DCEFE7; }
html[data-theme="dark"] .pf-cmt__m.is-miss { background: #2A2210; border-color: #4A3A12; }
html[data-theme="dark"] .pf-cmt__status.is-on { background: #0F3226; color: #6EE7B7; }
html[data-theme="dark"] .pf-cmt__status.is-off { background: #3A2E10; color: #FCD34D; }
html[data-theme="dark"] .pf-cmt__status.is-upcoming { background: #0C2A3A; color: #7DD3FC; }
html[data-theme="dark"] .pf-cmt__saved { color: #6EE7B7; }

/* negative amounts (static/js/pf-negatives.js, founder 2026-10-05) */
.pf-neg { color: #B91C1C; }
html[data-theme="dark"] .pf-neg { color: #FCA5A5; }
/* on the dark green figure bands a lighter red reads better */
.pf-figures .pf-neg, .pf-figure .pf-neg, [data-role="headline-row"] .pf-neg, .ov-band .pf-neg { color: #FCA5A5 !important; }
/* already-coloured places keep their colour (e.g. an amber warning) */
.text-success .pf-neg, .is-up .pf-neg { color: inherit; }

/* Long tables keep their headings in view while you scroll, like the Cash forecast table
   (founder 2026-10-07). The table scrolls inside its box; phones scroll the page as before. */
@media (min-width: 768px) {
  .pf-tx .transactions-fixed-wrapper,
  .pf-tx .table-responsive,
  .forecast-set-panel > .table-responsive,
  .pf-hist__wrap,
  .pf-cmp .table-responsive,
  .budget-analysis__table-wrapper,
  .pf-net-worth .table-responsive {
    max-height: min(75vh, 900px);
    overflow: auto;
  }
  .pf-tx .transactions-fixed-wrapper > table > thead th,
  .pf-tx .table-responsive > table > thead th,
  .forecast-set-panel > .table-responsive > table > thead th,
  .pf-hist__wrap > table > thead th,
  .pf-cmp .table-responsive > table > thead th,
  .budget-analysis__table-wrapper > table > thead th,
  .pf-net-worth .table-responsive > table > thead th {
    position: sticky;
    top: 0;
    z-index: 3;
  }
}

/* multi-pick filter (static/js/pf-multiselect.js), 2026-10-08 */
.pf-ms { position: relative; }
.pf-ms__button { text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.pf-ms__button--on { border-color: #047857; color: #064E3B; font-weight: 600; }
.pf-ms__panel { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 100%; width: max-content; max-width: min(22rem, 90vw);
  background: #fff; border: 1px solid #CDEFDB; border-radius: .6rem; box-shadow: 0 10px 30px rgba(15, 23, 42, .12); padding: .5rem; }
.pf-ms__search { margin-bottom: .4rem; }
.pf-ms__bar { display: flex; justify-content: space-between; align-items: center; font-size: .75rem; color: #6b7280; padding: 0 .25rem .3rem; }
.pf-ms__list { max-height: 16rem; overflow-y: auto; }
.pf-ms__item { display: flex; align-items: center; gap: .5rem; padding: .3rem .35rem; margin: 0; border-radius: .4rem; cursor: pointer; font-size: .85rem; }
.pf-ms__item:hover { background: #ECFDF3; }
.pf-ms__item input { margin: 0; accent-color: #047857; }
.pf-ms__group { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #064E3B; padding: .5rem .35rem .15rem; position: sticky; top: 0; background: #fff; z-index: 1; }
.pf-ms__empty { font-size: .8rem; color: #6b7280; padding: .4rem; }
html[data-theme="dark"] .pf-ms__panel { background: #12201B; border-color: #1F3A30; }
html[data-theme="dark"] .pf-ms__group { background: #12201B; color: #A7F3D0; }
html[data-theme="dark"] .pf-ms__item:hover { background: #0B1612; }
html[data-theme="dark"] .pf-ms__button--on { border-color: #34D399; color: #A7F3D0; }

/* plan or habit change chooser (2026-10-09) */
.pf-fs-kind { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .8rem; font-size: .78rem; color: #334155; margin-top: .35rem; }
.pf-fs-kind label { display: inline-flex; align-items: center; gap: .3rem; margin: 0; cursor: pointer; white-space: nowrap; }
.pf-fs-kind input { accent-color: #047857; margin: 0; }
html[data-theme="dark"] .pf-fs-kind { color: #cbd5e1; }

/* Affordability (founder 2026-10-11): a red flag when a choice needs a sale or redraw, a block when it can't be paid for */
.pf-afford { margin: .25rem 0 .9rem; padding: .8rem .95rem; border-radius: 12px; border: 1px solid #FDA29B; background: #FEF3F2; color: #7A271A; }
.pf-afford--blocked { border-width: 2px; border-color: #D92D20; }
.pf-afford__head { font-weight: 800; color: #B42318; margin-bottom: .2rem; }
.pf-afford__msg { margin: 0 0 .55rem; color: #7A271A; font-size: .92rem; line-height: 1.45; }
.pf-afford__actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .45rem; }
.pf-afford__note { margin: 0; font-size: .82rem; color: #912018; }
.pf-afford__ack { display: flex; align-items: flex-start; gap: .5rem; margin-bottom: .55rem; font-size: .9rem; }
.pf-afford__ack input { margin-top: .25rem; }
.pf-afford__ack label { margin: 0; }
html[data-theme="dark"] .pf-afford { background: #2A1414; border-color: #B42318; color: #FECDCA; }
html[data-theme="dark"] .pf-afford__head { color: #FDA29B; }
html[data-theme="dark"] .pf-afford__msg, html[data-theme="dark"] .pf-afford__note { color: #FECDCA; }
