/* Baristuno mobile system — one deliberate phone layout across the app. */

@media(max-width:860px){
  :root{--mobile-gutter:clamp(14px,4.6vw,22px)}
  html{scroll-padding-bottom:calc(84px + env(safe-area-inset-bottom))}
  body{overflow-x:clip;padding-bottom:calc(78px + env(safe-area-inset-bottom))}
  .wrap,.wrap.app{width:100%;padding-inline:var(--mobile-gutter);padding-bottom:42px}
  .tab,.card,section,article{min-width:0}
  input,select,textarea{max-width:100%;font-size:16px}

  /* Calm, predictable mobile chrome. */
  .site-head{min-height:64px;margin-bottom:14px;padding-block:10px}
  .site-head .mark{width:40px;height:40px}.site-head h1,.site-head h1.brand,.site-head .brand-name{font-size:19px}.site-head .sub{font-size:8px}
  .site-head nav{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:0;padding:5px 5px max(6px,env(safe-area-inset-bottom));border-radius:20px 20px 0 0}
  .site-head nav a,.site-head nav button,.site-head nav .mobile-more-trigger{position:relative;display:flex;min-width:0;min-height:54px;align-items:center;justify-content:center;flex-direction:column;gap:4px;padding:6px 2px;border:0;border-radius:12px;background:transparent;font-size:10px;line-height:1.05}
  .site-head nav a.on,.site-head nav button.on{background:transparent;color:var(--clay);box-shadow:none}
  .site-head nav a.on:after,.site-head nav button.on:after{content:"";position:absolute;left:50%;bottom:3px;width:18px;height:2px;border-radius:2px;background:currentColor;translate:-50% 0}
  .site-head nav .shop-nav-link{border:0;background:transparent;color:var(--clay)}
  .site-head nav .shop-nav-link.on{background:transparent;color:var(--clay)}
  .primary-nav-icon{width:19px;height:19px;flex-basis:19px}

  .mobile-more-sheet{left:6px;right:6px;bottom:max(6px,env(safe-area-inset-bottom));padding:19px 16px 16px;border-radius:24px}
  .mobile-more-sheet>header{margin-bottom:13px}.mobile-more-sheet h2{font-size:27px}
  .mobile-menu-groups{grid-template-columns:1fr;gap:7px}.mobile-menu-groups details{border-radius:13px}.mobile-menu-groups summary{min-height:48px}
  .mobile-more-utility{grid-template-columns:repeat(2,1fr)}.mobile-more-social{padding-bottom:2px}

  /* Hero: the proposition stays first and actions read as actions. */
  #tab-home>.analyzer-hero{display:grid;grid-template-columns:1fr;gap:18px;min-height:0;margin-inline:calc(var(--mobile-gutter) * -1);padding:38px var(--mobile-gutter) 30px;border-radius:0;background-position:66% center}
  #tab-home>.analyzer-hero:before{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(22,13,8,.1),rgba(22,13,8,.54));pointer-events:none}
  #tab-home>.analyzer-hero .hl-txt{max-width:none}
  #tab-home>.analyzer-hero .big{max-width:10.5ch;margin-bottom:14px;font-size:clamp(38px,11.5vw,58px);line-height:.94}
  #tab-home>.analyzer-hero .hl-sub{max-width:52ch;margin-bottom:0;color:rgba(255,255,255,.75);font-size:13px;line-height:1.58}
  #tab-home>.analyzer-hero .hero-product-proof{padding:13px 14px;border-radius:17px}
  #tab-home>.analyzer-hero .hero-proof-grid{gap:6px}.hero-proof-step{min-height:63px}.hero-proof-step b{font-size:10px}.hero-proof-step small{font-size:8px}
  #tab-home>.analyzer-hero .home-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:100%;margin:0}
  #tab-home>.analyzer-hero .home-actions .ha{position:relative;min-height:76px;align-items:flex-start;padding:15px 34px 14px 15px;border-radius:15px;text-align:left}
  #tab-home>.analyzer-hero .home-actions .ha:after{content:"→";position:absolute;right:14px;top:50%;color:rgba(255,255,255,.6);font:500 17px/1 var(--sans);translate:0 -50%}
  #tab-home>.analyzer-hero .home-actions .ha b{font-size:13px;line-height:1.2}#tab-home>.analyzer-hero .home-actions .ha span{font-size:9.5px;line-height:1.35}

  /* Mobile storytelling: the object stays on stage while the four concise
     chapters drive its state. This retains native scrolling and reverses. */
  .brew-story{margin-inline:calc(var(--mobile-gutter) * -1);padding:56px var(--mobile-gutter) 64px}
  .brew-story-intro{display:block;padding-bottom:32px}.brew-story-kicker{margin:0 0 14px}.brew-story-intro h2{font-size:clamp(37px,9vw,50px);line-height:.97}.brew-story-intro>p{margin-top:15px;font-size:13px}
  .brew-story-layout{position:relative;display:grid;grid-template-columns:1fr;align-items:start}
  .brew-story-stage{position:sticky;z-index:1;top:10px;grid-column:1;grid-row:1;height:min(54svh,440px);min-height:350px;margin:0;border-radius:20px}
  .brew-story-steps{position:relative;z-index:2;grid-column:1;grid-row:1;margin:0;padding:26svh 10px 10svh;pointer-events:none}
  .brew-story-step{position:relative;min-height:42svh;max-width:none;justify-content:flex-end;padding:0 0 20px;opacity:.3;transition:opacity 240ms ease}
  .brew-story-step:before{content:"";position:absolute;inset:auto -10px 0;height:58%;border-radius:18px;background:linear-gradient(180deg,transparent,rgba(20,12,8,.94) 32%,rgba(20,12,8,.99));pointer-events:none}
  .brew-story-step>*{position:relative;z-index:1}.brew-story-step.is-active{opacity:1}.brew-story-step h3{max-width:11ch;margin-top:12px;font-size:clamp(32px,7.8vw,43px)}.brew-story-step p{font-size:12px;line-height:1.58}
  .brew-story-step>a,.brew-story-step>button{pointer-events:auto;margin-top:17px}
  .coffee-lifecycle{inset:2% 2% 34%}.coffee-lifecycle:before{width:min(82%,360px)}
  .brew-readout{left:12px;right:12px;bottom:12px;padding:13px;border-radius:14px}.brew-readout-value{padding:11px 0}.brew-readout-value strong{font-size:25px}.brew-readout-signals{gap:4px}.brew-readout-signals>span{padding:8px 6px}.brew-readout-signals b{font-size:8.5px}.brew-readout-signals small{font-size:7.5px}
  .brew-story-trust{margin-top:24px;gap:18px}

  /* Keep the complete four-step loop visible; it is a process, not a carousel. */
  .system-bridge{margin:12px 0;padding:24px 18px;border-radius:20px}.system-bridge>header{grid-template-columns:1fr;gap:12px}.system-bridge h2{font-size:36px}.system-bridge>header>p{font-size:12px}
  .system-bridge-flow{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-flow:row;grid-auto-columns:auto;gap:8px;overflow:visible;margin:22px 0 0;padding:0;border:0;border-radius:0;background:transparent;scroll-snap-type:none}.system-bridge-flow article{min-height:112px;padding:16px;border:1px solid var(--line-soft)!important;border-radius:15px;background:rgba(255,255,255,.78);scroll-snap-align:none}.system-bridge-flow article:after{display:none!important}.system-bridge-flow b{margin-top:18px;font-size:17px}.system-bridge-flow small{font-size:10px;line-height:1.4}
  .system-bridge-action{align-items:stretch;flex-direction:column}.system-bridge-action .btn{width:100%;min-height:48px}
  .scale-bridge{grid-template-columns:1fr;gap:13px;padding:18px}.scale-bridge-reading{min-height:92px}.scale-bridge>a{grid-column:auto;width:100%;justify-content:center}

  .home-news{margin-inline:calc(var(--mobile-gutter) * -1);border-radius:0}.home-news-head>a{min-height:44px}.home-news-grid{display:grid;grid-auto-flow:column;grid-auto-columns:min(84vw,330px);grid-template-columns:none!important;gap:10px;overflow-x:auto;margin-inline:-18px;padding:0 18px 8px;scroll-snap-type:x mandatory;scrollbar-width:none}.home-news-grid::-webkit-scrollbar{display:none}.home-news-card,.home-news-card.is-lead,.home-news-card:last-child{display:grid!important;height:370px;min-height:370px;scroll-snap-align:start}.home-news-foot{gap:5px}

  /* Core application surfaces. */
  .journal-mobile-nav{top:6px;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}.journal-mobile-nav button{min-width:0}.journal-mobile-nav button small{display:none}
  .today-heading-actions{grid-template-columns:1fr 1fr}.today-heading-actions .text-action{display:flex;align-items:center;justify-content:center;min-height:46px;border:1px solid var(--line);border-radius:999px;background:var(--surface)}
  .recipe-dialog,.install-app-dialog{width:calc(100% - 12px);max-height:calc(100dvh - 12px)}
  .profile-dashboard-shell,.ecosystem-grid,.intel-grid{min-width:0}
  .profile-focus-actions,.device-actions,.share-sheet-actions,.data-danger-actions{display:grid;grid-template-columns:1fr;gap:8px}.profile-focus-actions>a,.profile-focus-actions>button,.device-actions .btn,.share-sheet-actions .btn,.data-danger-actions .btn{width:100%;min-height:46px}

  /* Brew Assist keeps one stable bottom action zone. */
  .brew-assist{padding-bottom:calc(84px + env(safe-area-inset-bottom))}
  .assist-shell-head{position:sticky;top:0;z-index:5;min-height:calc(66px + env(safe-area-inset-top));padding:calc(10px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) 10px calc(16px + env(safe-area-inset-left))}.assist-close{display:inline-flex;min-width:64px;min-height:44px;align-items:center;justify-content:center}.assist-progress{top:calc(66px + env(safe-area-inset-top))}
  .assist-ritual-visual{display:flex;width:calc(100% - 28px);gap:7px;overflow:hidden;margin-top:16px;padding:12px}.assist-ritual-visual span{min-width:48px}.assist-ritual-visual span b{font-size:9px}.assist-ritual-visual em{min-width:12px;flex:1}
  .assist-nav{grid-template-columns:minmax(96px,1fr) auto minmax(96px,1fr);min-height:calc(70px + env(safe-area-inset-bottom));padding:9px calc(12px + env(safe-area-inset-right)) calc(9px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left))}.assist-nav .btn{min-width:0;width:100%;padding-inline:12px}.assist-nav #assistOpenTimer{white-space:nowrap}.assist-nav>span{padding-inline:5px;white-space:nowrap}

  /* Timer content is centered, compact and phase-stable at every phone size. */
  .timer-modal{align-items:center;padding:6px}
  .timer-focus{display:block;width:100%;height:auto;min-height:0;max-height:calc(100dvh - 12px);padding:22px 16px 16px;border-radius:22px;overflow:auto}
  .timer-close{right:14px;top:14px;width:44px;height:44px}.timer-focus-copy{min-height:0;margin:0 0 16px;padding-right:48px}.timer-focus-copy h2{font-size:30px}.timer-focus-copy>p{margin-top:8px;font-size:11px;line-height:1.45}
  .timer-cup-visual{width:268px;height:137px;margin:0 auto 12px}.timer-cup-bowl{left:0;top:0;width:216px;height:137px;border-radius:20px 20px 68px 68px}.timer-cup-handle{left:209px;top:38px;width:59px;height:61px;border-width:8px;border-left-width:8px;border-radius:50%}.timer-focus-clock{margin:0;font-size:47px;line-height:137px}
  .timer-cup-visual>i,.timer-cup-visual>b,.timer-cup-visual>span{top:-18px;height:18px}.timer-scale-bar{min-height:52px;margin-bottom:12px}.timer-focus-progress{height:7px;margin-bottom:12px}.timer-focus-steps{display:flex;gap:6px;overflow-x:auto;padding-bottom:2px;scrollbar-width:none}.timer-focus-steps .timer-step{min-width:142px}.timer-focus-actions{grid-template-columns:1fr 1fr;gap:7px;margin-top:13px}.timer-focus-actions .btn{min-height:48px;padding:10px 8px;font-size:12px;border-radius:13px}
}

@media(max-width:560px){
  #tab-home>.analyzer-hero .home-actions{grid-template-columns:1fr}
  #tab-home>.analyzer-hero .home-actions .ha{min-height:62px}
  .hero-proof-head small{display:none}.hero-proof-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.hero-proof-grid:before{right:16%;left:16%}
  .life-cherry{scale:.72}.life-bean{scale:.72}.brew-story[data-scene="1"] .life-bean{transform:rotate(-18deg) scale(.72)}.brew-story[data-scene="2"] .life-grounds{transform:scale(.68)}.brew-story[data-scene="3"] .life-cup{transform:scale(.68)}
  .brew-story{padding-block:52px 58px}.brew-story-intro{padding-bottom:28px}.brew-story-intro h2{font-size:clamp(34px,9.8vw,43px)}
  .brew-story-stage{height:min(51svh,390px);min-height:320px}.brew-story-steps{padding:23svh 6px 8svh}.brew-story-step{min-height:39svh;padding-bottom:18px}
  .brew-readout-head span{max-width:75%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.brew-readout-signals{grid-template-columns:repeat(4,minmax(0,1fr))}
  .home-news-head h2{font-size:34px}.home-news-card,.home-news-card.is-lead,.home-news-card:last-child{height:356px;min-height:356px}
}

@media(max-width:359px){
  :root{--mobile-gutter:12px}.site-head .sub{display:none}.site-head nav a,.site-head nav button,.site-head nav .mobile-more-trigger{font-size:9px}
  .system-bridge-flow article{min-height:104px;padding:14px}.system-bridge-flow b{font-size:16px}.system-bridge-flow small{font-size:9px}
  .brew-story-stage{height:min(49svh,360px);min-height:300px}.brew-story-steps{padding-inline:4px}.brew-readout{left:8px;right:8px;padding:10px}.brew-readout-signals small{display:none}
  .timer-cup-visual{width:244px;height:125px}.timer-cup-bowl{width:196px;height:125px}.timer-cup-handle{left:190px;top:34px;width:54px;height:56px}.timer-focus-clock{font-size:43px;line-height:125px}
  .assist-nav{grid-template-columns:minmax(80px,.75fr) auto minmax(116px,1.25fr)}.assist-nav #assistOpenTimer{font-size:11px}.assist-nav>span{text-align:center}
}

@media(prefers-reduced-motion:reduce){
  .brew-story-stage{position:relative;top:auto}.brew-story-steps{grid-row:2;padding:24px 0}.brew-story-step{min-height:0;padding:24px 0;opacity:1}.brew-story-step:before{display:none}
}
