/* Profitalyzer V50.4 final mobile polish — screen-only overrides. */
@media screen {
  /* Legal + policy pages: fix dark-on-dark contrast without altering print output. */
  :root[data-theme="dark"] body{background:var(--p6-ground)!important;color:var(--p6-ink)!important}
  :root[data-theme="dark"] .pf-legal{color:#eeeaff!important}
  :root[data-theme="dark"] .pf-legal h1{color:#cbbcff!important}
  :root[data-theme="dark"] .pf-legal h2,
  :root[data-theme="dark"] .pf-legal h3,
  :root[data-theme="dark"] .pf-legal strong{color:#f7f4ff!important}
  :root[data-theme="dark"] .pf-legal p,
  :root[data-theme="dark"] .pf-legal li,
  :root[data-theme="dark"] .pf-legal td,
  :root[data-theme="dark"] .pf-legal th{color:#d9d2ec!important}
  :root[data-theme="dark"] .pf-legal .pf-legal-meta{color:#aea5c6!important}
  :root[data-theme="dark"] .pf-legal a{color:#bca7ff!important}
  :root[data-theme="dark"] .pf-legal td,
  :root[data-theme="dark"] .pf-legal th{border-bottom-color:rgba(203,188,255,.18)!important}
  :root[data-theme="dark"] .pf-legal code{color:#e6ddff;background:rgba(124,92,255,.12)}

  /* Consent / cookie UI readability in the purple dark theme. */
  :root[data-theme="dark"] .pf-consent,
  :root[data-theme="dark"] .consent,
  :root[data-theme="dark"] .cookie{color:#f3efff!important}
  :root[data-theme="dark"] .pf-consent p,
  :root[data-theme="dark"] .pf-consent small,
  :root[data-theme="dark"] .consent p,
  :root[data-theme="dark"] .cookie p{color:#d6cfea!important}
  :root[data-theme="dark"] .pf-consent a,
  :root[data-theme="dark"] .consent a,
  :root[data-theme="dark"] .cookie a{color:#c9b9ff!important}

  /* Money Tracker: lighter, less crowded top area on all screen sizes. */
  .mt-hero{align-items:flex-start!important;padding:20px 0 14px!important}
  .mt-hero h1{font-size:clamp(30px,4vw,46px)!important;margin:6px 0 8px!important}
  .mt-hero p{max-width:780px;line-height:1.55!important}
  .mt-primary-actions{display:none!important}
}

@media screen and (max-width:640px){
  /* Main app header: one compact row on phones. Desktop/tablet stays unchanged. */
  header.top .topin,
  .top .topin{min-height:56px!important;padding:8px 10px!important;display:flex!important;grid-template-columns:none!important;align-items:center!important;gap:5px!important;flex-wrap:nowrap!important}
  .top .brand{min-width:0!important;gap:0!important;flex:0 0 auto!important}
  .top .brand>span:not(.mark){display:none!important}
  .top .brand .mark{width:36px!important;height:36px!important;display:grid!important;place-items:center!important;overflow:visible!important}
  .top .brand .mark img,.top .brand .mark svg,.top .brand>svg{width:36px!important;height:36px!important;max-width:36px!important}
  .top .navlinks,.top .homequick{display:none!important}
  .top .tools{margin-inline-start:auto!important;display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:4px!important;flex-wrap:nowrap!important;min-width:0!important}
  .top .tools .ctl,.top .tools button.ctl,.top .tools select.ctl{min-height:36px!important;height:36px!important;padding:5px 8px!important;border-radius:10px!important;font-size:.78rem!important;line-height:1!important}
  .top .tools select#cur{width:68px!important;max-width:68px!important;padding-inline:6px!important}
  .top .tools #lang{max-width:68px!important;padding-inline:7px!important}
  .top .tools .pf-account-link{padding:3px!important;margin:0!important;min-width:36px!important;width:36px!important;height:36px!important;display:grid!important;place-items:center!important}
  .top .tools .pf-account-label{display:none!important}
  .top .tools .pf-account-icon{width:28px!important;height:28px!important}
  .top .mobilemenu,.top #mobilemenutoggle{width:36px!important;min-width:36px!important;padding:0!important;justify-content:center!important}
  .top #theme,.top #searchtoggle{width:36px!important;min-width:36px!important;padding:0!important}

  /* V2/account/Money Tracker header: same compact phone behavior, no floating Home pill. */
  .v2-global-top .topin{min-height:56px!important;padding:8px 10px!important;gap:5px!important;flex-wrap:nowrap!important}
  .v2-global-top .v2-main-brand{min-width:0!important;gap:0!important;flex:0 0 auto!important}
  .v2-global-top .v2-brandcopy,.v2-global-top .homequick{display:none!important}
  .v2-global-top .mark{width:36px!important;height:36px!important;border-radius:11px!important}
  .v2-global-top .mark img{width:36px!important;height:36px!important}
  .v2-global-top .tools{margin-inline-start:auto!important;gap:4px!important;flex-wrap:nowrap!important;min-width:0!important}
  .v2-global-top .ctl{height:36px!important;min-height:36px!important;padding:5px 8px!important;border-radius:10px!important;font-size:.78rem!important;white-space:nowrap!important}
  .v2-global-top .menu-toggle,.v2-global-top #v2Theme{width:36px!important;min-width:36px!important;padding:0!important;justify-content:center!important}
  .v2-global-top #langBtn{max-width:72px!important}
  .v2-global-top .pf-account-link{width:36px!important;min-width:36px!important;height:36px!important;padding:3px!important;margin:0!important;display:grid!important;place-items:center!important}
  .v2-global-top .pf-account-label{display:none!important}
  .v2-global-top .pf-account-icon{width:28px!important;height:28px!important}
  .v2-global-top .mobile-nav{top:58px!important}

  /* Homepage hero is less tall while preserving desktop presentation. */
  .hero2 .inner{padding-top:24px!important;padding-bottom:26px!important}
  .hero2 h1{font-size:clamp(1.72rem,9.2vw,2.25rem)!important;line-height:1.05!important}
  .hero2 p{font-size:1rem!important;line-height:1.58!important}
  .hero2 .ctas{gap:8px!important}
  .hero2 .ctas .btn{min-height:48px!important}

  /* Keep generated financial graphics centered and proportionate in RTL/mobile. */
  .seccard .art{height:156px!important;min-height:156px!important;padding:8px 10px!important;overflow:hidden!important;display:flex!important;align-items:center!important;justify-content:center!important;direction:ltr!important}
  .seccard .art>svg,.seccard .art .pf26-art-svg{display:block!important;width:min(100%,340px)!important;height:138px!important;max-width:100%!important;max-height:138px!important;min-width:0!important;margin:auto!important;transform:none!important;direction:ltr!important;unicode-bidi:isolate!important;flex:0 1 auto!important}
  html[dir="rtl"] .seccard .art>svg,html[dir="rtl"] .seccard .art .pf26-art-svg{transform:none!important}
  .seccard .art .tag{position:absolute!important;z-index:4!important}
  html[dir="rtl"] .seccard .art .tag{direction:rtl!important}

  /* Account page: reduce dead space and keep controls comfortable on phones. */
  .pf-authshell{margin-top:0!important}
  .pf-authbrand{padding:20px 18px!important}
  .pf-authbrand h2{font-size:clamp(28px,8vw,38px)!important;line-height:1.08!important}
  .pf-authbrand p{line-height:1.55!important}
  .pf-authbox{padding:14px 10px 18px!important;min-height:0!important}
  .pf-authmount{min-height:0!important}
  .pf-auth-foot{margin-top:12px!important}

  /* Money Tracker: compact hero + persistent month and compact KPI rail. */
  .mt-app{padding-top:10px!important}
  .mt-hero{padding:10px 2px 12px!important;gap:0!important}
  .mt-hero h1{font-size:29px!important;line-height:1.07!important;margin:5px 0 7px!important;overflow-wrap:anywhere}
  .mt-hero p{font-size:13px!important;line-height:1.48!important;max-width:none!important}
  .mt-eyebrow{font-size:10px!important;letter-spacing:.1em!important}
  .mt-monthbar{top:56px!important;z-index:31!important;margin-inline:-14px!important;padding:9px 14px 10px!important;background:color-mix(in srgb,var(--mt-bg) 94%,transparent)!important;border-bottom:1px solid var(--mt-rule)!important}
  .mt-monthnav{gap:5px!important;min-width:0!important}
  .mt-monthnav button{width:36px!important;height:36px!important;border-radius:11px!important}
  .mt-monthtitle{min-width:112px!important}
  .mt-monthtitle b{font-size:16px!important;white-space:nowrap!important}
  .mt-monthtitle small{font-size:10px!important}
  .mt-save-state{font-size:10px!important;white-space:nowrap!important}
  .mt-summary{position:static!important;top:auto!important;z-index:auto!important;display:flex!important;grid-template-columns:none!important;gap:7px!important;margin:0 -14px 14px!important;padding:8px 14px 9px!important;overflow-x:auto!important;overscroll-behavior-inline:contain!important;scroll-snap-type:x proximity!important;scrollbar-width:none!important;background:color-mix(in srgb,var(--mt-bg) 94%,transparent)!important;border-bottom:1px solid var(--mt-rule)!important;backdrop-filter:blur(14px)!important}
  .mt-summary::-webkit-scrollbar{display:none!important}
  .mt-stat{flex:0 0 132px!important;min-width:132px!important;padding:10px 11px!important;border-radius:13px!important;box-shadow:none!important;scroll-snap-align:start!important}
  .mt-stat span{font-size:9px!important;letter-spacing:.035em!important;text-transform:uppercase!important;white-space:nowrap!important}
  .mt-stat b{font-size:17px!important;margin-top:4px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .mt-cardhead{gap:10px!important;align-items:flex-start!important}
  .mt-cardhead h2{font-size:18px!important}
  .mt-cardhead p{font-size:11px!important;line-height:1.45!important}
  .mt-cardhead #mtAdd2{padding:8px 10px!important;font-size:11px!important;white-space:normal!important;line-height:1.2!important;max-width:118px!important}
  .mt-grid{gap:12px!important}
  .mt-stack{gap:12px!important}
  .mt-toolbox{margin-top:12px!important}
}

@media screen and (max-width:380px){
  .top #searchtoggle{display:none!important}
  .top .tools{gap:3px!important}
  .top .tools select#cur{width:62px!important;max-width:62px!important;font-size:.72rem!important}
  .top .tools #lang{max-width:62px!important;font-size:.72rem!important}
  .v2-global-top #langBtn{max-width:64px!important;font-size:.72rem!important}
  .mt-stat{flex-basis:122px!important;min-width:122px!important}
}

/* ========================================================================== */
/* V50.5 quality pass — stable theme contrast, forecast goals, tracker entry. */
/* ========================================================================== */
@media screen {
  /* Avoid the browser paint/compositing glitch that could render the hero
     gradient-text highlight as an opaque rectangle on some devices. */
  .hero2 h1 .hl{
    background:none!important;
    color:#d8cbff!important;
    -webkit-text-fill-color:#d8cbff!important;
    -webkit-background-clip:border-box!important;
    background-clip:border-box!important;
  }

  /* Account page: these selectors intentionally outrank the later generic
     .pf-card rules so the workspace hero cannot become white-on-white. */
  html .pf-card.pf-workspace-hero{
    background:
      radial-gradient(circle at 86% 12%,rgba(95,230,192,.17),transparent 28%),
      linear-gradient(125deg,#2e1e56 0%,#5a3ad2 55%,#286e62 125%)!important;
    border:1px solid rgba(255,255,255,.12)!important;
    color:#fff!important;
    box-shadow:0 22px 56px rgba(63,38,126,.20)!important;
  }
  html .pf-card.pf-workspace-hero h2{color:#fff!important}
  html .pf-card.pf-workspace-hero p{color:rgba(247,244,255,.84)!important}
  html .pf-card.pf-workspace-hero .pf-eyebrow{color:#ddd2ff!important}
  html .pf-card.pf-workspace-hero .pf-workspace-glyph{
    color:#fff!important;
    background:rgba(255,255,255,.13)!important;
    border-color:rgba(255,255,255,.22)!important;
  }
  :root[data-theme="light"] .pf-currency-note{
    background:#f6f3ff!important;
    color:#51466f!important;
    border-color:#dcd2ff!important;
  }
  :root[data-theme="dark"] .pf-currency-note{
    background:var(--p6-surface-2)!important;
    color:var(--p6-ink-soft)!important;
    border-color:var(--p6-rule)!important;
  }
  @media (prefers-color-scheme:dark){
    :root[data-theme="light"] .pf-currency-note,
    :root[data-theme="light"] .pf-note.pf-currency-note{
      background:#f6f3ff!important;
      color:#51466f!important;
      border-color:#dcd2ff!important;
    }
  }

  /* Main Forecast — optional target. */
  .v3goalsetup{
    margin:18px 0 20px;
    padding:18px;
    border:1px solid var(--p6-brand-line);
    border-radius:var(--p6-r-lg);
    background:linear-gradient(145deg,var(--p6-brand-soft),var(--p6-surface));
  }
  .v3goalhead h3{margin:6px 0 6px;color:var(--p6-ink);font-size:clamp(18px,2.5vw,23px);letter-spacing:-.025em}
  .v3goalhead p{margin:0;max-width:820px;color:var(--p6-ink-soft);font-size:13px;line-height:1.6}
  .v3goalgrid{margin-top:14px}
  .v3goalresult{
    display:grid;
    grid-template-columns:minmax(220px,.8fr) minmax(0,1.2fr);
    gap:16px;
    align-items:center;
    margin:0 0 18px;
    padding:15px 16px;
    border:1px solid var(--p6-brand-line);
    border-radius:var(--p6-r-md);
    background:var(--p6-brand-soft);
  }
  .v3goalresult>div{display:grid;gap:3px;min-width:0}
  .v3goalresult small{color:var(--p6-ink-faint);font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.06em}
  .v3goalresult strong{color:var(--p6-ink);font-size:16px;overflow-wrap:anywhere}
  .v3goalresult span{color:var(--p6-ink-soft);font-size:11px}
  .v3goalresult p{margin:0;color:var(--p6-ink-soft);font-size:12px;line-height:1.55}
  .v3goalresult.good{background:var(--p6-good-soft);border-color:var(--p6-good-line)}
  .v3goalresult.warn{background:var(--p6-warn-soft);border-color:var(--p6-warn-line)}

  /* Imported Actuals → Forecast goal card. */
  .forecast-goal-card{border-color:var(--p6-brand-line)!important;background:linear-gradient(145deg,var(--p6-brand-soft),var(--p6-surface))!important}
  .forecast-goal-card .goal-kicker{display:block;color:var(--p6-brand-ink);font-size:10px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;margin-bottom:5px}
  .forecast-goal-card h2{margin:0 0 5px;color:var(--p6-ink)}
  .forecast-goal-card>p{margin:0;color:var(--p6-ink-soft);font-size:12px;line-height:1.55}
  .forecast-goal-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:15px}
  .forecast-goal-grid label{display:grid;gap:6px;color:var(--p6-ink-soft);font-size:11px;font-weight:800;min-width:0}
  .forecast-goal-grid input,.forecast-goal-grid select{width:100%;min-height:44px;border:1px solid var(--p6-rule);border-radius:11px;background:var(--p6-surface);color:var(--p6-ink);padding:10px 11px;font:inherit;outline:none}
  .forecast-goal-grid input:focus,.forecast-goal-grid select:focus{border-color:var(--p6-brand);box-shadow:0 0 0 3px color-mix(in srgb,var(--p6-brand) 12%,transparent)}
  .forecast-goal-result{margin-top:13px;padding:12px 14px;border-radius:12px;border:1px solid var(--p6-brand-line);background:var(--p6-surface);color:var(--p6-ink-soft);font-size:12px;line-height:1.55}
  .forecast-goal-result strong{color:var(--p6-ink)}
  .forecast-goal-result.good{border-color:var(--p6-good-line);background:var(--p6-good-soft);color:var(--p6-good-ink)}
  .forecast-goal-result.warn{border-color:var(--p6-warn-line);background:var(--p6-warn-soft);color:var(--p6-warn)}

  /* Money Tracker: compact entry instead of a second oversized page hero. */
  .mt-introbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    margin:8px 0 10px;
    padding:11px 13px;
    border:1px solid var(--mt-rule);
    border-radius:15px;
    background:var(--mt-card);
    box-shadow:0 8px 24px rgba(33,24,67,.04);
  }
  .mt-introbar>div{display:grid;gap:2px;min-width:0}
  .mt-introbar strong{color:var(--mt-text);font-size:15px;line-height:1.3;overflow-wrap:anywhere}
  .mt-introbar small{color:var(--mt-muted);font-size:11px;line-height:1.45}
  .mt-daily-card{border-color:color-mix(in srgb,var(--mt-brand) 30%,var(--mt-rule))!important}
  .mt-onboarding{position:relative;text-align:center;max-width:560px!important;padding:30px 28px 25px!important}
  .mt-onboard-close{position:absolute;top:16px;right:16px}
  html[dir="rtl"] .mt-onboard-close{right:auto;left:16px}
  .mt-onboard-progress{display:flex;justify-content:center;gap:6px;margin:0 44px 22px}
  .mt-onboard-progress i{display:block;width:30px;height:4px;border-radius:999px;background:var(--mt-rule)}
  .mt-onboard-progress i.on{background:var(--mt-brand)}
  .mt-onboard-progress i.done{background:color-mix(in srgb,var(--mt-brand) 45%,var(--mt-rule))}
  .mt-onboard-icon{width:58px;height:58px;margin:0 auto 13px;display:grid;place-items:center;border-radius:18px;background:var(--mt-soft);color:var(--mt-brand);font-size:28px;font-weight:900}
  .mt-onboarding .mt-eyebrow{display:block;margin-bottom:7px}
  .mt-onboarding h2{margin:0!important;font-size:24px!important;letter-spacing:-.035em;line-height:1.15;color:var(--mt-text)}
  .mt-onboarding p{max-width:455px;margin:9px auto 0!important;font-size:13px!important;line-height:1.6!important;color:var(--mt-muted)}
  .mt-onboard-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:23px}
  .mt-onboard-actions .mt-btn{min-height:46px}
}

@media screen and (max-width:900px){
  .forecast-goal-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media screen and (max-width:640px){
  .v3goalsetup{padding:14px;margin:14px 0 16px}
  .v3goalresult{grid-template-columns:1fr;gap:9px;padding:13px}
  .forecast-goal-grid{grid-template-columns:1fr}

  .mt-introbar{margin:2px 0 8px;padding:9px 10px;align-items:center}
  .mt-introbar strong{font-size:14px}
  .mt-introbar small{font-size:10.5px;line-height:1.35}
  .mt-introbar .mt-btn.small{min-height:42px;padding:8px 10px;white-space:nowrap}
  .mt-monthnav button{min-width:40px!important;min-height:40px!important}
  .mt-floating{right:calc(16px + env(safe-area-inset-right))!important;bottom:calc(18px + env(safe-area-inset-bottom))!important}
  .mt-modal{padding:8px!important;place-items:end center!important}
  .mt-dialog{max-height:calc(100dvh - 16px)!important;border-radius:21px 21px 14px 14px!important}
  .mt-onboarding{padding:28px 18px 20px!important}
  .mt-onboarding h2{font-size:22px!important}
  .mt-onboarding p{font-size:12.5px!important}
  .mt-onboard-actions{margin-top:19px}
}

@media screen and (max-width:380px){
  .mt-introbar small{display:none}
  .mt-introbar{align-items:center}
}


/* ========================================================================== */
/* V50.6 surgical UI correction — forecast fields/icons + tracker month line. */
/* ========================================================================== */
@media screen {
  /* Main Forecast: keep the optional goal controls in a true stacked field
     layout. The first V50.5 markup used the generic .pf class without the
     forecast field structure, which let labels and controls sit on top of
     each other on wide screens. */
  .v3goalsetup .v3goalgrid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:14px!important;
    align-items:start!important;
  }
  .v3goalsetup .v3goalfield{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:7px!important;
    min-width:0!important;
    align-items:stretch!important;
  }
  .v3goalsetup .v3goalfield>.v3fieldlabel{
    display:block!important;
    position:static!important;
    width:auto!important;
    margin:0!important;
    color:var(--p6-ink-soft)!important;
    font-size:11px!important;
    font-weight:800!important;
    line-height:1.35!important;
  }
  .v3goalsetup .v3goalcontrol,
  .v3goalsetup .v3goalfield>select,
  .v3goalsetup .v3goalfield>input{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    min-height:44px!important;
    margin:0!important;
    padding:0 11px!important;
    border:1px solid var(--p6-rule-strong)!important;
    border-radius:11px!important;
    background:var(--p6-surface)!important;
    color:var(--p6-ink)!important;
    font:inherit!important;
    font-size:14px!important;
    line-height:1.2!important;
    box-sizing:border-box!important;
  }
  .v3goalsetup .v3goalamount{display:block!important;position:relative!important;min-width:0!important}
  .v3goalsetup .v3goalamount .v3goalcontrol{padding-inline-end:58px!important}
  .v3goalsetup .v3goalamount .u{
    position:absolute!important;
    inset-inline-end:11px!important;
    top:50%!important;
    transform:translateY(-50%)!important;
    color:var(--p6-ink-faint)!important;
    font-size:10px!important;
    font-weight:800!important;
    pointer-events:none!important;
  }

  /* Forecast hero/category icons: PF26 intentionally removed photo imagery,
     but the older .pichic.has rule also hid its SVG. Restore the icon itself. */
  .v3forecast .pichic.has .headico svg,
  .v3forecast .hic .headico svg,
  .v3entry .hic .headico svg{
    display:block!important;
    visibility:visible!important;
    opacity:1!important;
  }

  /* Imported-history Personal Budget: cap the other-income line at four
     deliberate columns instead of stretching seven tiny fields across the
     full desktop width. */
  .pbinc-other .pbfields{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:12px!important;
    align-items:end!important;
  }
  .pbinc-other .pbf.wide{grid-column:span 2!important}
  .pbinc-other .pbf:last-child{grid-column:span 2!important}

  /* Money Tracker month selector: 10% smaller and part of normal document
     flow. It no longer follows the user while scrolling. */
  body.mt-body .mt-monthbar{
    position:static!important;
    top:auto!important;
    z-index:auto!important;
    gap:12px!important;
    padding:10px 0 13px!important;
    background:transparent!important;
    border-bottom:0!important;
    backdrop-filter:none!important;
  }
  body.mt-body .mt-monthnav{gap:7px!important}
  body.mt-body .mt-monthnav button{
    width:36px!important;
    height:36px!important;
    min-width:36px!important;
    min-height:36px!important;
    border-radius:11px!important;
    font-size:16px!important;
  }
  body.mt-body .mt-monthtitle{min-width:162px!important}
  body.mt-body .mt-monthtitle b{font-size:16px!important;line-height:1.25!important}
  body.mt-body .mt-monthtitle small{font-size:10px!important}
  body.mt-body .mt-save-state{font-size:11px!important;gap:6px!important}
  body.mt-body .mt-save-state i{width:7px!important;height:7px!important}
}

@media screen and (max-width:900px){
  .pbinc-other .pbfields{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .pbinc-other .pbf.wide{grid-column:1/-1!important}
  .pbinc-other .pbf:last-child{grid-column:auto!important}
}

@media screen and (max-width:640px){
  .v3goalsetup .v3goalgrid{grid-template-columns:1fr!important}
  .pbinc-other .pbfields{grid-template-columns:1fr!important}
  .pbinc-other .pbf.wide,.pbinc-other .pbf:last-child{grid-column:auto!important}
  body.mt-body .mt-monthbar{
    margin-inline:0!important;
    padding:8px 0 10px!important;
  }
  body.mt-body .mt-monthnav button{
    width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;
  }
  body.mt-body .mt-monthtitle{min-width:146px!important}
  body.mt-body .mt-monthtitle b{font-size:15px!important}
  body.mt-body .mt-monthtitle small{font-size:9.5px!important}
  body.mt-body .mt-save-state{font-size:10px!important}
}

/* ========================================================================== */
/* V50.7 final UX consistency — field rhythm + modern Forecast industry marks. */
/* No calculation, persistence, import or authentication behavior is changed.  */
/* ========================================================================== */
@media screen {
  /* One label rhythm across Forecast + Personal Budget. Labels sit slightly
     inside the control edge instead of appearing to hang outside the box.
     padding-inline-start mirrors automatically in Arabic/RTL. */
  .pbf>span,
  .v3forecast .v3fieldlabel,
  .v3forecast .v3perioddate>span,
  .v3forecast .v3metricfield>span,
  .v3forecast .v3linename>span,
  .v3forecast .v3linevalue>span,
  .v3forecast .v3financegrid label>span,
  .v3forecast .v3revmanual label>span,
  .v3forecast .v3revrow label>span,
  .v3forecast .v3openingbody>label>span,
  .v3forecast .v3balanceadd label>span,
  .v3forecast .v14company label>span,
  .v3forecast .v3monthpick>span,
  .forecast-goal-grid label>span{
    display:block;
    padding-inline-start:8px;
    color:var(--p6-ink-soft, var(--ink-soft));
    font-size:.72rem;
    font-weight:800;
    line-height:1.35;
  }
  :root[dir="rtl"] .pbf>span,
  :root[dir="rtl"] .v3forecast .v3fieldlabel,
  :root[dir="rtl"] .v3forecast .v3perioddate>span,
  :root[dir="rtl"] .v3forecast .v3metricfield>span,
  :root[dir="rtl"] .v3forecast .v3linename>span,
  :root[dir="rtl"] .v3forecast .v3linevalue>span,
  :root[dir="rtl"] .v3forecast .v3financegrid label>span,
  :root[dir="rtl"] .v3forecast .v3revmanual label>span,
  :root[dir="rtl"] .v3forecast .v3revrow label>span,
  :root[dir="rtl"] .v3forecast .v3openingbody>label>span,
  :root[dir="rtl"] .v3forecast .v3balanceadd label>span,
  :root[dir="rtl"] .v3forecast .v14company label>span,
  :root[dir="rtl"] .v3forecast .v3monthpick>span,
  :root[dir="rtl"] .forecast-goal-grid label>span{
    letter-spacing:0!important;
  }

  /* Keep the form controls visually related after the label shift. */
  .pbf,
  .v3forecast .v3pf,
  .v3forecast .v3linename,
  .v3forecast .v3linevalue,
  .v3forecast .v3financegrid label,
  .v3forecast .v3revrow label,
  .v3forecast .v3revmanual label,
  .v3forecast .v14company label,
  .forecast-goal-grid label{
    gap:7px!important;
  }

  /* Modern Forecast industry mark. The old photo-thumbnail geometry made the
     small line icon look like unfinished placeholder artwork. All industries
     now use the same compact SaaS-style mark without changing their identity. */
  .v3forecast .chead .hic.pichic.photohead.has{
    width:92px!important;
    height:92px!important;
    flex:0 0 92px!important;
    display:grid!important;
    place-items:center!important;
    position:relative!important;
    overflow:hidden!important;
    border-radius:24px!important;
    border:1px solid color-mix(in srgb,var(--p6-brand, #6c4cf1) 34%,var(--p6-rule, #ddd8ef))!important;
    background-image:none!important;
    background:linear-gradient(145deg,
      color-mix(in srgb,var(--p6-brand, #6c4cf1) 24%,var(--p6-surface, #fff)),
      color-mix(in srgb,var(--p6-brand, #6c4cf1) 9%,var(--p6-surface, #fff)))!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 12px 30px rgba(67,46,145,.12)!important;
  }
  .v3forecast .chead .hic.pichic.photohead.has>.phshade{display:none!important}
  .v3forecast .chead .hic.pichic.photohead.has>.headico{
    position:static!important;
    inset:auto!important;
    width:56px!important;
    height:56px!important;
    display:grid!important;
    place-items:center!important;
    border-radius:18px!important;
    border:1px solid color-mix(in srgb,var(--p6-brand, #6c4cf1) 26%,transparent)!important;
    background:color-mix(in srgb,var(--p6-surface, #fff) 76%,transparent)!important;
    color:var(--p6-brand, #6c4cf1)!important;
    box-shadow:0 8px 20px rgba(70,48,150,.10)!important;
  }
  .v3forecast .chead .hic.pichic.photohead.has>.headico svg{
    width:31px!important;
    height:31px!important;
    display:block!important;
    opacity:1!important;
    visibility:visible!important;
    stroke-width:1.9!important;
  }

  /* Selection cards use the same icon language when that tile is present. */
  .v3entry .biztile .bi{
    border-radius:14px!important;
    border:1px solid color-mix(in srgb,var(--p6-brand, #6c4cf1) 28%,transparent)!important;
    background:color-mix(in srgb,var(--p6-brand, #6c4cf1) 12%,var(--p6-surface, #fff))!important;
    color:var(--p6-brand, #6c4cf1)!important;
    box-shadow:0 8px 18px rgba(70,48,150,.10)!important;
  }
  .v3entry .biztile .bi svg{width:23px!important;height:23px!important;stroke-width:1.9!important}
}

@media screen and (max-width:700px){
  .v3forecast .chead .hic.pichic.photohead.has{
    width:72px!important;
    height:72px!important;
    flex-basis:72px!important;
    border-radius:20px!important;
  }
  .v3forecast .chead .hic.pichic.photohead.has>.headico{
    width:46px!important;
    height:46px!important;
    border-radius:15px!important;
  }
  .v3forecast .chead .hic.pichic.photohead.has>.headico svg{width:26px!important;height:26px!important}
}

/* V50.7 — keep the business-picker marks in the same visual family as the
   Forecast header mark, so Workshop, Clinic, Fitness, etc. do not switch icon
   styles between setup and the six-step workspace. */
.v3entry .v11bizico{
  width:46px!important;
  height:46px!important;
  border-radius:14px!important;
  border:1px solid color-mix(in srgb,var(--p6-brand, #6c4cf1) 25%,var(--p6-rule, #ddd8ef))!important;
  background:linear-gradient(145deg,
    color-mix(in srgb,var(--p6-brand, #6c4cf1) 15%,var(--p6-surface, #fff)),
    color-mix(in srgb,var(--p6-brand, #6c4cf1) 7%,var(--p6-surface, #fff)))!important;
  color:var(--p6-brand, #6c4cf1)!important;
  box-shadow:0 7px 17px rgba(70,48,150,.09)!important;
}
.v3entry .v11bizico svg{
  width:24px!important;
  height:24px!important;
  stroke-width:1.9!important;
}
.v3entry .v11biz.selected .v11bizico{
  border-color:color-mix(in srgb,var(--p6-brand, #6c4cf1) 48%,var(--p6-rule, #ddd8ef))!important;
  background:color-mix(in srgb,var(--p6-brand, #6c4cf1) 18%,var(--p6-surface, #fff))!important;
}
@media screen and (max-width:430px){
  .v3entry .v11bizico{width:40px!important;height:40px!important;border-radius:12px!important}
  .v3entry .v11bizico svg{width:21px!important;height:21px!important}
}
.v3entry .v11biz{grid-template-columns:46px minmax(0,1fr) 24px!important}
@media screen and (max-width:430px){
  .v3entry .v11biz{grid-template-columns:40px minmax(0,1fr) 20px!important}
}

/* ========================================================================== */
/* V50.7.1 — forecast entry mark only.                                         */
/* Matches the modern industry-mark system used in the six-step Forecast.      */
/* Visual-only: no Forecast calculations, state, imports or persistence change. */
/* ========================================================================== */
@media screen {
  .v3entry .chead .hic.forecastentrymark{
    width:92px!important;
    height:92px!important;
    flex:0 0 92px!important;
    display:grid!important;
    place-items:center!important;
    position:relative!important;
    overflow:hidden!important;
    border-radius:24px!important;
    border:1px solid color-mix(in srgb,var(--p6-brand, #6c4cf1) 34%,var(--p6-rule, #ddd8ef))!important;
    background-image:none!important;
    background:linear-gradient(145deg,
      color-mix(in srgb,var(--p6-brand, #6c4cf1) 24%,var(--p6-surface, #fff)),
      color-mix(in srgb,var(--p6-brand, #6c4cf1) 9%,var(--p6-surface, #fff)))!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 12px 30px rgba(67,46,145,.12)!important;
  }
  .v3entry .chead .hic.forecastentrymark>.phshade{display:none!important}
  .v3entry .chead .hic.forecastentrymark>.headico{
    position:static!important;
    inset:auto!important;
    width:56px!important;
    height:56px!important;
    display:grid!important;
    place-items:center!important;
    border-radius:18px!important;
    border:1px solid color-mix(in srgb,var(--p6-brand, #6c4cf1) 26%,transparent)!important;
    background:color-mix(in srgb,var(--p6-surface, #fff) 76%,transparent)!important;
    color:var(--p6-brand, #6c4cf1)!important;
    box-shadow:0 8px 20px rgba(70,48,150,.10)!important;
  }
  .v3entry .chead .hic.forecastentrymark>.headico svg{
    width:31px!important;
    height:31px!important;
    display:block!important;
    opacity:1!important;
    visibility:visible!important;
    stroke-width:1.9!important;
  }
}
@media screen and (max-width:700px){
  .v3entry .chead .hic.forecastentrymark{
    width:72px!important;
    height:72px!important;
    flex-basis:72px!important;
    border-radius:20px!important;
  }
  .v3entry .chead .hic.forecastentrymark>.headico{
    width:46px!important;
    height:46px!important;
    border-radius:15px!important;
  }
  .v3entry .chead .hic.forecastentrymark>.headico svg{
    width:26px!important;
    height:26px!important;
  }
}


/* V50.8 publish header consistency — keep the existing Profitalyzer brand, unify behavior only. */
@media screen {
  .top .navlinks a,
  .v2-global-top .navlinks a{position:relative!important}
  .top .navlinks a.on::after,
  .top .navlinks a.pf-active::after,
  .v2-global-top .navlinks a.on::after,
  .v2-global-top .navlinks a.pf-active::after{
    content:"";position:absolute;inset-inline:18%;bottom:0;height:2px;border-radius:999px;
    background:linear-gradient(90deg,var(--brand,#7c5cff),var(--amber,#3fd79e));
    box-shadow:0 1px 7px color-mix(in srgb,var(--amber,#3fd79e) 18%,transparent)
  }
  .top .navlinks a.on,.top .navlinks a.pf-active,
  .v2-global-top .navlinks a.on,.v2-global-top .navlinks a.pf-active{
    background:var(--surface-2,var(--v2-soft))!important;
    color:var(--brand-ink,var(--v2-brand2))!important;
    font-weight:700!important
  }
  .v2-global-top .brand>svg.mark{
    width:40px!important;height:40px!important;background:none!important;box-shadow:none!important;
    border-radius:0!important;display:block!important;place-items:initial!important;overflow:visible!important
  }
  .v2-global-top .v2-brandcopy .nm{font-weight:800;letter-spacing:-.035em}
  .v2-global-top .v2-brandcopy .tl{display:inline-block;font-size:10.5px;font-weight:500;color:var(--p6-ink-soft)}
  .v2-global-top .tools{position:relative}
  .v2-global-top .tools #searchtoggle{width:39px;min-width:39px;padding:0!important;display:grid;place-items:center;font-size:20px}
  .v2-global-top .tools select#cur{max-width:108px}
  .v2-global-top .v2-searchpop{
    position:absolute;z-index:120;inset-inline-end:0;top:calc(100% + 10px);width:min(360px,calc(100vw - 28px));
    padding:10px;border:1px solid var(--p6-rule);border-radius:14px;background:var(--p6-elevated);box-shadow:var(--p6-sh-3)
  }
  .v2-global-top .v2-searchpop .searchfield{display:flex;gap:7px;align-items:center}
  .v2-global-top .v2-searchpop input{width:100%;min-height:40px;border:1px solid var(--p6-rule);border-radius:10px;background:var(--p6-surface);color:var(--p6-ink);padding:8px 10px;font:600 13px/1.2 var(--p6-font)}
  .v2-global-top .v2-searchpop #searchclose{width:40px;height:40px;border:1px solid var(--p6-rule);border-radius:10px;background:var(--p6-surface-2);color:var(--p6-ink);font-size:20px;cursor:pointer}
  .v2-global-top .v2-searchpop .searchresults{display:grid;gap:4px;margin-top:8px}
  .v2-global-top .v2-searchpop .searchresults a{padding:9px 10px;border-radius:9px;text-decoration:none;color:var(--p6-ink);font-size:12.5px}
  .v2-global-top .v2-searchpop .searchresults a:hover{background:var(--p6-surface-2)}
  .v2-search-empty{display:block;padding:10px;color:var(--p6-ink-soft);font-size:12px}

  .pf-account-menu-wrap{position:relative;order:20;flex:none;z-index:130}
  .pf-account-menu-wrap>.pf-account-link{font-family:var(--p6-font);cursor:pointer}
  .pf-account-menu{
    position:absolute;z-index:140;inset-inline-end:0;top:calc(100% + 10px);width:min(300px,calc(100vw - 24px));
    padding:8px;background:var(--p6-elevated);border:1px solid var(--p6-rule);border-radius:15px;box-shadow:var(--p6-sh-3)
  }
  .pf-account-menu[hidden]{display:none!important}
  .pf-account-menu-row{
    width:100%;min-height:42px;display:grid;grid-template-columns:24px minmax(0,1fr);gap:9px;align-items:center;
    padding:8px 9px;border:0;border-radius:10px;background:transparent;color:var(--p6-ink);text-align:start;text-decoration:none;
    font:600 12.5px/1.2 var(--p6-font);cursor:pointer
  }
  .pf-account-menu-row:hover{background:var(--p6-surface-2)}
  .pf-account-menu-row>span{display:grid;place-items:center;color:var(--p6-brand-ink);font-size:16px}
  .pf-account-menu-row>span svg{width:18px;height:18px}
  .pf-account-menu-row>b{font:700 12.5px/1.2 var(--p6-font)}
  .pf-account-menu-select{grid-template-columns:24px 74px minmax(0,1fr);cursor:default}
  .pf-account-menu-select:hover{background:transparent}
  .pf-account-menu-select select{
    width:100%;min-width:0;min-height:34px;border:1px solid var(--p6-rule);border-radius:9px;background:var(--p6-surface);color:var(--p6-ink);
    padding:5px 7px;font:700 12px/1 var(--p6-font)
  }
  .pf-account-menu-rule{height:1px;background:var(--p6-rule);margin:5px 7px}
  :root[dir="rtl"] .pf-account-menu-row{text-align:right}
}

@media screen and (max-width:640px){
  .top .tools .pf-account-menu-wrap,
  .v2-global-top .tools .pf-account-menu-wrap{order:20;flex:0 0 auto}
  .top .tools .pf-account-menu-wrap .pf-account-link,
  .v2-global-top .tools .pf-account-menu-wrap .pf-account-link{
    width:36px!important;min-width:36px!important;height:36px!important;padding:3px!important;margin:0!important;display:grid!important;place-items:center!important
  }
  .top .tools .pf-account-menu-wrap .pf-account-label,
  .v2-global-top .tools .pf-account-menu-wrap .pf-account-label{display:none!important}
  .top .tools .pf-account-menu-wrap .pf-account-icon,
  .v2-global-top .tools .pf-account-menu-wrap .pf-account-icon{width:28px!important;height:28px!important}
  .top .tools .pf-account-menu-wrap .pf-account-link:after,
  .v2-global-top .tools .pf-account-menu-wrap .pf-account-link:after{display:none!important}
  .v2-global-top #lang{max-width:72px!important}
  .v2-global-top #theme,.v2-global-top #searchtoggle,.v2-global-top .menu-toggle{width:36px!important;min-width:36px!important;padding:0!important}
  .v2-global-top .tools select#cur{width:68px!important;max-width:68px!important;padding-inline:6px!important}
  .pf-account-menu{position:fixed;top:64px;inset-inline-end:8px;width:min(300px,calc(100vw - 16px))}
}


/* V50.8.3 exact header — one desktop line, same active gradient everywhere, utilities in account menu. */
@media screen {
  /* Hide legacy standalone utilities from first paint; they remain functional as sources for the account menu. */
  .top .homequick,.v2-global-top .homequick,
  .top .tools>#cur,.top .tools>#lang,.top .tools>#theme,
  .v2-global-top .tools>#cur,.v2-global-top .tools>#lang,.v2-global-top .tools>#theme,
  .v2-global-top .tools>#langBtn,.v2-global-top .tools>#v2Theme{display:none!important}
  .top .brand .tl,.v2-global-top .brand .tl{display:none!important}
  .top .pf-header-home-hidden,.v2-global-top .pf-header-home-hidden{display:none!important}
  .top .pf-header-utility-hidden,.v2-global-top .pf-header-utility-hidden,
  .top .tools>label.sr[for="cur"],.v2-global-top .tools>label.sr[for="cur"]{display:none!important}

  .top .navlinks a.on,.top .navlinks a.pf-active,
  .v2-global-top .navlinks a.on,.v2-global-top .navlinks a.pf-active{
    color:var(--p6-ink)!important;
    background:linear-gradient(135deg,color-mix(in srgb,#7C5CFF 16%,transparent),color-mix(in srgb,#3FD79E 5%,transparent))!important;
    box-shadow:inset 0 0 0 1px color-mix(in srgb,#9F82FF 10%,transparent)!important;
  }
  .top .navlinks a.on::after,.top .navlinks a.pf-active::after,
  .v2-global-top .navlinks a.on::after,.v2-global-top .navlinks a.pf-active::after{
    inset-inline:18%!important;bottom:1px!important;height:3px!important;
    background:linear-gradient(90deg,#BCA5FF 0%,#7C5CFF 46%,#3FD79E 100%)!important;
    box-shadow:0 2px 9px rgba(63,215,158,.18)!important;
  }
  :root[data-theme="light"] .top .navlinks a.on,:root[data-theme="light"] .top .navlinks a.pf-active,
  :root[data-theme="light"] .v2-global-top .navlinks a.on,:root[data-theme="light"] .v2-global-top .navlinks a.pf-active{
    background:linear-gradient(135deg,rgba(124,92,255,.10),rgba(63,215,158,.035))!important;
    color:#4523A9!important;
  }

  .pf-account-menu{width:min(320px,calc(100vw - 24px))!important;padding:10px!important}
  .pf-account-menu-row{min-height:44px!important;grid-template-columns:25px minmax(0,1fr)!important;gap:10px!important;padding:9px 10px!important}
  .pf-account-menu-select{grid-template-columns:25px 72px minmax(0,1fr)!important}
  .pf-account-menu-row>span svg{width:19px!important;height:19px!important}
  .pf-account-menu-rule{margin:5px 8px!important}
}

@media screen and (min-width:1180px){
  .top .topin,.v2-global-top .topin{
    width:100%!important;max-width:1880px!important;min-height:72px!important;
    margin:0 auto!important;padding:10px 24px!important;display:flex!important;
    grid-template-columns:none!important;align-items:center!important;gap:10px!important;flex-wrap:nowrap!important;
  }
  .top .brand,.v2-global-top .brand{order:0!important;flex:0 0 auto!important;min-width:max-content!important}
  .top .pf-header-search,.v2-global-top .pf-header-search{
    order:1!important;flex:0 0 40px!important;width:40px!important;height:40px!important;min-width:40px!important;
    display:grid!important;place-items:center!important;margin-inline-start:12px!important;padding:0!important;
    border-radius:11px!important;border:1px solid var(--p6-rule)!important;background:var(--p6-surface)!important;color:var(--p6-ink)!important;
  }
  .top .navlinks,.v2-global-top .navlinks{
    order:2!important;flex:1 1 auto!important;min-width:0!important;margin:0!important;
    display:flex!important;align-items:center!important;justify-content:center!important;gap:2px!important;flex-wrap:nowrap!important;white-space:nowrap!important;
  }
  .top .navlinks a,.v2-global-top .navlinks a{font-size:clamp(.78rem,.82vw,.91rem)!important;padding:8px 10px!important;border-radius:11px!important;white-space:nowrap!important}
  .top .tools,.v2-global-top .tools{
    order:3!important;flex:0 0 auto!important;margin-inline-start:0!important;display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:6px!important;flex-wrap:nowrap!important;
  }
  .top .tools>.mobilemenu,.top .tools>#mobilemenutoggle,.v2-global-top .tools>.menu-toggle,.v2-global-top .tools>#v2Menu{display:none!important}
  .top .tools>.pf-account-menu-wrap,.v2-global-top .tools>.pf-account-menu-wrap{display:block!important;margin:0!important}
  .top .tools .pf-account-link,.v2-global-top .tools .pf-account-link{min-height:42px!important;height:42px!important;padding:5px 10px 5px 6px!important;border-radius:12px!important}
  .top .tools .pf-account-icon,.v2-global-top .tools .pf-account-icon{width:32px!important;height:32px!important}
  .top .tools .pf-account-label,.v2-global-top .tools .pf-account-label{display:inline-block!important;max-width:135px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
  .top #searchpop,.v2-global-top #searchpop{position:absolute!important;z-index:160!important;top:calc(100% + 8px)!important;inset-inline-start:clamp(80px,14vw,290px)!important;inset-inline-end:auto!important;width:min(380px,calc(100vw - 32px))!important}
}

@media screen and (max-width:1179px){
  .top .pf-header-search,.v2-global-top .pf-header-search{order:1!important}
  .top .navlinks,.v2-global-top .navlinks{display:none!important}
  .top .tools,.v2-global-top .tools{margin-inline-start:auto!important}
  .top .tools>.mobilemenu,.top .tools>#mobilemenutoggle,.v2-global-top .tools>.menu-toggle,.v2-global-top .tools>#v2Menu{display:inline-grid!important}
}

/* ================================================================
   V50.8.5 — FINAL HEADER LOCK
   One exact header across core + data-assisted pages.
   Desktop alignment: brand -> search -> primary nav from inline-start;
   account/profile remains pinned to inline-end.
   ================================================================ */
@media screen {
  /* Money Tracker / V2 pages must use the exact same header surface as core pages. */
  .top,
  .top.v2-global-top{
    background:color-mix(in srgb,var(--p6-surface) 86%,transparent)!important;
    border-bottom-color:var(--p6-rule)!important;
    box-shadow:var(--p6-sh-1)!important;
    backdrop-filter:saturate(150%) blur(14px)!important;
    -webkit-backdrop-filter:saturate(150%) blur(14px)!important;
  }
  :root[data-theme="dark"] .top,
  :root[data-theme="dark"] .top.v2-global-top,
  html[data-theme="dark"] .top.v2-global-top{
    background:color-mix(in srgb,var(--p6-surface) 86%,transparent)!important;
    border-bottom-color:var(--p6-rule)!important;
    color:var(--p6-ink)!important;
  }
  :root[data-theme="light"] .top,
  :root[data-theme="light"] .top.v2-global-top,
  html[data-theme="light"] .top.v2-global-top{
    background:color-mix(in srgb,var(--p6-surface) 92%,transparent)!important;
    border-bottom-color:var(--p6-rule)!important;
    color:var(--p6-ink)!important;
  }
}

@media screen and (min-width:1180px){
  .top .topin,
  .top.v2-global-top .topin{
    justify-content:flex-start!important;
  }
  .top .navlinks,
  .top.v2-global-top .navlinks{
    flex:0 1 auto!important;
    justify-content:flex-start!important;
    margin-inline-start:0!important;
    margin-inline-end:0!important;
  }
  .top .tools,
  .top.v2-global-top .tools{
    margin-inline-start:auto!important;
    flex:0 0 auto!important;
  }
}


/* ================================================================
   V50.8.5 — FINAL HEADER ALIGNMENT + MOBILE LOCK
   Desktop: logo + search remain at inline-start; primary navigation
   is grouped at inline-end immediately before account/profile.
   Tablet/mobile: compact single row with brand + search + account + menu;
   primary links live in the mobile menu to avoid wrapping/overflow.
   ================================================================ */
@media screen and (min-width:1180px){
  .top .topin,
  .top.v2-global-top .topin{
    justify-content:flex-start!important;
  }
  .top .brand,
  .top.v2-global-top .brand{
    flex:0 0 auto!important;
  }
  .top .pf-header-search,
  .top.v2-global-top .pf-header-search{
    flex:0 0 40px!important;
    margin-inline-start:12px!important;
    margin-inline-end:0!important;
  }
  .top .navlinks,
  .top.v2-global-top .navlinks{
    flex:0 1 auto!important;
    justify-content:flex-end!important;
    margin-inline-start:auto!important;
    margin-inline-end:6px!important;
    gap:2px!important;
  }
  .top .tools,
  .top.v2-global-top .tools{
    margin-inline-start:0!important;
    flex:0 0 auto!important;
  }
}

/* Tablet/phone: one stable header row; no text-nav wrapping. */
@media screen and (max-width:1179px){
  .top .topin,
  .top.v2-global-top .topin{
    width:100%!important;
    max-width:none!important;
    min-height:60px!important;
    padding:8px 12px!important;
    display:flex!important;
    align-items:center!important;
    gap:7px!important;
    flex-wrap:nowrap!important;
  }
  .top .brand,
  .top.v2-global-top .brand{
    order:0!important;
    flex:0 1 auto!important;
    min-width:0!important;
    margin:0!important;
  }
  .top .brand .nm,
  .top.v2-global-top .brand .nm{
    white-space:nowrap!important;
  }
  .top .pf-header-search,
  .top.v2-global-top .pf-header-search{
    order:1!important;
    flex:0 0 38px!important;
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
    margin-inline-start:0!important;
    margin-inline-end:0!important;
    padding:0!important;
    display:grid!important;
    place-items:center!important;
  }
  .top .navlinks,
  .top.v2-global-top .navlinks{
    display:none!important;
  }
  .top .tools,
  .top.v2-global-top .tools{
    order:2!important;
    flex:0 0 auto!important;
    margin-inline-start:auto!important;
    margin-inline-end:0!important;
    display:flex!important;
    align-items:center!important;
    gap:5px!important;
    flex-wrap:nowrap!important;
    position:relative!important;
  }
  .top .tools>.pf-account-menu-wrap,
  .top.v2-global-top .tools>.pf-account-menu-wrap{
    order:1!important;
    margin:0!important;
  }
  .top .tools>.mobilemenu,
  .top .tools>#mobilemenutoggle,
  .top.v2-global-top .tools>.menu-toggle,
  .top.v2-global-top .tools>#v2Menu{
    order:2!important;
    display:inline-grid!important;
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
    padding:0!important;
    place-items:center!important;
    margin:0!important;
  }
  .top .mobilepop,
  .top.v2-global-top .mobile-nav{
    z-index:180!important;
  }
}

/* Phones: preserve the wordmark when it fits; collapse to logo-only on
   very narrow devices so search/account/menu always remain tappable. */
@media screen and (max-width:640px){
  .top .topin,
  .top.v2-global-top .topin{
    min-height:56px!important;
    padding:7px 9px!important;
    gap:5px!important;
  }
  .top .brand .mark,
  .top.v2-global-top .brand>svg.mark{
    width:36px!important;
    height:36px!important;
    flex:0 0 36px!important;
  }
  .top .brand .nm,
  .top.v2-global-top .v2-brandcopy .nm{
    font-size:1rem!important;
  }
  .top .pf-header-search,
  .top.v2-global-top .pf-header-search,
  .top .tools>.mobilemenu,
  .top .tools>#mobilemenutoggle,
  .top.v2-global-top .tools>.menu-toggle,
  .top.v2-global-top .tools>#v2Menu{
    width:36px!important;
    min-width:36px!important;
    height:36px!important;
  }
  .top .tools .pf-account-menu-wrap .pf-account-link,
  .top.v2-global-top .tools .pf-account-menu-wrap .pf-account-link{
    width:36px!important;
    min-width:36px!important;
    height:36px!important;
    padding:3px!important;
  }
  .top .searchpop,
  .top.v2-global-top .v2-searchpop{
    position:fixed!important;
    top:58px!important;
    inset-inline:8px!important;
    width:auto!important;
    max-width:none!important;
  }
  .top .mobilepop,
  .top.v2-global-top .mobile-nav{
    position:fixed!important;
    top:58px!important;
    inset-inline-end:8px!important;
    inset-inline-start:auto!important;
    width:min(280px,calc(100vw - 16px))!important;
    max-height:calc(100dvh - 70px)!important;
    overflow:auto!important;
  }
  .pf-account-menu{
    position:fixed!important;
    top:58px!important;
    inset-inline-end:8px!important;
    width:min(320px,calc(100vw - 16px))!important;
    max-height:calc(100dvh - 70px)!important;
    overflow:auto!important;
  }
}

@media screen and (max-width:430px){
  .top .brand>span:not(.mark),
  .top.v2-global-top .v2-brandcopy{
    display:none!important;
  }
  .top .brand,
  .top.v2-global-top .brand{
    gap:0!important;
  }
}

/* V50.8.5 narrow-phone accessibility: keep Search visible even below 380px. */
@media screen and (max-width:380px){
  .top button#searchtoggle.pf-header-search,
  .top.v2-global-top button#searchtoggle.pf-header-search{
    display:grid!important;
    width:36px!important;
    min-width:36px!important;
    height:36px!important;
    margin-inline-start:0!important;
    margin-inline-end:0!important;
    padding:0!important;
    place-items:center!important;
  }
}


/* ================================================================
   V50.8.6 — deterministic desktop right alignment.
   Use CSS grid rather than flex auto-margins so core + V2 headers
   resolve to the same geometry on every desktop width.
   Logo/search stay inline-start; nav fills the middle column and is
   right-aligned directly before the account/profile tools.
   ================================================================ */
@media screen and (min-width:1180px){
  .top .topin,
  .top.v2-global-top .topin{
    display:grid!important;
    grid-template-columns:max-content 40px minmax(0,1fr) max-content!important;
    grid-template-rows:1fr!important;
    align-items:center!important;
    column-gap:10px!important;
    width:100%!important;
    max-width:1880px!important;
    min-height:72px!important;
    margin:0 auto!important;
    padding:10px 24px!important;
  }
  .top .brand,
  .top.v2-global-top .brand{
    grid-column:1!important;grid-row:1!important;
    justify-self:start!important;align-self:center!important;
    margin:0!important;min-width:max-content!important;
  }
  .top .pf-header-search,
  .top.v2-global-top .pf-header-search{
    grid-column:2!important;grid-row:1!important;
    justify-self:start!important;align-self:center!important;
    margin:0!important;width:40px!important;min-width:40px!important;height:40px!important;
  }
  .top .navlinks,
  .top.v2-global-top .navlinks{
    grid-column:3!important;grid-row:1!important;
    width:100%!important;min-width:0!important;
    margin:0!important;padding:0!important;
    display:flex!important;align-items:center!important;justify-content:flex-end!important;
    gap:2px!important;white-space:nowrap!important;flex-wrap:nowrap!important;
  }
  .top .tools,
  .top.v2-global-top .tools{
    grid-column:4!important;grid-row:1!important;
    justify-self:end!important;align-self:center!important;
    margin:0!important;display:flex!important;align-items:center!important;gap:6px!important;flex-wrap:nowrap!important;
  }
  .top #searchpop,
  .top.v2-global-top #searchpop{
    position:absolute!important;
  }
}

/* Keep tablet/phone header compact and identical across core/V2 pages. */
@media screen and (max-width:1179px){
  .top .topin,
  .top.v2-global-top .topin{display:flex!important;flex-wrap:nowrap!important}
  .top .navlinks,
  .top.v2-global-top .navlinks{display:none!important}
  .top .tools,
  .top.v2-global-top .tools{margin-inline-start:auto!important}
}

/* ================================================================
   V50.8.7 — Money Tracker mobile micro-fix only.
   1) KPI summary rail stays in normal document flow (never follows scroll).
   2) Mobile/tablet Search sits immediately after the brand at inline-start;
      account + menu remain pushed to inline-end.
   ================================================================ */
@media screen {
  .mt-summary{
    position:static!important;
    top:auto!important;
    inset-block-start:auto!important;
    z-index:auto!important;
  }
}

@media screen and (max-width:1179px){
  .top .pf-header-search,
  .top.v2-global-top .pf-header-search{
    margin-inline-start:0!important;
    margin-inline-end:0!important;
  }
  .top .tools,
  .top.v2-global-top .tools{
    margin-inline-start:auto!important;
    margin-inline-end:0!important;
  }
}

@media screen and (max-width:380px){
  .top button#searchtoggle.pf-header-search,
  .top.v2-global-top button#searchtoggle.pf-header-search{
    margin-inline-start:0!important;
    margin-inline-end:0!important;
  }
}

/* ========================================================================== */
/* V50.8.9 — site-wide visual consistency: native icon marks, no legacy photos */
/* Visual-only. Replaces old section/forecast photo thumbnails with one strong  */
/* modern Profitalyzer icon language. No calculator/model/state changes.        */
/* ========================================================================== */
@media screen {
  /* One direct, high-contrast category mark. No faded outer box + tiny inner icon. */
  .pf-modern-mark,
  .sechead .ic.pf-modern-mark,
  .chead .hic.pf-modern-mark,
  .v3entry .chead .hic.pf-modern-mark,
  .v3forecast .chead .hic.pf-modern-mark {
    width:76px!important;
    height:76px!important;
    flex:0 0 76px!important;
    display:grid!important;
    place-items:center!important;
    position:relative!important;
    inset:auto!important;
    overflow:hidden!important;
    padding:0!important;
    border:0!important;
    border-radius:22px!important;
    background:linear-gradient(145deg,var(--p6-v500,#7c5cff),var(--p6-v700,#5730d8))!important;
    background-image:none!important;
    color:#fff!important;
    box-shadow:0 14px 30px -14px rgba(87,48,216,.60),inset 0 1px 0 rgba(255,255,255,.18)!important;
  }
  .pf-modern-mark::after {
    content:"";
    position:absolute;
    width:70px;
    height:70px;
    inset-inline-end:-34px;
    inset-block-start:-36px;
    border-radius:50%;
    background:rgba(255,255,255,.10);
    pointer-events:none;
  }
  .pf-modern-mark svg,
  .sechead .ic.pf-modern-mark svg,
  .chead .hic.pf-modern-mark svg,
  .v3entry .chead .hic.pf-modern-mark svg,
  .v3forecast .chead .hic.pf-modern-mark svg {
    width:34px!important;
    height:34px!important;
    display:block!important;
    position:relative!important;
    z-index:1!important;
    color:#fff!important;
    stroke:currentColor!important;
    stroke-width:1.9!important;
    opacity:1!important;
    visibility:visible!important;
  }
  .pf-modern-mark-lg,
  .v3entry .chead .hic.pf-modern-mark-lg,
  .v3forecast .chead .hic.pf-modern-mark-lg {
    width:92px!important;
    height:92px!important;
    flex-basis:92px!important;
    border-radius:26px!important;
  }
  .pf-modern-mark-lg svg,
  .v3entry .chead .hic.pf-modern-mark-lg svg,
  .v3forecast .chead .hic.pf-modern-mark-lg svg {
    width:40px!important;
    height:40px!important;
  }

  /* Home calculator-section cards: the old photography is gone. Keep a clean
     branded icon stage that reads as part of the same product, not stock art. */
  .seccard .art.pf-icon-art,
  .secgrid5 .seccard .art.pf-icon-art {
    height:132px!important;
    min-height:132px!important;
    display:grid!important;
    place-items:center!important;
    position:relative!important;
    overflow:hidden!important;
    background:
      radial-gradient(circle at 82% 18%,color-mix(in srgb,var(--p6-v400,#9f82ff) 22%,transparent) 0 18%,transparent 19%),
      linear-gradient(145deg,color-mix(in srgb,var(--p6-brand-soft,#f5f2ff) 84%,var(--p6-surface,#fff)),var(--p6-surface-2,#f3f3f8))!important;
    background-image:
      radial-gradient(circle at 82% 18%,color-mix(in srgb,var(--p6-v400,#9f82ff) 22%,transparent) 0 18%,transparent 19%),
      linear-gradient(145deg,color-mix(in srgb,var(--p6-brand-soft,#f5f2ff) 84%,var(--p6-surface,#fff)),var(--p6-surface-2,#f3f3f8))!important;
    border-bottom:1px solid var(--p6-rule,var(--rule))!important;
  }
  .seccard .art.pf-icon-art::after {display:none!important}
  .seccard .art.pf-icon-art .artico.pf-modern-artico {
    width:68px!important;
    height:68px!important;
    display:grid!important;
    place-items:center!important;
    position:relative!important;
    inset:auto!important;
    border:0!important;
    border-radius:21px!important;
    background:linear-gradient(145deg,var(--p6-v500,#7c5cff),var(--p6-v700,#5730d8))!important;
    color:#fff!important;
    box-shadow:0 14px 28px -13px rgba(87,48,216,.58),inset 0 1px 0 rgba(255,255,255,.18)!important;
    transform:none!important;
  }
  .seccard .art.pf-icon-art .artico.pf-modern-artico svg {
    width:33px!important;
    height:33px!important;
    color:#fff!important;
    stroke:currentColor!important;
    stroke-width:1.9!important;
  }
  a.seccard:hover .art.pf-icon-art .artico.pf-modern-artico {
    transform:translateY(-2px)!important;
  }

  /* Forecast business picker uses the same stronger mark instead of the older
     faint outlined tile, while keeping every industry's existing SVG identity. */
  .v3entry .v11bizico,
  .v3entry .biztile .bi {
    border:0!important;
    background:linear-gradient(145deg,var(--p6-v500,#7c5cff),var(--p6-v700,#5730d8))!important;
    color:#fff!important;
    box-shadow:0 9px 20px -10px rgba(87,48,216,.55)!important;
  }
  .v3entry .v11bizico svg,
  .v3entry .biztile .bi svg {color:#fff!important;stroke:currentColor!important;opacity:1!important}
  .v3entry .v11biz.selected .v11bizico {
    border:0!important;
    background:linear-gradient(145deg,var(--p6-v400,#9f82ff),var(--p6-v600,#6a45f5))!important;
    box-shadow:0 0 0 3px color-mix(in srgb,var(--p6-good,#3fd79e) 30%,transparent),0 10px 22px -10px rgba(87,48,216,.60)!important;
  }

  /* Legacy photo helpers must never reintroduce a picture if stale saved state
     still contains an old image path. */
  .secphoto,.photohead,.pichic {background-image:none!important}
  .secphoto .phshade,.photohead .phshade,.pichic .phshade {display:none!important}
}

@media screen and (max-width:700px) {
  .pf-modern-mark,
  .sechead .ic.pf-modern-mark,
  .chead .hic.pf-modern-mark,
  .v3entry .chead .hic.pf-modern-mark,
  .v3forecast .chead .hic.pf-modern-mark {
    width:64px!important;
    height:64px!important;
    flex-basis:64px!important;
    border-radius:19px!important;
  }
  .pf-modern-mark svg,
  .sechead .ic.pf-modern-mark svg,
  .chead .hic.pf-modern-mark svg,
  .v3entry .chead .hic.pf-modern-mark svg,
  .v3forecast .chead .hic.pf-modern-mark svg {width:29px!important;height:29px!important}
  .pf-modern-mark-lg,
  .v3entry .chead .hic.pf-modern-mark-lg,
  .v3forecast .chead .hic.pf-modern-mark-lg {
    width:72px!important;
    height:72px!important;
    flex-basis:72px!important;
    border-radius:21px!important;
  }
  .pf-modern-mark-lg svg,
  .v3entry .chead .hic.pf-modern-mark-lg svg,
  .v3forecast .chead .hic.pf-modern-mark-lg svg {width:32px!important;height:32px!important}
  .seccard .art.pf-icon-art,.secgrid5 .seccard .art.pf-icon-art {height:112px!important;min-height:112px!important}
  .seccard .art.pf-icon-art .artico.pf-modern-artico {width:58px!important;height:58px!important;border-radius:18px!important}
  .seccard .art.pf-icon-art .artico.pf-modern-artico svg {width:28px!important;height:28px!important}
}

/* ================================================================
   V50.9.2 — final small visual consistency fixes
   ================================================================ */
@media screen {
  /* Account/profile menu rows should read as plain menu items, not selected pills. */
  .pf-account-menu .pf-menu-theme,
  .pf-account-menu .pf-menu-language{
    background:transparent!important;
    box-shadow:none!important;
  }
  .pf-account-menu .pf-menu-theme:focus,
  .pf-account-menu .pf-menu-language:focus,
  .pf-account-menu .pf-menu-theme:active,
  .pf-account-menu .pf-menu-language:active{
    background:transparent!important;
    box-shadow:none!important;
    outline:none!important;
  }
  @media (hover:hover) and (pointer:fine){
    .pf-account-menu .pf-menu-theme:hover,
    .pf-account-menu .pf-menu-language:hover{
      background:color-mix(in srgb,var(--p6-surface-2) 55%,transparent)!important;
    }
  }
  @media (hover:none), (pointer:coarse){
    .pf-account-menu .pf-account-menu-row:hover,
    .pf-account-menu .pf-account-menu-row:focus,
    .pf-account-menu .pf-account-menu-row:active{
      background:transparent!important;
    }
  }

  /* Home preview stages: undo the accidental shrink from V50.8.9 and keep
     every calculator/analysis preview at one consistent, useful size. */
  .seccard .art.pf-icon-art,
  .secgrid5 .seccard .art.pf-icon-art{
    height:178px!important;
    min-height:178px!important;
    padding:7px 10px!important;
  }
  .seccard .art.pf-icon-art>.pf26-art-svg,
  .secgrid5 .seccard .art.pf-icon-art>.pf26-art-svg{
    width:min(100%,390px)!important;
    height:164px!important;
    max-width:100%!important;
    max-height:164px!important;
    transform:none!important;
  }
}

@media screen and (max-width:700px){
  .seccard .art.pf-icon-art,
  .secgrid5 .seccard .art.pf-icon-art{
    height:160px!important;
    min-height:160px!important;
  }
  .seccard .art.pf-icon-art>.pf26-art-svg,
  .secgrid5 .seccard .art.pf-icon-art>.pf26-art-svg{
    height:148px!important;
    max-height:148px!important;
  }
}
