/* ======================================================================
   GritHQ Alpha4.70 — Home information architecture v2
   Approved direction: premium dark fitness dashboard, restrained semantic
   glow, one global Coach entry, no duplicated Coach feature cards.
   ====================================================================== */

:root{
  --gh470-bg:#040b13;
  --gh470-panel:#07121d;
  --gh470-panel-2:#091724;
  --gh470-line:rgba(100,132,164,.30);
  --gh470-text:#f5f8fb;
  --gh470-muted:#96a6b7;
  --gh470-blue:#2995ff;
  --gh470-cyan:#28d5de;
  --gh470-green:#79d93a;
  --gh470-purple:#ad55ed;
  --gh470-orange:#f3a91f;
}

/* Global mobile header: brand + one Coach entry. The old menu/profile shortcuts
   were redundant with the four-tab dock and are intentionally removed. */
@media(max-width:959px){
  .mobile-appbar>.appbar-icon{display:none!important}
  .mobile-appbar{grid-template-columns:minmax(0,1fr) auto!important}
  .mobile-brand-row{justify-self:start!important;margin:0!important}
  .mobile-brand-row .brand-logo-img{width:126px!important;max-width:126px!important;height:auto!important}
  .topbar-actions{gap:7px!important}
  .build-chip{display:none!important}
}
.global-coach-btn{
  width:44px;height:44px;padding:3px;border-radius:50%;border:1px solid rgba(93,157,220,.50);
  background:linear-gradient(145deg,rgba(96,51,164,.24),rgba(16,101,154,.17));
  display:grid;place-items:center;overflow:hidden;cursor:pointer;
  box-shadow:0 0 0 1px rgba(134,75,211,.10),0 4px 15px rgba(0,0,0,.24);
}
.global-coach-btn img{width:100%;height:100%;object-fit:cover;border-radius:50%;filter:saturate(.78) brightness(.93) contrast(.96)}
.global-coach-btn:focus-visible{outline:2px solid var(--gh470-blue);outline-offset:2px}

/* Home gets the same shell mechanics as the other primary tabs: the header and
   dock own their rows, while the center may scroll only if accessibility or
   an unusually short viewport requires it. Default supported iPhones fit. */
@media(max-width:959px){
  body.home-mode{height:100dvh!important;max-height:100dvh!important;overflow:hidden!important}
  body.home-mode .app-shell{height:100dvh!important;max-height:100dvh!important;overflow:hidden!important}
  body.home-mode .app-stage{
    display:grid!important;grid-template-rows:auto minmax(0,1fr) auto!important;
    height:100dvh!important;max-height:100dvh!important;min-height:0!important;overflow:hidden!important
  }
  body.home-mode .mobile-appbar{grid-row:1!important;position:relative!important;inset:auto!important;z-index:3!important}
  body.home-mode .main-content{
    grid-row:2!important;height:100%!important;min-height:0!important;max-height:none!important;
    overflow-x:hidden!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;
    padding:8px 12px 8px!important;scrollbar-width:none
  }
  body.home-mode .main-content::-webkit-scrollbar{display:none}
  body.home-mode .bottom-nav{
    grid-row:3!important;position:relative!important;inset:auto!important;left:auto!important;right:auto!important;bottom:auto!important;
    transform:none!important;width:auto!important;height:58px!important;min-height:58px!important;
    margin:5px 10px calc(5px + env(safe-area-inset-bottom))!important;padding:4px!important;
    border-radius:17px!important;background:rgba(4,12,20,.985)!important;border:1px solid rgba(83,118,151,.34)!important;
    box-shadow:0 8px 24px rgba(0,0,0,.28)!important;z-index:4!important
  }
  body.home-mode .bottom-nav .nav-btn{min-height:48px!important}
}

.gh-home-v2{display:grid;gap:11px;max-width:920px;margin:0 auto;color:var(--gh470-text)}
.gh-home-v2 .card{background:linear-gradient(150deg,rgba(9,23,36,.98),rgba(5,15,25,.99))!important;border:1px solid var(--gh470-line)!important;box-shadow:0 9px 22px rgba(0,0,0,.16)!important}
.gh-home-v2-greeting{padding:3px 5px 2px}
.gh-home-v2-greeting h1{margin:0;font-size:22px;line-height:1.1;letter-spacing:-.035em;color:var(--gh470-text)}
.gh-home-v2-greeting p{margin:4px 0 0;font-size:13px;line-height:1.25;color:var(--gh470-muted)}

/* TODAY'S PLAN */
.gh-home-v2-plan{position:relative;overflow:hidden;border-color:rgba(41,149,255,.56)!important;padding:16px!important;min-height:208px;display:flex;flex-direction:column;justify-content:space-between}
.gh-home-v2-plan:before{content:'';position:absolute;inset:0 0 0 auto;width:47%;background:url('../../assets/home-hero-a422.jpg') 69% 50%/cover no-repeat;opacity:.28;filter:saturate(.68) contrast(.92)}
.gh-home-v2-plan:after{content:'';position:absolute;inset:0;background:linear-gradient(90deg,rgba(6,17,28,.99) 0%,rgba(6,17,28,.96) 49%,rgba(6,17,28,.64) 70%,rgba(6,17,28,.15) 100%);pointer-events:none}
.gh-home-v2-plan>*{position:relative;z-index:1}
.gh-home-v2-plan-kicker,.gh-home-v2-section-title,.gh-home-v2-week-count>span{display:flex;align-items:center;gap:8px;font-size:10px;font-weight:850;letter-spacing:.15em;text-transform:uppercase}
.gh-home-v2-plan-kicker{color:var(--gh470-blue)}
.gh-home-v2-plan-kicker svg,.gh-home-v2-section-title svg,.gh-home-v2-week-count svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.gh-home-v2-plan-copy{max-width:63%;margin-top:12px}
.gh-home-v2-mode{margin:0 0 2px;color:#63aff7;font-size:9px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.gh-home-v2-plan-copy h2{margin:0;font-size:25px;line-height:1.06;letter-spacing:-.035em;color:var(--gh470-text)}
.gh-home-v2-plan-copy>p:not(.gh-home-v2-mode){margin:8px 0 0;font-size:11px;line-height:1.38;color:var(--gh470-muted);max-width:350px}
.gh-home-v2-plan-meta{display:flex;align-items:center;gap:7px;margin-top:7px;color:#a8b5c2;font-size:11px;font-weight:650}.gh-home-v2-plan-meta i{font-style:normal;color:#52708b}
.gh-home-v2-recovery-note{display:flex;align-items:center;gap:6px;margin-top:9px;font-size:11px;font-weight:720;color:#9fb0c0}.gh-home-v2-recovery-note svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8}.gh-home-v2-recovery-note.good{color:var(--gh470-green)}.gh-home-v2-recovery-note.caution{color:#efb04b}
.gh-home-v2-plan-actions{display:grid;grid-template-columns:minmax(150px,1.25fr) minmax(120px,.9fr);gap:10px;max-width:540px;margin-top:14px}
.gh-home-v2-plan-actions .primary{min-height:48px!important;border-radius:11px!important;background:linear-gradient(135deg,#1d72df,#1763c6)!important;border:1px solid rgba(79,168,255,.78)!important;box-shadow:0 4px 15px rgba(22,99,201,.22)!important;color:#fff!important;font-size:13px!important}
.gh-home-v2-link{min-height:48px;border-radius:11px;border:1px solid rgba(79,134,186,.44);background:rgba(5,16,27,.58);color:#75baff;font-size:12px;font-weight:760;display:flex;align-items:center;justify-content:center;gap:7px}

/* RECOVERY */
.gh-home-v2-recovery{padding:14px 16px!important;border-color:rgba(102,190,69,.46)!important}
.gh-home-v2-section-title.recovery{color:#84d94f;margin-bottom:10px}.gh-home-v2-section-title.quick{color:var(--gh470-orange);margin-bottom:10px}
.gh-home-v2-recovery-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) auto;align-items:center;gap:0}
.gh-home-v2-recovery-metric{min-height:88px;display:grid;place-items:center;align-content:center;gap:2px;border-right:1px solid rgba(92,121,149,.28);text-align:center;padding:0 9px}
.gh-home-v2-recovery-metric strong{font-size:19px;line-height:1.05;color:#f4f8fb}.gh-home-v2-recovery-metric>span:not(.gh-home-v2-metric-icon){font-size:11px;font-weight:720;color:#dce5ec}.gh-home-v2-recovery-metric small{font-size:9px;color:var(--gh470-muted)}
.gh-home-v2-recovery-metric.readiness strong{width:54px;height:54px;border-radius:50%;display:grid;place-items:center;border:3px solid rgba(121,217,58,.82);font-size:16px;color:#fff;background:rgba(73,128,44,.08)}
.gh-home-v2-recovery-metric.readiness small{color:#83d852}
.gh-home-v2-metric-icon{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;margin-bottom:2px;border:1px solid currentColor}.gh-home-v2-metric-icon svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7}.gh-home-v2-recovery-metric.sleep .gh-home-v2-metric-icon{color:#a864e8}.gh-home-v2-recovery-metric.sleep small{color:#aa71e7}.gh-home-v2-recovery-metric.hrv .gh-home-v2-metric-icon{color:#35c8de}.gh-home-v2-recovery-metric.hrv small{color:#46cadb}
.gh-home-v2-health-btn{min-height:44px!important;margin-left:12px!important;padding:0 13px!important;border-radius:10px!important;border-color:rgba(121,217,58,.58)!important;background:rgba(71,139,43,.10)!important;color:#c6f0ad!important;font-size:11px!important;white-space:nowrap}

/* QUICK ACTIONS */
.gh-home-v2-quick{padding:13px 16px 14px!important;border-color:rgba(204,139,32,.44)!important}
.gh-home-v2-quick-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.gh-home-v2-action{min-height:94px;border-radius:13px;border:1px solid rgba(93,124,153,.34);background:rgba(5,15,25,.52);display:grid;place-items:center;align-content:center;gap:3px;padding:9px;color:#dce6ee}
.gh-home-v2-action>span{width:39px;height:39px;border-radius:10px;display:grid;place-items:center;margin-bottom:2px;border:1px solid currentColor;background:rgba(255,255,255,.018)}.gh-home-v2-action svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.gh-home-v2-action strong{font-size:13px;color:#f0f4f7}.gh-home-v2-action small{font-size:9px;line-height:1.2;color:#8f9faf;text-align:center}
.gh-home-v2-action.timer{color:#e7a936;border-color:rgba(231,169,54,.44)}.gh-home-v2-action.mobility{color:#a761e5;border-color:rgba(167,97,229,.42)}.gh-home-v2-action.log{color:#34cadd;border-color:rgba(52,202,221,.40)}

/* THIS WEEK */
.gh-home-v2-week{padding:10px 13px!important;display:grid;grid-template-columns:88px minmax(0,1fr) 92px;align-items:center;gap:10px;border-color:rgba(58,119,178,.34)!important}
.gh-home-v2-week-count{display:grid;gap:1px}.gh-home-v2-week-count>span{color:#56a9f8;font-size:8.5px;letter-spacing:.11em}.gh-home-v2-week-count svg{width:14px;height:14px}.gh-home-v2-week-count strong{font-size:19px;line-height:1.1}.gh-home-v2-week-count small{font-size:9px;color:#8fa0b1}
.gh-home-v2-week-days{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}.gh-home-v2-week-days>span{display:grid;justify-items:center;gap:3px}.gh-home-v2-week-days b{font-size:7.5px;font-weight:650;color:#78899a}.gh-home-v2-week-days i{width:20px;height:20px;border-radius:50%;border:1px solid #3b5064;display:grid;place-items:center;font-style:normal;font-size:10px;color:#061019}.gh-home-v2-week-days .done i{background:#75cc3f;border-color:#83dc4d}.gh-home-v2-week-days .today i{box-shadow:0 0 0 2px rgba(41,149,255,.44)}.gh-home-v2-week-days .future{opacity:.65}
.gh-home-v2-week .gh-home-v2-link{min-height:36px;border:0;background:transparent;padding:0;color:#61aefa;font-size:10px;justify-content:flex-end}

/* Toned-down semantic glow across the shared icon system. */
.gh-neon-icon svg,.gh-training-mode-control-icon svg,.gh-profile-row-icon svg,.gh-profile-quick svg{filter:none!important}
.gh-neon-icon,.gh-training-mode-control-icon,.gh-profile-row-icon,.gh-profile-quick>span{box-shadow:none!important}
.gh-coach-avatar{filter:saturate(.78) brightness(.94)!important}

/* Profile no longer duplicates the global Coach entry. */
.gh-profile-quick-grid-v2 .gh-profile-quick.settings.wide{grid-column:1/-1!important}

/* Quick timer moved behind the Timer quick action so Home stays a dashboard. */
.gh-home-v2-timer-dialog .sheet-card{max-width:430px}
.gh-home-v2-timer-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:18px 0}
.gh-home-v2-timer-fields label{display:grid;gap:6px}.gh-home-v2-timer-fields label>span{font-size:11px;color:var(--muted);font-weight:750}.gh-home-v2-timer-fields label>div{display:grid;grid-template-columns:1fr auto;align-items:center;border:1px solid var(--line);border-radius:12px;padding:8px 10px;background:rgba(4,14,23,.55)}.gh-home-v2-timer-fields input{width:100%;min-width:0;background:transparent;border:0;color:var(--text);font-size:23px;font-weight:850;outline:0}.gh-home-v2-timer-fields small{font-size:10px;color:var(--muted)}

@media(max-width:959px) and (orientation:portrait){
  .gh-home-v2{min-height:100%;align-content:start;gap:9px}
  .gh-home-v2-greeting{padding:1px 4px}.gh-home-v2-greeting h1{font-size:19px}.gh-home-v2-greeting p{font-size:11px;margin-top:2px}
  .gh-home-v2-plan{min-height:178px;padding:12px 13px!important;border-radius:15px!important}.gh-home-v2-plan-copy{max-width:69%;margin-top:8px}.gh-home-v2-plan-copy h2{font-size:21px}.gh-home-v2-mode{font-size:8px}.gh-home-v2-plan-meta{font-size:10px;margin-top:5px}.gh-home-v2-recovery-note{font-size:9.5px;margin-top:6px}.gh-home-v2-plan-kicker{font-size:9px}.gh-home-v2-plan-kicker svg{width:15px;height:15px}.gh-home-v2-plan-actions{grid-template-columns:1.2fr .85fr;gap:7px;max-width:100%;margin-top:9px}.gh-home-v2-plan-actions .primary,.gh-home-v2-plan-actions .gh-home-v2-link{min-height:39px!important;font-size:11px!important}
  .gh-home-v2-recovery{padding:10px 12px!important;border-radius:15px!important}.gh-home-v2-section-title{font-size:9px}.gh-home-v2-section-title.recovery,.gh-home-v2-section-title.quick{margin-bottom:6px}.gh-home-v2-recovery-metric{min-height:72px;padding:0 5px}.gh-home-v2-recovery-metric strong{font-size:15px}.gh-home-v2-recovery-metric>span:not(.gh-home-v2-metric-icon){font-size:9.5px}.gh-home-v2-recovery-metric small{font-size:8px}.gh-home-v2-recovery-metric.readiness strong{width:45px;height:45px;font-size:13px;border-width:2px}.gh-home-v2-metric-icon{width:31px;height:31px}.gh-home-v2-metric-icon svg{width:18px;height:18px}.gh-home-v2-health-btn{min-height:38px!important;padding:0 9px!important;margin-left:7px!important;font-size:9.5px!important}
  .gh-home-v2-quick{padding:10px 12px 11px!important;border-radius:15px!important}.gh-home-v2-quick-grid{gap:7px}.gh-home-v2-action{min-height:78px;border-radius:11px;padding:6px}.gh-home-v2-action>span{width:31px;height:31px;border-radius:8px}.gh-home-v2-action svg{width:18px;height:18px}.gh-home-v2-action strong{font-size:11px}.gh-home-v2-action small{font-size:8px}
  .gh-home-v2-week{min-height:54px;padding:7px 10px!important;grid-template-columns:70px minmax(0,1fr) 72px;gap:6px;border-radius:14px!important}.gh-home-v2-week-count strong{font-size:16px}.gh-home-v2-week-count small{font-size:8px}.gh-home-v2-week-count>span{font-size:7px}.gh-home-v2-week-days{gap:2px}.gh-home-v2-week-days b{font-size:6.5px}.gh-home-v2-week-days i{width:17px;height:17px;font-size:8px}.gh-home-v2-week .gh-home-v2-link{font-size:8.5px!important;min-height:30px!important}
}

@media(max-width:400px) and (max-height:860px) and (orientation:portrait){
  body.home-mode .main-content{padding-top:5px!important;padding-bottom:5px!important}
  .gh-home-v2{gap:7px}
  .gh-home-v2-greeting h1{font-size:17px}.gh-home-v2-greeting p{font-size:10px}
  .gh-home-v2-plan{min-height:164px!important}.gh-home-v2-plan-copy h2{font-size:19px}.gh-home-v2-plan-copy{max-width:72%}.gh-home-v2-plan-actions .primary,.gh-home-v2-plan-actions .gh-home-v2-link{min-height:36px!important}
  .gh-home-v2-recovery-metric{min-height:65px}.gh-home-v2-recovery-metric.readiness strong{width:40px;height:40px}.gh-home-v2-metric-icon{width:28px;height:28px}.gh-home-v2-health-btn{min-height:34px!important}
  .gh-home-v2-action{min-height:70px}.gh-home-v2-action small{display:none}
  .gh-home-v2-week{min-height:48px}
}

@media(min-width:960px){
  .gh-home-v2{max-width:1180px;grid-template-columns:minmax(0,1.45fr) minmax(330px,.75fr);align-items:stretch}
  .gh-home-v2-greeting{grid-column:1/-1}.gh-home-v2-plan{grid-column:1;grid-row:2/4}.gh-home-v2-recovery{grid-column:2;grid-row:2}.gh-home-v2-quick{grid-column:2;grid-row:3}.gh-home-v2-week{grid-column:1/-1}
  .gh-profile-quick-grid-v2{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

/* Alpha4.70 release-candidate corrections: remove legacy artificial page height,
   use the real phone width, and enforce the app-wide readability floor. */
@media(max-width:959px) and (orientation:portrait){
  body.home-mode #view-home.active{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    min-height:0!important;
    height:100%!important;
    overflow:visible!important;
    padding:0!important;
  }
  .gh-home-v2{
    width:100%!important;
    max-width:none!important;
    min-height:0!important;
    margin:0!important;
  }
  .gh-home-v2-greeting p,
  .gh-home-v2-plan-kicker,
  .gh-home-v2-mode,
  .gh-home-v2-plan-meta,
  .gh-home-v2-recovery-note,
  .gh-home-v2-section-title,
  .gh-home-v2-recovery-metric>span:not(.gh-home-v2-metric-icon),
  .gh-home-v2-recovery-metric small,
  .gh-home-v2-health-btn,
  .gh-home-v2-action small,
  .gh-home-v2-week-count>span,
  .gh-home-v2-week-count small,
  .gh-home-v2-week-days b,
  .gh-home-v2-week-days i,
  .gh-home-v2-week .gh-home-v2-link{
    font-size:10.5px!important;
  }
  .gh-home-v2-plan-copy>p:not(.gh-home-v2-mode){font-size:11px!important}
}

@media(max-width:400px) and (max-height:860px) and (orientation:portrait){
  .gh-home-v2-action small{display:none!important}
}

/* Approved Home should read as a full dashboard, not a compressed widget stack.
   Use the available phone height while preserving a no-scroll default. */
@media(max-width:959px) and (orientation:portrait){
  .gh-home-v2{gap:10px!important}
  .gh-home-v2-greeting{padding:3px 4px!important}
  .gh-home-v2-greeting h1{font-size:21px!important}
  .gh-home-v2-greeting p{font-size:11px!important;margin-top:3px!important}
  .gh-home-v2-plan{min-height:238px!important;padding:15px 16px!important}
  .gh-home-v2-plan-copy{margin-top:10px!important}
  .gh-home-v2-plan-copy h2{font-size:23px!important}
  .gh-home-v2-plan-actions{margin-top:12px!important;gap:9px!important}
  .gh-home-v2-plan-actions .primary,.gh-home-v2-plan-actions .gh-home-v2-link{min-height:44px!important;font-size:11.5px!important}
  .gh-home-v2-recovery{padding:12px 14px!important}
  .gh-home-v2-recovery-metric{min-height:88px!important}
  .gh-home-v2-recovery-metric strong{font-size:17px!important}
  .gh-home-v2-recovery-metric.readiness strong{width:48px!important;height:48px!important;font-size:14px!important}
  .gh-home-v2-metric-icon{width:35px!important;height:35px!important}
  .gh-home-v2-quick{padding:12px 14px 13px!important}
  .gh-home-v2-action{min-height:98px!important}
  .gh-home-v2-action>span{width:35px!important;height:35px!important}
  .gh-home-v2-action strong{font-size:12px!important}
  .gh-home-v2-week{min-height:64px!important;padding:8px 11px!important}
}
@media(max-width:400px) and (max-height:860px) and (orientation:portrait){
  .gh-home-v2{gap:9px!important}
  .gh-home-v2-greeting h1{font-size:19px!important}
  .gh-home-v2-plan{min-height:218px!important;padding:13px 14px!important}
  .gh-home-v2-plan-copy h2{font-size:21px!important}
  .gh-home-v2-recovery{padding:10px 12px!important}
  .gh-home-v2-recovery-metric{min-height:80px!important}
  .gh-home-v2-quick{padding:10px 12px 11px!important}
  .gh-home-v2-action{min-height:88px!important}
  .gh-home-v2-week{min-height:60px!important}
}

/* Shared readability floor, including desktop/PWA rendering. */
.gh-home-v2-greeting p,
.gh-home-v2-plan-kicker,
.gh-home-v2-mode,
.gh-home-v2-plan-meta,
.gh-home-v2-recovery-note,
.gh-home-v2-section-title,
.gh-home-v2-recovery-metric>span:not(.gh-home-v2-metric-icon),
.gh-home-v2-recovery-metric small,
.gh-home-v2-health-btn,
.gh-home-v2-action small,
.gh-home-v2-week-count>span,
.gh-home-v2-week-count small,
.gh-home-v2-week-days b,
.gh-home-v2-week-days i,
.gh-home-v2-week .gh-home-v2-link{font-size:10.5px!important}

/* Match the declared 11 px minimum visible-text contract. */
.gh-home-v2-greeting p,
.gh-home-v2-plan-kicker,
.gh-home-v2-mode,
.gh-home-v2-plan-meta,
.gh-home-v2-recovery-note,
.gh-home-v2-section-title,
.gh-home-v2-recovery-metric>span:not(.gh-home-v2-metric-icon),
.gh-home-v2-recovery-metric small,
.gh-home-v2-health-btn,
.gh-home-v2-action small,
.gh-home-v2-week-count>span,
.gh-home-v2-week-count small,
.gh-home-v2-week-days b,
.gh-home-v2-week-days i,
.gh-home-v2-week .gh-home-v2-link{font-size:11px!important}

/* Alpha4.70 readability pass: bring Progress microcopy up to the same declared
   11 px floor instead of leaving legacy 10.5 px labels behind. */
#view-history .subtle,
#view-history .gh-summary-lines span,
#view-history .gh-summary-lines strong,
#view-history .gh-big-label,
#view-history .gh-week-dots span{font-size:11px!important}
body #view-history p.subtle{font-size:11px!important}
body #view-profile .gh-profile-row small,
body #view-profile .gh-profile-quick small{font-size:11px!important}
