/*
=========================================================
Public Sentiment Dash
Shared Mobile Responsive Foundation
Phase 1 — Homepage
Desktop styles intentionally untouched.
=========================================================
*/

/* Safety only — prevents accidental viewport expansion */
@media (max-width: 768px) {

  html,
  body {
    width:100%;
    max-width:100%;
    overflow-x:hidden;
  }

  img,
  svg,
  canvas,
  video {
    max-width:100%;
  }

  main.page {
    width:100%;
    max-width:100%;
    padding:12px !important;
    overflow-x:hidden;
  }

  /* ---------- Shared ribbon ---------- */

  .psd-shared-header,
  .header {
    width:100%;
    max-width:100%;
    min-height:0 !important;
    padding:10px 12px !important;
    gap:8px !important;
    grid-template-columns:1fr !important;
    overflow:hidden;
  }

  .psd-shared-header .brand {
    width:100%;
    max-width:100%;
    min-width:0;
    gap:9px;
  }

  .psd-shared-header .logo {
    width:68px !important;
    height:68px !important;
    padding:4px;
    border-radius:16px;
  }

  .psd-shared-header .brand-copy {
    min-width:0;
    flex:1;
  }

  .psd-shared-header .brand-stamp {
    width:auto;
    max-width:100%;
    white-space:normal !important;
    line-height:1.25;
    padding:6px 9px !important;
    font-size:10px !important;
  }

  .psd-shared-header .site-subtitle {
    white-space:normal !important;
    overflow-wrap:anywhere;
    font-size:10px !important;
    line-height:1.3 !important;
  }

  .psd-shared-header .header-center {
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    transform:none !important;
    justify-content:flex-start !important;
  }

  .psd-shared-header .header-pill {
    min-width:0 !important;
    width:auto !important;
    max-width:100% !important;
    padding:6px 10px !important;
    white-space:normal !important;
    font-size:10px !important;
  }

  .psd-shared-header .nav {
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    transform:none !important;
    gap:5px !important;
    overflow:hidden;
  }

  .psd-shared-header .psd-nav-row {
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    height:auto !important;
    min-height:0 !important;
    justify-content:flex-start !important;
    flex-wrap:wrap !important;
    gap:5px 6px !important;
    white-space:normal !important;
  }

  .psd-shared-header .psd-nav-link,
  .psd-shared-header .nav a {
    min-width:0 !important;
    max-width:100%;
    font-size:10px !important;
    line-height:1.15 !important;
    padding:6px 7px !important;
    white-space:normal !important;
  }

  .psd-shared-header .psd-bottom-promos,
  .psd-shared-header .psd-ribbon-social-wrap,
  .psd-shared-header .psd-ribbon-actions {
    max-width:100% !important;
    min-width:0 !important;
  }

  /* ---------- Homepage shell ---------- */

  .home-layout {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
    gap:12px !important;
    width:100%;
    min-width:0;
  }

  .home-layout > *,
  .home-layout > div,
  .hero,
  .section,
  .panel {
    width:100%;
    max-width:100%;
    min-width:0;
  }

  .instrument-rail {
    position:relative !important;
    top:auto !important;
    padding:12px !important;
  }

  .rail-waterfall {
    height:300px !important;
  }

  /* ---------- Hero ---------- */

  .hero-copy {
    padding:18px 16px !important;
  }

  .hero-copy h1 {
    white-space:normal !important;
    overflow-wrap:normal;
    word-break:normal;
    font-size:clamp(28px,8.5vw,38px) !important;
    line-height:1.05 !important;
    letter-spacing:-.025em;
  }

  .hero-compact-note {
    max-width:100% !important;
    font-size:12px !important;
    line-height:1.45 !important;
  }

  .hero-points,
  .action-grid,
  .sources-layout {
    grid-template-columns:minmax(0,1fr) !important;
  }

  .hero-point,
  .action-card,
  .mini-card {
    min-width:0;
  }

  /* ---------- Market Pulse gauges ---------- */

  .market-pulse-panel {
    width:100%;
    min-width:0;
    min-height:0 !important;
    padding:14px 10px 16px !important;
    overflow:hidden !important;
  }

  .hud-title-row {
    position:relative !important;
    inset:auto !important;
    display:flex !important;
    flex-direction:column !important;
    align-items:center;
    gap:5px;
    margin-bottom:10px;
  }

  .hud-title-row .scope-pill,
  .hud-title-row .score-label,
  .pulse-small {
    position:relative !important;
    inset:auto !important;
    top:auto !important;
    left:auto !important;
    right:auto !important;
    transform:none !important;
    text-align:center !important;
    white-space:normal !important;
  }

  .hud-speedometer-grid {
    grid-template-columns:minmax(0,1fr) !important;
    gap:12px !important;
    padding-top:0 !important;
  }

  #pulseUSCard,
  #pulseGlobalCard,
  #pulseEuropeCard {
    grid-column:auto !important;
    grid-row:auto !important;
    margin-top:0 !important;
    min-height:0 !important;
  }

  .hud-speedometer {
    width:min(186px,60vw) !important;
    height:min(186px,60vw) !important;
  }

  .primary-gauge .hud-speedometer {
    width:min(220px,68vw) !important;
    height:min(220px,68vw) !important;
  }

  /* ---------- Sources ---------- */

  .sources-waterfall {
    width:100%;
    min-width:0;
    height:350px !important;
    min-height:350px !important;
    padding:10px !important;
  }

  .waterfall-grid {
    grid-template-columns:minmax(0,1fr) !important;
  }

  .waterfall-column.column-2,
  .waterfall-column.column-3 {
    display:none !important;
  }

  .source-chip {
    width:100%;
    min-width:0;
  }

  .source-chip-name {
    overflow-wrap:anywhere;
  }

  /* ---------- Focus / cards ---------- */

  .focus-grid {
    grid-template-columns:minmax(0,1fr) !important;
    grid-auto-rows:auto !important;
  }

  .focus-card {
    min-height:0 !important;
  }

  .section {
    padding:16px !important;
  }

  /* ---------- Welcome popup ---------- */

  .home-welcome-backdrop {
    padding:10px !important;
  }

  .home-welcome-box {
    width:calc(100vw - 20px) !important;
    max-width:100% !important;
    max-height:calc(100dvh - 20px) !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
  }

  /* ---------- Vote widget ---------- */

  .psd-vote-widget {
    left:8px !important;
  }

  .psd-vote-panel {
    position:fixed !important;
    left:10px !important;
    right:10px !important;
    top:50% !important;
    width:auto !important;
    max-width:none !important;
    transform:translateY(-50%) !important;
  }

  .psd-vote-panel.open {
    transform:translateY(-50%) !important;
  }

  /* ---------- Footer ---------- */

  .footer {
    width:100%;
    max-width:100%;
  }

  .footer-links {
    gap:7px 10px;
  }
}


/* Small phones: 430px and below */
@media (max-width: 430px) {

  main.page {
    padding:10px !important;
  }

  .psd-shared-header,
  .header {
    padding:8px 10px !important;
  }

  .psd-shared-header .logo {
    width:58px !important;
    height:58px !important;
  }

  .hero-copy {
    padding:16px 14px !important;
  }

  .section {
    padding:14px !important;
  }

  .panel {
    border-radius:15px;
  }

  .hud-speedometer {
    width:min(172px,57vw) !important;
    height:min(172px,57vw) !important;
  }

  .primary-gauge .hud-speedometer {
    width:min(205px,66vw) !important;
    height:min(205px,66vw) !important;
  }
}


/* Very small phones: 360px and below */
@media (max-width: 360px) {

  main.page {
    padding:8px !important;
  }

  .hero-copy h1 {
    font-size:27px !important;
  }

  .psd-shared-header .nav a,
  .psd-shared-header .psd-nav-link {
    font-size:9.5px !important;
    padding:5px 6px !important;
  }

  .home-welcome-heading {
    padding-left:16px !important;
  }
}

/* =========================================================
   MOBILE HEADER / STRUCTURE — LAB ONLY
   ========================================================= */

@media (max-width:768px){

  /* Homepage content must come before instrument rail */
  .home-layout{
    display:flex !important;
    flex-direction:column !important;
  }

  .home-layout > div{
    order:1;
  }

  .home-layout > .instrument-rail{
    order:2;
    margin-top:2px;
  }

  /* Clean compact header */
  .psd-shared-header{
    position:relative !important;
    display:block !important;
    padding:8px 10px 10px !important;
  }

  .psd-shared-header .header-center{
    display:none !important;
  }

  /* Hide desktop navigation until Menu button opens it */
  .psd-shared-header .nav{
    display:none !important;
    margin-top:8px !important;
    padding-top:8px !important;
    border-top:1px solid var(--line);
  }

  .psd-shared-header.psd-mobile-menu-open .nav{
    display:flex !important;
    flex-direction:column !important;
    overflow:visible !important;
  }

  .psd-shared-header .psd-nav-row{
    flex-direction:column !important;
    align-items:stretch !important;
    flex-wrap:nowrap !important;
    gap:3px !important;
  }

  .psd-shared-header .nav a,
  .psd-shared-header .psd-nav-link{
    display:block !important;
    width:100% !important;
    padding:9px 10px !important;
    font-size:12px !important;
    line-height:1.25 !important;
    border-radius:9px;
  }

  /* Brand section */
  .psd-shared-header .brand{
    display:grid !important;
    grid-template-columns:58px minmax(0,1fr) auto !important;
    align-items:center !important;
    gap:8px !important;
  }

  .psd-shared-header .logo{
    width:56px !important;
    height:56px !important;
  }

  .psd-shared-header .brand-copy{
    width:100% !important;
    min-width:0 !important;
    overflow:hidden;
  }

  .psd-shared-header .brand-stamp{
    display:block !important;
    width:100% !important;
    max-width:100% !important;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap !important;
  }

  .psd-shared-header .site-subtitle{
    display:block !important;
    width:100% !important;
    max-width:100% !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
  }

  /* Mobile menu button inserted by mobile-lab.js */
  .psd-mobile-menu-button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:66px;
    height:36px;
    padding:0 11px;
    border:1px solid rgba(210,153,34,.55);
    border-radius:999px;
    background:linear-gradient(180deg,#f7c94b,#6f4a08);
    color:#111;
    font:inherit;
    font-size:11px;
    font-weight:900;
    cursor:pointer;
    box-shadow:0 3px 9px rgba(0,0,0,.18);
  }

  /* Secondary ribbon/promos hidden on small screen.
     They remain available through normal pages/navigation. */
  .psd-shared-header .psd-bottom-promos,
  .psd-shared-header .psd-ribbon-social-wrap{
    display:none !important;
  }

  /* Vote button must not sit over primary content */
  .psd-vote-widget{
    left:auto !important;
    right:8px !important;
    bottom:12px !important;
    top:auto !important;
  }

  /* Hero should be first major content */
  .hero{
    order:1;
  }

  .instrument-rail{
    order:99;
  }
}

@media (max-width:430px){

  .psd-shared-header .brand{
    grid-template-columns:52px minmax(0,1fr) auto !important;
  }

  .psd-shared-header .logo{
    width:50px !important;
    height:50px !important;
  }

  .psd-mobile-menu-button{
    min-width:60px;
    height:34px;
    padding:0 9px;
    font-size:10px;
  }
}


/* =========================================================
   MOBILE ORDER CORRECTION — LAB ONLY
   Preserve original homepage DOM order.
   ========================================================= */

@media (max-width:768px){

  /* Main content column first; instrument rail last */
  .home-layout > div{
    order:1 !important;
  }

  .home-layout > .instrument-rail{
    order:2 !important;
  }

  /* IMPORTANT:
     Do not reorder homepage sections.
     Use their original HTML sequence. */
  .home-layout > div > .hero,
  .home-layout > div > .section{
    order:0 !important;
  }

  /* Smaller, less intrusive mobile Vote button */
  .psd-vote-widget{
    position:fixed !important;
    left:auto !important;
    right:8px !important;
    top:auto !important;
    bottom:10px !important;
    width:auto !important;
    z-index:9999 !important;
  }

  .psd-vote-tab{
    width:46px !important;
    min-height:54px !important;
    border-radius:16px !important;
    padding:5px 3px !important;
  }

  .psd-vote-tab-icon{
    font-size:15px !important;
  }

  .psd-vote-tab-text{
    font-size:9px !important;
    line-height:1.05 !important;
  }
}


/* =========================================================
   MOBILE TOP COMPACTION — LAB ONLY
   ========================================================= */

@media (max-width:768px){

  .hero-copy{
    padding:10px 12px !important;
  }

  .hero-copy h1{
    font-size:21px !important;
    line-height:1.02 !important;
    margin-bottom:6px !important;
  }

  .hero-compact-note{
    font-size:9.5px !important;
    line-height:1.28 !important;
    margin-bottom:3px !important;
  }

  .hero-points{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:5px !important;
    margin-top:7px !important;
  }

  .hero-point{
    padding:7px 6px !important;
    border-radius:10px !important;
  }

  .hero-point strong{
    font-size:9px !important;
    line-height:1.1 !important;
    margin-bottom:2px !important;
  }

  .hero-point span{
    font-size:7.5px !important;
    line-height:1.18 !important;
  }

  .market-pulse-panel{
    padding:7px 5px 8px !important;
  }

  .hud-title-row{
    margin-bottom:4px !important;
  }

  .hud-title-row .score-label{
    font-size:10px !important;
  }

  .pulse-small{
    font-size:7px !important;
  }

  .hud-speedometer-grid{
    gap:4px !important;
  }
}

@media (max-width:430px){

  .hero-copy h1{
    font-size:20px !important;
  }

  .hero-point strong{
    font-size:8.5px !important;
  }

  .hero-point span{
    font-size:7px !important;
  }
}


/* =========================================================
   MOBILE GAUGE LAYOUT — LAB ONLY
   Global on top, U.S. + Europe side-by-side below
   ========================================================= */

@media (max-width:768px){

  .hud-speedometer-grid{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:6px !important;
    align-items:start !important;
  }

  #pulseGlobalCard{
    grid-column:1 / -1 !important;
    grid-row:1 !important;
    width:min(190px,58vw) !important;
    justify-self:center !important;
  }

  #pulseUSCard{
    grid-column:1 !important;
    grid-row:2 !important;
  }

  #pulseEuropeCard{
    grid-column:2 !important;
    grid-row:2 !important;
  }

  #pulseUSCard,
  #pulseEuropeCard{
    width:100% !important;
    min-width:0 !important;
  }

  .primary-gauge .hud-speedometer{
    width:min(118px,31vw) !important;
    height:min(118px,31vw) !important;
  }

  .hud-speedometer{
    width:min(92px,24vw) !important;
    height:min(92px,24vw) !important;
  }

  .primary-gauge .hud-center{
    width:56px !important;
    height:56px !important;
  }

  .hud-center{
    width:44px !important;
    height:44px !important;
  }

  .primary-gauge .hud-center span{
    font-size:24px !important;
  }

  .hud-center span{
    font-size:18px !important;
  }

  .hud-gauge-title{
    font-size:8px !important;
  }

  .pulse-foot{
    font-size:6.5px !important;
    line-height:1.1 !important;
  }

  #pulseUSCard,
  #pulseEuropeCard,
  #pulseGlobalCard{
    padding:5px 4px 6px !important;
    border-radius:12px !important;
  }
}

@media (max-width:430px){

  #pulseGlobalCard{
    width:min(174px,55vw) !important;
  }

  .primary-gauge .hud-speedometer{
    width:min(110px,30vw) !important;
    height:min(110px,30vw) !important;
  }

  .hud-speedometer{
    width:min(86px,23vw) !important;
    height:min(86px,23vw) !important;
  }
}


/* =========================================================
   MOBILE GAUGE FILL / SPACE REDUCTION — LAB ONLY
   ========================================================= */

@media (max-width:768px){

  .market-pulse-panel{
    padding:6px 5px 7px !important;
  }

  .hud-title-row{
    margin-bottom:2px !important;
    gap:1px !important;
  }

  .hud-speedometer-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    column-gap:6px !important;
    row-gap:3px !important;
    padding-top:0 !important;
  }

  #pulseGlobalCard{
    width:min(220px,66vw) !important;
    padding:4px 4px 5px !important;
  }

  #pulseUSCard,
  #pulseEuropeCard{
    padding:4px 3px 5px !important;
  }

  .primary-gauge .hud-speedometer{
    width:min(145px,39vw) !important;
    height:min(145px,39vw) !important;
  }

  .hud-speedometer{
    width:min(112px,30vw) !important;
    height:min(112px,30vw) !important;
  }

  .primary-gauge .hud-center{
    width:66px !important;
    height:66px !important;
  }

  .hud-center{
    width:50px !important;
    height:50px !important;
  }

  .primary-gauge .hud-center span{
    font-size:29px !important;
  }

  .hud-center span{
    font-size:21px !important;
  }

  .hud-gauge-title{
    margin-bottom:1px !important;
  }

  .hud-bottom{
    margin-top:3px !important;
  }

  .pulse-foot{
    margin-top:2px !important;
  }
}

@media (max-width:430px){

  #pulseGlobalCard{
    width:min(210px,64vw) !important;
  }

  .primary-gauge .hud-speedometer{
    width:min(138px,38vw) !important;
    height:min(138px,38vw) !important;
  }

  .hud-speedometer{
    width:min(108px,29vw) !important;
    height:min(108px,29vw) !important;
  }
}


/* =========================================================
   MOBILE ACTUAL GAUGE ENLARGEMENT — LAB ONLY
   ========================================================= */

@media (max-width:768px){

  /* Global card can use more width */
  #pulseGlobalCard{
    width:min(245px,72vw) !important;
    padding:4px 5px 5px !important;
  }

  /* ACTUAL GLOBAL CIRCLE */
  #pulseGlobalCard .hud-speedometer{
    width:165px !important;
    height:165px !important;
  }

  /* ACTUAL U.S. + EUROPE CIRCLES */
  #pulseUSCard .hud-speedometer,
  #pulseEuropeCard .hud-speedometer{
    width:128px !important;
    height:128px !important;
  }

  #pulseUSCard,
  #pulseEuropeCard{
    padding:4px 2px 5px !important;
  }

  /* Keep center text proportional — don't over-enlarge numbers */
  #pulseGlobalCard .hud-center{
    width:67px !important;
    height:67px !important;
  }

  #pulseUSCard .hud-center,
  #pulseEuropeCard .hud-center{
    width:51px !important;
    height:51px !important;
  }

  #pulseGlobalCard .hud-center span{
    font-size:29px !important;
  }

  #pulseUSCard .hud-center span,
  #pulseEuropeCard .hud-center span{
    font-size:21px !important;
  }

  /* Tighten vertical dead space */
  .hud-speedometer{
    margin-top:1px !important;
    margin-bottom:1px !important;
  }

  .hud-bottom{
    margin-top:1px !important;
  }

  .pulse-foot{
    margin-top:1px !important;
  }

  .hud-speedometer-grid{
    row-gap:4px !important;
  }
}

@media (max-width:430px){

  #pulseGlobalCard .hud-speedometer{
    width:158px !important;
    height:158px !important;
  }

  #pulseUSCard .hud-speedometer,
  #pulseEuropeCard .hud-speedometer{
    width:124px !important;
    height:124px !important;
  }
}

@media (max-width:360px){

  #pulseGlobalCard .hud-speedometer{
    width:145px !important;
    height:145px !important;
  }

  #pulseUSCard .hud-speedometer,
  #pulseEuropeCard .hud-speedometer{
    width:108px !important;
    height:108px !important;
  }
}


/* =========================================================
   MOBILE MAX GAUGE FILL — LAB ONLY
   ========================================================= */

@media (max-width:768px){

  .market-pulse-panel{
    padding-left:4px !important;
    padding-right:4px !important;
  }

  .hud-speedometer-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    column-gap:5px !important;
    row-gap:4px !important;
  }

  /* GLOBAL */
  #pulseGlobalCard{
    width:min(275px,78vw) !important;
    max-width:none !important;
    padding:3px !important;
  }

  #pulseGlobalCard .hud-speedometer{
    width:205px !important;
    height:205px !important;
  }

  /* U.S. + EUROPE */
  #pulseUSCard,
  #pulseEuropeCard{
    width:100% !important;
    padding:3px !important;
  }

  #pulseUSCard .hud-speedometer,
  #pulseEuropeCard .hud-speedometer{
    width:145px !important;
    height:145px !important;
  }

  /* Centers stay proportional */
  #pulseGlobalCard .hud-center{
    width:72px !important;
    height:72px !important;
  }

  #pulseUSCard .hud-center,
  #pulseEuropeCard .hud-center{
    width:54px !important;
    height:54px !important;
  }

  /* Remove extra breathing room */
  .hud-speedometer-card{
    padding-top:3px !important;
    padding-bottom:4px !important;
  }

  .hud-gauge-title{
    margin-bottom:0 !important;
  }

  .hud-speedometer{
    margin-top:0 !important;
    margin-bottom:0 !important;
  }

  .hud-bottom{
    margin-top:1px !important;
  }
}

@media (max-width:430px){

  #pulseGlobalCard .hud-speedometer{
    width:195px !important;
    height:195px !important;
  }

  #pulseUSCard .hud-speedometer,
  #pulseEuropeCard .hud-speedometer{
    width:142px !important;
    height:142px !important;
  }
}

@media (max-width:360px){

  #pulseGlobalCard .hud-speedometer{
    width:175px !important;
    height:175px !important;
  }

  #pulseUSCard .hud-speedometer,
  #pulseEuropeCard .hud-speedometer{
    width:122px !important;
    height:122px !important;
  }
}


/* =========================================================
   MOBILE TIGHT GAUGE CARDS — LAB ONLY
   ========================================================= */

@media (max-width:768px){

  .hud-speedometer-grid{
    row-gap:2px !important;
    column-gap:4px !important;
  }

  #pulseGlobalCard{
    width:min(285px,82vw) !important;
    padding:2px 2px 3px !important;
  }

  #pulseGlobalCard .hud-speedometer{
    width:225px !important;
    height:225px !important;
  }

  #pulseUSCard,
  #pulseEuropeCard{
    padding:2px !important;
  }

  #pulseUSCard .hud-speedometer,
  #pulseEuropeCard .hud-speedometer{
    width:154px !important;
    height:154px !important;
  }

  .hud-speedometer-card{
    min-height:0 !important;
  }

  .hud-gauge-title{
    margin:0 !important;
    line-height:1 !important;
  }

  .hud-speedometer{
    margin:0 auto !important;
  }

  .hud-bottom{
    margin-top:0 !important;
  }

  .hud-meter{
    margin-top:0 !important;
  }

  .pulse-foot{
    margin-top:0 !important;
    line-height:1 !important;
  }

  #pulseGlobalCard{
    margin-bottom:0 !important;
  }

  #pulseUSCard,
  #pulseEuropeCard{
    margin-top:0 !important;
  }
}

@media (max-width:430px){

  #pulseGlobalCard .hud-speedometer{
    width:218px !important;
    height:218px !important;
  }

  #pulseUSCard .hud-speedometer,
  #pulseEuropeCard .hud-speedometer{
    width:150px !important;
    height:150px !important;
  }
}


/* =========================================================
   MOBILE FULL GAUGE FILL — LAB ONLY
   Make the colored circles fill their cards.
   ========================================================= */

@media (max-width:768px){

  /* GLOBAL: large circle, tight card */
  #pulseGlobalCard{
    width:min(278px,78vw) !important;
    padding:2px !important;
  }

  #pulseGlobalCard .hud-speedometer{
    width:min(260px,72vw) !important;
    height:min(260px,72vw) !important;
  }

  /* U.S. + EUROPE: use almost entire half-column */
  #pulseUSCard,
  #pulseEuropeCard{
    padding:2px !important;
  }

  #pulseUSCard .hud-speedometer,
  #pulseEuropeCard .hud-speedometer{
    width:min(165px,42vw) !important;
    height:min(165px,42vw) !important;
  }

  /* Do NOT enlarge the center text further */
  #pulseGlobalCard .hud-center{
    width:72px !important;
    height:72px !important;
  }

  #pulseUSCard .hud-center,
  #pulseEuropeCard .hud-center{
    width:54px !important;
    height:54px !important;
  }

  /* Remove remaining internal gaps */
  .hud-speedometer-card{
    padding:2px !important;
  }

  .hud-speedometer{
    margin:0 auto !important;
  }

  .hud-gauge-title{
    margin:1px 0 0 !important;
  }

  .hud-bottom{
    margin:0 !important;
  }

  .pulse-foot{
    margin:0 !important;
  }
}

@media (max-width:360px){

  #pulseGlobalCard .hud-speedometer{
    width:min(225px,72vw) !important;
    height:min(225px,72vw) !important;
  }

  #pulseUSCard .hud-speedometer,
  #pulseEuropeCard .hud-speedometer{
    width:min(135px,42vw) !important;
    height:min(135px,42vw) !important;
  }
}


/* =========================================================
   MOBILE GAUGE STATUS FONT WEIGHT — LAB ONLY
   Change only the label text in the center of the gauges.
   Numbers stay unchanged.
   ========================================================= */

@media (max-width:768px){

  #pulseGlobalCard .hud-center small,
  #pulseUSCard .hud-center small,
  #pulseEuropeCard .hud-center small,
  #pulseGlobalLabel,
  #pulseUSLabel,
  #pulseEuropeLabel{
    font-weight:400 !important;
  }
}


/* =========================================================
   MOBILE GAUGE SLIGHT SIDEWAYS ENLARGEMENT — LAB ONLY
   Width only. Height unchanged.
   ========================================================= */

@media (max-width:768px){

  #pulseGlobalCard .hud-speedometer{
    width:min(275px,76vw) !important;
  }

  #pulseUSCard .hud-speedometer,
  #pulseEuropeCard .hud-speedometer{
    width:min(174px,44vw) !important;
  }
}

@media (max-width:430px){

  #pulseGlobalCard .hud-speedometer{
    width:min(268px,75vw) !important;
  }

  #pulseUSCard .hud-speedometer,
  #pulseEuropeCard .hud-speedometer{
    width:min(169px,43vw) !important;
  }
}


/* =========================================================
   MOBILE HOMEPAGE SECTION ORDER — LAB ONLY
   ========================================================= */

@media (max-width:768px){

  .home-layout > div > .hero{
    order:1 !important;
  }

  .home-layout > div > .mobile-order-market-direction{
    order:2 !important;
  }

  .home-layout > div > .mobile-order-market-focus{
    order:3 !important;
  }

  .home-layout > div > .mobile-order-daily-brief{
    order:4 !important;
  }

  .home-layout > div > .section:not(.mobile-order-market-focus):not(.mobile-order-daily-brief){
    order:10 !important;
  }
}


/* =========================================================
   MOBILE PULSE HEADING CLEANUP — LAB ONLY
   Remove Global/U.S./Europe line and reclaim the space.
   ========================================================= */

@media (max-width:768px){

  .market-pulse-panel .hud-title-row .score-label{
    display:none !important;
  }

  .market-pulse-panel .hud-title-row{
    margin-bottom:2px !important;
  }

  .hud-speedometer-grid{
    padding-top:0 !important;
  }
}


/* =========================================================
   MOBILE TOP SPACING TIGHTEN — LAB ONLY
   Keep approved gauge shapes unchanged.
   ========================================================= */

@media (max-width:768px){

  /* Remove Last Scan line */
  .market-pulse-panel .pulse-small,
  .market-pulse-panel #pulseUpdated{
    display:none !important;
  }

  /* Reduce space immediately below ribbon */
  main.page{
    padding-top:4px !important;
  }

  /* Tighten major homepage blocks */
  .home-layout > div{
    gap:6px !important;
  }

  .hero{
    gap:6px !important;
    margin:0 !important;
  }

  /* Tighten top card */
  .hero-copy{
    margin:0 !important;
  }

  /* Pull Market Pulse upward */
  .market-pulse-panel{
    margin-top:0 !important;
  }

  .hud-title-row{
    margin-top:0 !important;
    margin-bottom:1px !important;
  }

  .hud-speedometer-grid{
    padding-top:0 !important;
  }

  /* Remove unnecessary vertical separation between cards */
  .home-layout > div > .hero,
  .home-layout > div > .section{
    margin-top:0 !important;
    margin-bottom:0 !important;
  }
}

@media (max-width:430px){

  main.page{
    padding-top:3px !important;
  }

  .home-layout > div{
    gap:5px !important;
  }
}


/* =========================================================
   MOBILE HERO MINI-CARDS TIGHTEN — LAB ONLY
   ========================================================= */

@media (max-width:768px){

  .hero-points{
    gap:4px !important;
    margin-top:4px !important;
  }

  .hero-point{
    padding:4px 5px !important;
    min-height:0 !important;
    border-radius:9px !important;
  }

  .hero-point strong{
    color:#000 !important;
    font-size:8px !important;
    line-height:1 !important;
    margin-bottom:1px !important;
    font-weight:600 !important;
  }

  .hero-point span{
    color:#000 !important;
    font-size:6.3px !important;
    line-height:1.02 !important;
  }

  .hero-copy{
    padding-bottom:7px !important;
  }
}

@media (max-width:430px){

  .hero-point{
    padding:3px 4px !important;
  }

  .hero-point strong{
    font-size:7.7px !important;
  }

  .hero-point span{
    font-size:6px !important;
  }
}


/* =========================================================
   MOBILE READABLE TOP TIGHTEN — LAB ONLY
   Keep text size; reclaim space through padding/margins.
   ========================================================= */

@media (max-width:768px){

  /* Top card tighter overall */
  .hero-copy{
    padding-top:7px !important;
    padding-bottom:5px !important;
  }

  .hero-copy h1{
    margin-bottom:3px !important;
  }

  .hero-compact-note{
    margin-bottom:1px !important;
    line-height:1.14 !important;
  }

  /* Three mini cards: keep current font size */
  .hero-points{
    margin-top:3px !important;
    gap:3px !important;
  }

  .hero-point{
    padding:2px 4px !important;
    min-height:0 !important;
  }

  .hero-point strong{
    font-size:8px !important;
    line-height:1 !important;
    margin-bottom:1px !important;
  }

  .hero-point span{
    font-size:6.3px !important;
    line-height:1.05 !important;
  }

  /* Reduce separation between top card and Market Pulse */
  .home-layout > div{
    gap:3px !important;
  }

  .hero{
    gap:3px !important;
  }

  .market-pulse-panel{
    margin-top:0 !important;
  }

  /* Keep pulse title tight */
  .hud-title-row{
    margin-bottom:0 !important;
  }

  .scope-pill{
    margin-bottom:0 !important;
  }
}

@media (max-width:430px){

  .hero-point{
    padding:2px 3px !important;
  }

  .home-layout > div{
    gap:3px !important;
  }
}


/* =========================================================
   MOBILE MINI-CARD FONT BUMP — LAB ONLY
   Increase text only; keep box dimensions unchanged.
   ========================================================= */

@media (max-width:768px){

  .hero-point strong{
    font-size:8.7px !important;
  }

  .hero-point span{
    font-size:6.8px !important;
    line-height:1.08 !important;
  }
}

@media (max-width:430px){

  .hero-point strong{
    font-size:8.5px !important;
  }

  .hero-point span{
    font-size:6.6px !important;
  }
}


/* =========================================================
   MOBILE MARKET DIRECTION -> MARKET FOCUS GAP FIX
   LAB ONLY
   ========================================================= */

@media (max-width:768px){

  .mobile-order-market-direction{
    margin-bottom:2px !important;
  }

  .mobile-order-market-focus{
    margin-top:0 !important;
  }

  .home-layout > div{
    row-gap:2px !important;
  }
}


/* =========================================================
   320PX WELCOME POPUP SAFETY — LAB ONLY
   ========================================================= */

@media (max-width:360px){

  .home-welcome-backdrop{
    padding:6px !important;
  }

  .home-welcome-box{
    width:calc(100vw - 12px) !important;
    max-width:calc(100vw - 12px) !important;
    padding-left:0 !important;
    padding-right:0 !important;
  }

  .home-welcome-box *{
    max-width:100%;
    box-sizing:border-box;
  }

  .home-welcome-item{
    min-width:0 !important;
  }

  .home-welcome-item > div{
    min-width:0 !important;
  }

  .home-welcome-item h3,
  .home-welcome-item p{
    white-space:normal !important;
    overflow-wrap:break-word !important;
  }
}


/* =========================================================
   TRUE MOBILE DROPDOWN MENU — LAB ONLY
   Prevent desktop ribbon from reappearing.
   ========================================================= */

@media (max-width:768px){

  /* Keep non-menu ribbon pieces hidden even when menu is open */
  .psd-shared-header .header-center,
  .psd-shared-header .psd-learning-label,
  .psd-shared-header .site-subtitle,
  .psd-shared-header .psd-bottom-promos,
  .psd-shared-header .psd-ribbon-social-wrap{
    display:none !important;
  }

  /* CLOSED */
  .psd-shared-header .nav{
    display:none !important;
  }

  /* OPEN */
  .psd-shared-header.psd-mobile-menu-open .nav{
    display:block !important;

    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;

    margin:8px 0 0 !important;
    padding:8px !important;

    max-height:68vh !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;

    border:1px solid rgba(129,151,173,.55) !important;
    border-radius:12px !important;

    background:rgba(255,255,255,.98) !important;
    box-shadow:0 10px 28px rgba(0,0,0,.18) !important;

    transform:none !important;
  }

  /* Turn every old ribbon row into a clean mobile stack */
  .psd-shared-header.psd-mobile-menu-open .psd-nav-row,
  .psd-shared-header.psd-mobile-menu-open .psd-nav-main,
  .psd-shared-header.psd-mobile-menu-open .psd-nav-bottom{
    display:grid !important;
    grid-template-columns:1fr 1fr !important;

    width:100% !important;
    height:auto !important;
    min-height:0 !important;
    max-height:none !important;

    gap:5px !important;
    margin:0 0 5px !important;
    padding:0 !important;

    transform:none !important;
    white-space:normal !important;
  }

  /* Every navigation control becomes a real mobile button */
  .psd-shared-header.psd-mobile-menu-open .nav a,
  .psd-shared-header.psd-mobile-menu-open .psd-nav-link,
  .psd-shared-header.psd-mobile-menu-open .psd-theme-toggle{
    display:flex !important;
    align-items:center !important;
    justify-content:flex-start !important;

    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;

    min-height:38px !important;
    margin:0 !important;
    padding:7px 8px !important;

    border:1px solid rgba(129,151,173,.42) !important;
    border-radius:8px !important;

    background:#f8fbfd !important;
    color:#0a1825 !important;

    font-size:10px !important;
    line-height:1.15 !important;
    font-weight:700 !important;

    text-align:left !important;
    white-space:normal !important;

    transform:none !important;
  }

  /* AI links may keep a subtle gold treatment */
  .psd-shared-header.psd-mobile-menu-open .nav a[href*="market-pulse"],
  .psd-shared-header.psd-mobile-menu-open .nav a[href*="market-intelligence"]{
    border-color:rgba(210,153,34,.60) !important;
    background:#fff9e8 !important;
  }

  /* Sign In / Account and Dark Mode */
  .psd-shared-header.psd-mobile-menu-open #psd-account-nav-link,
  .psd-shared-header.psd-mobile-menu-open .psd-theme-toggle{
    order:initial !important;
  }

  /* Remove desktop decorative/promotional controls */
  .psd-shared-header.psd-mobile-menu-open .psd-ribbon-actions,
  .psd-shared-header.psd-mobile-menu-open .psd-ribbon-social-wrap,
  .psd-shared-header.psd-mobile-menu-open .psd-bottom-promos{
    display:none !important;
  }
}

@media (max-width:360px){

  .psd-shared-header.psd-mobile-menu-open .psd-nav-row,
  .psd-shared-header.psd-mobile-menu-open .psd-nav-main,
  .psd-shared-header.psd-mobile-menu-open .psd-nav-bottom{
    grid-template-columns:1fr !important;
  }
}


/* =========================================================
   SEPARATE MOBILE MENU PANEL — LAB ONLY
   ========================================================= */

@media (max-width:768px){

  .psd-shared-header .nav{
    display:none !important;
  }

  .psd-mobile-menu-panel{
    display:none;
    width:100%;
    margin-top:8px;
    padding:8px;
    border:1px solid rgba(129,151,173,.55);
    border-radius:12px;
    background:#fff;
    box-shadow:0 10px 28px rgba(0,0,0,.18);
    box-sizing:border-box;
  }

  .psd-mobile-menu-panel.open{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:6px;
  }

  .psd-mobile-menu-panel a,
  .psd-mobile-menu-panel button{
    display:flex;
    align-items:center;
    justify-content:flex-start;
    width:100%;
    min-width:0;
    min-height:38px;
    padding:8px 9px;
    border:1px solid rgba(129,151,173,.42);
    border-radius:8px;
    background:#f8fbfd;
    color:#0a1825;
    font:700 10px/1.15 "Inter","Segoe UI",Arial,sans-serif;
    text-decoration:none;
    text-align:left;
    box-sizing:border-box;
  }

  .psd-mobile-menu-panel a[href*="market-pulse"],
  .psd-mobile-menu-panel a[href*="market-intelligence"]{
    border-color:rgba(210,153,34,.60);
    background:#fff9e8;
  }

  body.dark-mode .psd-mobile-menu-panel{
    background:#111821;
  }

  body.dark-mode .psd-mobile-menu-panel a,
  body.dark-mode .psd-mobile-menu-panel button{
    background:#18202b;
    color:#fff;
    border-color:#334155;
  }
}

@media (max-width:360px){
  .psd-mobile-menu-panel.open{
    grid-template-columns:1fr;
  }
}
