/* responsive.css
   Older screen-size rules (tablet and phone) for the dashboard, goals, and pop-ups.
*/

@media (max-width:1100px){
  .metro-grid{grid-template-columns:repeat(8,minmax(0,1fr));grid-auto-rows:clamp(100px,calc((100svh - 82px) / 5),142px);}
}
@media (max-width:900px){
  .metro-grid{grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:clamp(104px,calc((100svh - 84px) / 5),142px);}
  .metro-tile{padding:12px;}
  .metro-tile h3{font-size:clamp(15px,2.4vw,23px);line-height:1.03;}
  .module-simple h3{font-size:clamp(12px,2.5vw,18px)!important;line-height:1.02;max-width:100%;white-space:normal;overflow-wrap:normal;word-break:normal;}
  .tile-note{font-size:10px!important;line-height:1.15!important;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
  .timeline-tile{overflow:visible;min-height:calc(100svh - 58px);}
  .timeline-main-stage{padding:60px 14px 22px 58px;}
  .timeline-history-figure{height:clamp(360px,58svh,560px);}
  .forecast-strip{grid-template-columns:repeat(2,minmax(0,1fr));}
  .goals-shell{padding:12px;}
  .goal-real-app{min-height:calc(100svh - 24px);}
  .goal-main-stage{padding:20px 16px 20px 56px;gap:18px;}
  .goal-deck-nav{width:48px;min-height:48px;}
  .goal-reflection-layout{grid-template-columns:1fr;}
  .goal-learn-stage,.goal-learn-focus{min-height:calc(100svh - 124px);padding:18px 10px;}
  .learn-strategy-deck-wrap{height:330px;}
  .learn-strategy-card{width:142px;height:198px;}
  .goal-strategy-steps{grid-template-columns:1fr;}
  .tutorial-card{left:14px!important;right:14px!important;top:auto!important;bottom:14px!important;width:auto;}
}
@media (max-width:620px){
  .metro-page{padding:8px;gap:7px;}
  .dashboard-header{margin:-8px -8px 0;padding:12px 10px;}
  .metro-grid{grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:clamp(74px,13.5svh,104px);gap:7px;min-height:calc(100svh - 50px);}
  .tile-wide,.tile-large{grid-column:span 2;}
  .tile-mega{grid-column:span 4;}
  .tile-large,
.tile-mega{grid-row:span 2;}
  .ddi-complete-tile{grid-row:span 2;}
  .metro-tile{padding:10px;}
  .metro-tile p{font-size:11px;line-height:1.22;margin-top:5px;}
  .module-simple h3{font-size:clamp(14px,4.4vw,20px)!important;}
  .metro-tile:not(.tile-wide):not(.tile-large):not(.tile-mega) h3{font-size:clamp(13px,4vw,18px)!important;}
  .tile-time{font-size:10px;}
  .timeline-main-stage{padding:58px 10px 20px;}
  .timeline-app-view{min-height:calc(100svh - 112px);}
  .timeline-history-figure{height:clamp(330px,55svh,520px);}
  .forecast-strip{grid-template-columns:1fr 1fr;}
  .forecast-day{min-height:112px;border-radius:0;padding:12px 10px;}
  .consent-overlay{padding:8px;}
  .consent-modal{width:100%;max-height:calc(100vh - 16px);max-height:calc(100svh - 16px);padding:16px;box-shadow:0 20px 60px rgba(0,0,0,.5);}
  .consent-modal h2{font-size:24px;line-height:1.08;}
  .consent-modal p{font-size:13px;line-height:1.4;margin-top:8px;}
  .consent-fields{grid-template-columns:1fr;}
  .consent-fields input,.consent-fields select,.password-reset-panel input{padding:11px;font-size:16px;}
  .consent-check{font-size:13px;line-height:1.35;margin-top:12px;}
  .captcha-panel{padding:10px;margin-top:10px;overflow:hidden;}
  .consent-modal .btn-row{gap:8px;}
  .consent-modal .btn{width:100%;padding:12px 14px;}
  .verification-panel{padding:10px 0 2px;}
  .verification-check,.verification-mail{width:64px;height:64px;font-size:34px;margin-bottom:10px;}
  .verification-panel h3{font-size:21px;}
  .legal-copy{max-height:calc(100vh - 190px);max-height:calc(100svh - 190px);padding:12px;}
  .goals-shell{padding:8px;}
  .goal-real-app{min-height:calc(100svh - 16px);}
  .goal-main-stage{padding:62px 12px 18px;gap:16px;}
  .goal-deck-nav{width:48px;min-height:48px;}
  .goal-deck-nav.is-open,
  .goal-deck-nav:hover,
  .goal-deck-nav:focus-within{width:min(152px,calc(100vw - 24px));min-height:296px;}
  .goal-deck-toggle{width:48px;height:48px;}
  .goal-deck-card,
  .compact-nav-cards button{width:min(138px,calc(100vw - 84px));min-height:38px;font-size:11px;padding:6px 8px;}
  .goal-card-large,.goal-big-card{padding:14px;border-radius:0;}
  .goal-big-head{grid-template-columns:1fr;gap:10px;}
  .goal-card-collection .goal-big-card .goal-cadence-track{grid-template-columns:1fr;}
  .goal-builder-card{padding:14px;border-radius:0;}
  .goal-builder-row{grid-template-columns:1fr;}
  .goal-builder-strategy-deck{min-height:216px;overflow:visible!important;}
  .goal-builder-strategy-card{width:110px;height:160px;padding:11px;border-radius:0;}
  .goal-builder-strategy-card b{font-size:12.5px;}
  .goal-builder-strategy-card span{font-size:9.5px;}
  .goal-builder-strategy-card:nth-child(1){transform:translate(-104px,7px) rotate(-16deg);}
  .goal-builder-strategy-card:nth-child(2){transform:translate(-70px,-7px) rotate(-10deg);}
  .goal-builder-strategy-card:nth-child(3){transform:translate(-35px,-15px) rotate(-5deg);}
  .goal-builder-strategy-card:nth-child(4){transform:translate(0,-18px) rotate(0deg);}
  .goal-builder-strategy-card:nth-child(5){transform:translate(35px,-15px) rotate(5deg);}
  .goal-builder-strategy-card:nth-child(6){transform:translate(70px,-7px) rotate(10deg);}
  .goal-builder-strategy-card:nth-child(7){transform:translate(104px,7px) rotate(16deg);}
  .goal-builder-strategy-card.active{transform:translate(0,-32px) rotate(0deg) scale(1.05)!important;}
  .goal-area-board{grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:minmax(70px,1fr);gap:4px;row-gap:3px;}
  .goal-area-tile{min-height:70px;padding:8px;grid-column:span var(--span,1);}
  .goal-area-name{font-size:11px;}
  .goal-learn-intro h2,.goal-strategy-focus h2{font-size:clamp(36px,12vw,56px);}
  .goal-learn-intro p,.goal-strategy-focus p{font-size:14px!important;}
  .learn-goal-card{width:min(100%,390px);min-height:250px;padding:18px;}
  .learn-goal-card label{font-size:clamp(32px,10vw,48px);}
  .learn-goal-card textarea{min-height:112px;font-size:15px;}
  .learn-goal-card.is-written b{font-size:clamp(28px,9vw,44px);}
  .learn-strategy-deck-wrap{height:300px;touch-action:pan-y;}
  .learn-deck-core{width:142px;height:192px;border-radius:0;}
  .learn-deck-core b{font-size:20px;}
  .learn-strategy-card{width:116px;height:168px;padding:11px;border-radius:0;}
  .learn-strategy-card b{font-size:13px;}
  .learn-strategy-card span{font-size:10.5px;}
  .learn-strategy-card{--fx:var(--fan-x-sm,0px);--fy:var(--fan-y-sm,0px);--fr:var(--fan-rot-sm,0deg);}
  .goal-strategy-focus{border-radius:0;padding:20px;}
  .goal-strategy-focus-top{align-items:flex-start;flex-direction:column;}
  .goal-create-hub{margin-top:8px;}
  .goal-create-button{width:min(100%,260px);}
  .goal-thread-page{min-height:calc(100svh - 108px);grid-template-rows:auto minmax(510px,1fr);}
  .goal-thread-stage{min-height:510px;}
  .goal-rope{width:164px;}
  .goal-thread-panel{width:148px;min-height:88px;padding:11px;}
  .goal-thread-panel b{font-size:9.5px;}
  .goal-thread-panel span{font-size:10.5px;}
  .goal-projector{min-height:510px;padding:0 8px;}
  .goal-projector-screen{padding:26px 18px;}
  .goal-projector-grid{grid-template-columns:1fr;gap:10px;}
}
@media (max-width:420px){
  .goal-area-board{grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:minmax(64px,1fr);gap:4px;row-gap:3px;}
  .goal-area-tile{min-height:64px;padding:7px;}
  .goal-area-name{font-size:clamp(7px,2vw,9px);white-space:nowrap;overflow:hidden;text-overflow:clip;}
  .goal-reflection-layout{grid-template-columns:1fr;}
  .learn-strategy-deck-wrap{height:280px;touch-action:pan-y;}
  .learn-goal-card{min-height:232px;padding:16px;border-radius:0;}
  .learn-goal-card label{font-size:clamp(28px,10vw,40px);}
  .learn-goal-card textarea{min-height:104px;font-size:14px;}
  .learn-goal-card .goal-primary-button{width:100%;}
  .learn-goal-card-top{align-items:flex-start;flex-direction:column;}
  .learn-strategy-card{--fx:var(--fan-x-xs,0px);--fy:var(--fan-y-xs,0px);--fr:var(--fan-rot-xs,0deg);}
  .goal-option-grid{grid-template-columns:repeat(6,minmax(0,1fr));}
  .goal-builder-strategy-deck{min-height:196px;overflow:visible!important;}
  .goal-builder-strategy-card{width:96px;height:146px;padding:9px;}
  .goal-builder-strategy-card:nth-child(1){transform:translate(-84px,7px) rotate(-16deg);}
  .goal-builder-strategy-card:nth-child(2){transform:translate(-56px,-6px) rotate(-10deg);}
  .goal-builder-strategy-card:nth-child(3){transform:translate(-28px,-13px) rotate(-5deg);}
  .goal-builder-strategy-card:nth-child(4){transform:translate(0,-16px) rotate(0deg);}
  .goal-builder-strategy-card:nth-child(5){transform:translate(28px,-13px) rotate(5deg);}
  .goal-builder-strategy-card:nth-child(6){transform:translate(56px,-6px) rotate(10deg);}
  .goal-builder-strategy-card:nth-child(7){transform:translate(84px,7px) rotate(16deg);}
}
@media (hover:none){
  .learn-strategy-deck-wrap:not(.is-open) .learn-strategy-card{
    pointer-events:none;
  }
  .goal-deck-nav:hover .goal-deck-card,
  .learn-strategy-deck-wrap:hover .learn-strategy-card{
    opacity:0;
    pointer-events:none;
  }
  .goal-deck-nav:hover:not(.is-open) .goal-deck-card{
    transform:translateX(0) translateY(0) scale(.72)!important;
  }
  .learn-strategy-deck-wrap:hover:not(.is-open) .learn-strategy-card{
    transform:translate(-50%,-50%) rotate(calc(var(--fan-rot,0deg) * .16)) translateY(calc(var(--i,0) * 1px))!important;
  }
  .goal-deck-nav.is-open .goal-deck-card,
  .learn-strategy-deck-wrap.is-open .learn-strategy-card{
    opacity:1;
    pointer-events:auto;
  }
  .learn-strategy-deck-wrap:hover .learn-deck-core{
    opacity:1;
    pointer-events:auto;
    transform:translate(-50%,-50%);
  }
  .learn-strategy-deck-wrap.is-open .learn-deck-core{
    opacity:0;
    pointer-events:none;
    transform:translate(-50%,-50%) scale(.88);
  }
}
/* Touch: the card under the thumb (touch-active) and the card picked for a closer look (touch-preview)
   lift straight up where they sit in the fan. They used to be moved with whole transforms, which on
   phones threw the edge cards off the screen (the preview used the desktop fan spacing) and sent the
   white deck's card to the middle. The translate and scale properties add to each card's own fan
   transform, at every screen size, without replacing it. */
.learn-strategy-card,.goal-builder-strategy-card{
  -webkit-tap-highlight-color:transparent;
  translate:0 0;scale:1;
  transition:transform .42s cubic-bezier(.18,.82,.2,1),translate .16s ease,scale .16s ease,filter .18s ease,box-shadow .18s ease,opacity .18s ease;
}
.learn-strategy-card.touch-active,
.goal-builder-strategy-card.touch-active{
  translate:0 -14px;
  z-index:12!important;
  filter:brightness(1.06);
  outline:3px solid rgba(242,179,61,.58);
  outline-offset:3px;
  box-shadow:0 24px 58px rgba(15,26,23,.22)!important;
}
.learn-strategy-card.touch-preview,
.goal-builder-strategy-card.touch-preview{
  translate:0 -22px;
  scale:1.05;
  z-index:13!important;
  outline:3px solid rgba(242,179,61,.78);
  outline-offset:4px;
}
@media (max-width:620px){
  .metro-grid{
    grid-auto-rows:clamp(68px,12.4svh,96px);
    gap:6px;
  }
  .metro-tile{padding:8px;}
  .metro-tile h3,
.module-simple h3{
    overflow:visible!important;
    text-overflow:clip!important;
    overflow-wrap:normal;
    word-break:keep-all;
    hyphens:none;
  }
  .module-simple h3{font-size:clamp(8px,2.45vw,13px)!important;line-height:1;white-space:nowrap!important;padding-inline:3px;}
  .tile-done::before{right:6px;top:4px;font-size:clamp(15px,5.2vw,21px);}
  .tile-lock::after{right:7px;bottom:6px;font-size:9px;}
  .ddi-complete-tile{padding:8px;}
  .ddi-complete-tile > div:first-child{display:grid;gap:2px;}
  .ddi-complete-tile h3{font-size:clamp(17px,5.2vw,23px)!important;line-height:.98;}
  .ddi-complete-tile > div:first-child > p{font-size:10px;line-height:1.08;margin-top:1px;}
  .ddi-tile-footer{margin-top:2px;}
  .ddi-tile-footer .tile-note{font-size:9px!important;line-height:1.08!important;-webkit-line-clamp:1;}
  .insight-shell{padding:10px;}
  .insight-stage{gap:10px;}
  .insight-stage.first-pass-stage{grid-template-rows:auto minmax(64svh,auto) auto;}
  .insight-stage.first-pass-stage:has(.sart-insight-pad){grid-template-rows:auto minmax(350px,auto) auto;gap:6px;}
  .insight-title-card{gap:5px;}
  .insight-title-card h2{font-size:clamp(26px,8.2vw,38px);line-height:1.06;padding:0 52px;}
  .insight-title-card p{font-size:12px!important;line-height:1.25!important;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;}
  .insight-object-pad{border-radius:0;min-height:58svh;}
  .sart-insight-pad{min-height:350px!important;}
  .first-pass-object{min-height:64svh;}
  .sart-insight-pad.first-pass-object{min-height:350px!important;}
  .first-pass-object .insight-object{inset:10px;}
  .sart-insight-pad.first-pass-object .insight-object{inset:0 2px;}
  .sleep-phone{width:48px;height:78px;border-radius:0;}
  .switchboard{inset:4% 2% 15%;gap:10px;}
  .signal-bank{gap:10px;}
  .switch-node{width:clamp(92px,39vw,130px);min-height:52px;border-radius:0;font-size:12px;padding:8px;}
  .switch-cable{height:4px;width:30%;}
  .insight-actions .btn{width:auto;min-height:40px;padding:10px 13px;}
  .goals-shell{padding:6px;}
  .goal-real-app{min-height:calc(100svh - 12px);}
  .goal-main-stage{padding:56px 8px 16px;gap:14px;}
  .metro-page.expanded-mode .goal-deck-portal,
  .metro-page.expanded-mode .timeline-deck-portal{left:8px;top:8px;z-index:31;}
  .goal-deck-nav{width:48px;min-height:48px;pointer-events:none;}
  .goal-deck-nav.is-open{width:min(146px,calc(100vw - 16px));min-height:296px;}
  .goal-deck-toggle{width:48px;height:48px;pointer-events:auto;}
  .goal-deck-cards,
  .compact-nav-cards{width:142px;height:296px;pointer-events:none;}
  .timeline-deck-nav.is-open{min-height:180px;}
  .timeline-deck-cards{height:180px;}
  .goal-deck-nav.is-open .goal-deck-cards{pointer-events:auto;}
  .goal-deck-card,
  .compact-nav-cards button{width:132px;min-height:42px;font-size:11px;padding:7px 9px;}
  .goal-create-button{padding:13px 22px;font-size:clamp(18px,6vw,24px);}
  .goal-area-filter{justify-items:stretch;}
  .goal-filter-chip{max-width:100%;justify-self:stretch;}
  .goal-area-board{grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:minmax(56px,1fr);}
  .goal-area-name{font-size:clamp(7.5px,2.25vw,10px);line-height:1;white-space:nowrap;overflow:hidden;text-overflow:clip;}
  .goal-card-collection{grid-template-columns:repeat(auto-fit,minmax(118px,1fr));gap:8px;margin-top:0;}
  .goal-compact-card{min-height:172px;padding:10px;gap:5px;border-radius:0;}
  .goal-compact-icon{width:30px;height:30px;font-size:18px;border-radius:0;}
  .goal-compact-card b{font-size:clamp(15px,4.2vw,19px);line-height:1;}
  .goal-compact-target,.goal-compact-window{font-size:9px;}
  .goal-compact-strategy{font-size:10.5px;line-height:1.12;}
  .goal-compact-stamp{font-size:9.5px;line-height:1.14;padding:5px;}
  .goal-card-collection .goal-big-card{width:100%;}
  .goal-card-collection .goal-big-card .goal-cadence-track{grid-template-columns:1fr;}
  .goal-builder-active-card{width:min(100%,340px);min-height:auto;padding:14px;gap:9px;border-radius:0;}
  .goal-builder-strategy-title{font-size:clamp(26px,9vw,38px);}
  .goal-builder-active-card p{font-size:12px!important;line-height:1.28!important;}
  .goal-builder-field input,.goal-builder-field select,.goal-builder-step-field textarea{font-size:13px!important;padding:10px!important;}
  .goal-builder-row{grid-template-columns:1fr;}
  .goal-builder-strategy-deck{width:100%;min-height:170px!important;margin-top:-8px;touch-action:pan-y;}
  .goal-builder-strategy-card{width:86px!important;height:126px!important;padding:8px!important;border-radius:0!important;}
  .goal-builder-strategy-card b{font-size:10.5px!important;line-height:1.02;}
  .goal-builder-strategy-card span{font-size:8.2px!important;line-height:1.14;}
  .goal-builder-strategy-card:nth-child(1){transform:translate(-72px,7px) rotate(-16deg);}
  .goal-builder-strategy-card:nth-child(2){transform:translate(-48px,-5px) rotate(-10deg);}
  .goal-builder-strategy-card:nth-child(3){transform:translate(-24px,-11px) rotate(-5deg);}
  .goal-builder-strategy-card:nth-child(4){transform:translate(0,-14px) rotate(0deg);}
  .goal-builder-strategy-card:nth-child(5){transform:translate(24px,-11px) rotate(5deg);}
  .goal-builder-strategy-card:nth-child(6){transform:translate(48px,-5px) rotate(10deg);}
  .goal-builder-strategy-card:nth-child(7){transform:translate(72px,7px) rotate(16deg);}
  .goal-builder-strategy-card.active{transform:translate(0,-24px) rotate(0deg) scale(1.04)!important;}
  .goal-corner-picker.icon-picker{grid-template-columns:repeat(4,30px);}
  .goal-corner-picker.color-picker{left:0;top:94px;}
  .goal-confirm-print{inset:62px 16px 22px;}
  .goal-confirm-print b{font-size:clamp(22px,7vw,32px);}
  .goal-confirm-print span{font-size:12px;padding:10px;}
  .goal-reflection-page{gap:12px;}
  .write-note-card{min-height:118px;padding:22px 16px 20px 44px;}
  .write-note-card b{font-size:clamp(28px,10vw,42px);}
  .goal-reflection-composer{padding:22px 14px 18px 44px;}
  .reflection-compose-top{align-items:flex-start;gap:8px;}
  .reflection-compose-top b{font-size:24px;}
  .goal-reflection-form textarea,.goal-reflection-form select{min-width:0;font-size:13px;padding:10px;}
  .goal-reflection-item{padding:20px 14px 16px 44px;}
  .goal-reflection-item p{font-size:13px!important;line-height:1.55!important;overflow-wrap:break-word;}
  .goal-thread-page{min-height:calc(100svh - 74px);grid-template-rows:auto minmax(420px,1fr);}
  .goal-thread-stage{min-height:420px;margin-top:-16px;}
  .goal-thread-panel{width:132px;min-height:78px;padding:9px;}
  .goal-thread-panel span{font-size:9.8px;}
  .goal-thread-rail{height:38px;}
  .goal-projector{min-height:420px;}
  #screen-cognitive.active{padding:12px 8px;}
  #screen-cognitive .task-shell{gap:10px;}
  #screen-cognitive .task-meta{font-size:11px;gap:7px;}
  #screen-cognitive .task-stage{padding:14px 10px;border-radius:0;max-width:100%;overflow:hidden;}
  #screen-cognitive .task-stage h2{font-size:clamp(22px,8vw,34px);}
  #screen-cognitive .task-stage p{font-size:13px;line-height:1.35;}
  #screen-cognitive .task-topbar{grid-template-columns:1fr;gap:7px;font-size:11px;padding:8px;}
  #screen-cognitive .task-stimulus{min-height:96px;margin:10px 0;padding:10px;border-radius:0;}
  #screen-cognitive .pattern-pair{gap:5px;width:100%;max-width:100%;}
  #screen-cognitive .pattern-card{min-height:clamp(58px,20vw,74px);padding:2px;border-radius:0;}
  #screen-cognitive .pattern-svg{width:min(92px,31vw)!important;max-width:100%;}
  #screen-cognitive .pattern-svg line{stroke-width:5;}
  #screen-cognitive .task-options{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;}
  #screen-cognitive .task-options button,
  #screen-cognitive .task-input-row button{min-height:44px;padding:9px 8px;font-size:13px;border-radius:0;}
  #screen-cognitive .pvt-task{min-height:240px;}
  #screen-cognitive .pvt-field{height:min(48svh,210px);margin:8px auto;border-radius:0;}
  #screen-cognitive .pvt-target{width:clamp(82px,27vw,104px);height:clamp(82px,27vw,104px);font-size:14px;box-shadow:0 0 0 10px rgba(255,179,111,.20),0 14px 32px rgba(0,0,0,.24);}
}
@media (max-width:380px){
  .metro-grid{grid-auto-rows:clamp(64px,11.8svh,88px);gap:5px;}
  .metro-tile{padding:7px;}
  .module-simple h3{font-size:clamp(7.2px,2.15vw,10px)!important;}
  .ddi-tile-footer{display:none!important;}
  .first-pass-object{min-height:68svh;}
  .goal-main-stage{padding-left:6px;padding-right:6px;}
  .goal-card-collection{grid-template-columns:repeat(auto-fit,minmax(104px,1fr));}
  .goal-compact-card{min-height:158px;}
  .goal-builder-active-card{width:100%;}
  #screen-cognitive .pattern-svg{width:min(78px,29vw)!important;}
  #screen-cognitive .pvt-field{height:min(44svh,190px);}
}
