/* App shell: tab bar, one screen at a time, large tap targets. Loaded last. */
body[data-screen] .screen{display:none!important}
body[data-screen=home] .screen[data-screen=home],
body[data-screen=check] .screen[data-screen=check],
body[data-screen=basis] .screen[data-screen=basis]{display:block!important}
body[data-screen=zhihu] .screen[data-screen=zhihu]{display:flex!important}
.screenIn{animation:screenIn .32s cubic-bezier(.2,.8,.2,1)}
@keyframes screenIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
footer{display:none}

/* Tab bar: segmented control in the header on wide screens, fixed bottom bar on phones */
.tabbar{position:fixed;z-index:30;top:10px;right:max(36px,calc((100vw - 1200px)/2));display:flex;gap:4px;padding:4px;border-radius:14px;background:rgba(231,239,235,.9);border:1px solid #d3dfda;backdrop-filter:blur(10px)}
.tabbar a{display:flex;align-items:center;gap:7px;padding:8px 14px;border-radius:10px;color:#3c5a58;font-size:14px;font-weight:700;text-decoration:none;transition:background .2s,color .2s}
.tabbar svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.tabbar a:hover{text-decoration:none;background:#ffffffaa;color:#0f4a45}
.tabbar a[aria-current=page]{background:#0f3337;color:var(--glow);box-shadow:0 6px 16px -8px #0b2b2c}
@media(max-width:730px){
  body{padding-bottom:calc(76px + env(safe-area-inset-bottom))}
  .tabbar{position:fixed;z-index:40;top:auto;left:10px;right:10px;bottom:calc(10px + env(safe-area-inset-bottom));justify-content:space-around;padding:6px;border-radius:20px;background:rgba(9,32,35,.92);border:1px solid #ffffff1c;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);box-shadow:0 14px 36px -10px #071b1ecc}
  .tabbar a{flex:1;flex-direction:column;gap:3px;padding:7px 2px;font-size:11px;color:#9fbab3;border-radius:14px}
  .tabbar svg{width:22px;height:22px}
  .tabbar a[aria-current=page]{background:#ffffff14;color:var(--glow);box-shadow:none}
  .head{justify-content:center;min-height:54px}
  header .brand{font-size:19px}
}

/* Home */
body[data-screen=home] .comparison{margin-top:18px}
.lede br{display:none}

/* Check screen: guide becomes a focused card */
.workspace{padding-top:18px}
.workspace .bar h2{font-size:24px}
.inputpanel:has(#fieldGuide:not([hidden]))>#preset{display:none}
.inputpanel:has(#fieldGuide:not([hidden])) .panelhead h3{font-size:16px;color:var(--muted)}
#fieldGuide{display:flex;flex-direction:column;position:relative;padding:18px 18px 16px;border-radius:18px;border:1px solid #cfe0d6;overflow:hidden}
#fieldGuide::before{content:"";position:absolute;left:0;top:0;height:4px;width:var(--progress,0%);background:linear-gradient(90deg,#1b7a5f,var(--glow));transition:width .4s cubic-bezier(.2,.8,.2,1)}
#guideLegs{order:-1;border:0;margin:0 0 10px;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:8px}
#guideLegs span{display:flex;align-items:center;gap:8px;padding:10px 12px;border-radius:12px;background:#fff;border:1px solid #d7e3dd;font-size:13px;line-height:1.3}
#guideLegs span::before{content:"";flex:none;width:10px;height:10px;border-radius:50%;background:#c3cfca}
#guideLegs [data-status=ok]{background:#effaf0;border-color:#b7e2c3}
#guideLegs [data-status=ok]::before{background:#22a06b;box-shadow:0 0 0 4px #22a06b26}
#guideLegs [data-status=stop]::before,#guideLegs [data-status=safety]::before{background:#e5603b;box-shadow:0 0 0 4px #e5603b26}
#guideLegs [data-status=stop],#guideLegs [data-status=safety]{background:#fff3ee;border-color:#f2c3b2}
#guideLegs [data-status=need]::before,#guideLegs [data-status=approval]::before{background:#e0a400;box-shadow:0 0 0 4px #e0a40026;animation:pulse 1.6s ease-in-out infinite}
@keyframes pulse{50%{box-shadow:0 0 0 7px #e0a40000}}
.guideHead{order:0}
.guideHead strong{font-size:12px;letter-spacing:.08em;color:#5d7a73}
.guideHead span{padding:2px 9px;border-radius:99px;background:#0f3337;color:var(--glow);font-weight:700}
#guideQuestion{font-size:24px;letter-spacing:-.03em;margin:10px 0 4px}
#guideHint{font-size:14px}
#guideOptions{display:grid;grid-template-columns:1fr;gap:8px;margin-top:14px}
#guideOptions button{min-height:56px;padding:12px 16px;border-radius:14px;border:1.5px solid #c9dad2;background:#fff;font-size:16px;text-align:left;display:flex;align-items:center;justify-content:space-between}
#guideOptions button::after{content:"›";font-size:22px;color:#8aa59d}
#guideOptions button:active{transform:scale(.98)}
#guideEnergy{margin-top:12px}
#guideEnergy input{flex:1;min-width:0;font-size:20px;font-weight:700;border-radius:12px;min-height:54px}
#guideEnergy button{min-height:54px;border-radius:12px;padding:8px 18px}
.guideLinks{order:5}
#manualToggle{font-size:13px;color:#5d7a73}

/* Results: verdict tiles first, words second */
#tripAdvice{border-radius:18px;padding:18px}
#tripAdvice h4{font-size:22px}
.leg{border-radius:16px;border-left-width:1px;padding:16px}
.leg.stop,.leg.safety{border-color:#f0c6b6}
.leg.ok{border-color:#bfe1c9}
.leg h4{font-size:24px}
.leg h4::before{width:1.4em;height:1.4em}
.routeLabel{font-size:12px;letter-spacing:.02em}
.excerptBox{margin-top:6px}
.excerptBox>summary{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:99px;background:#fff;border:1px solid #e3cfc6;font-size:13px;font-weight:700;color:#8a3d22;list-style:none;cursor:pointer}
.excerptBox>summary::-webkit-details-marker{display:none}
.excerptBox>summary::before{content:"❝";font-size:14px}
.excerptBox[open]>summary{margin-bottom:6px}
.scopeNote{font-size:12px}
.outActions button{border-radius:12px;min-height:46px}

/* Zhihu screen: the checker stage first, real questions after */
.community{flex-direction:column;gap:18px;border-top:0;padding-top:18px}
.community .claimCheck{order:-1;margin-top:0}
.community>div:first-child{order:0}
#discussions{order:1}
.discuss{padding:14px 16px!important;margin-bottom:10px;border:1px solid var(--line);border-radius:14px;background:#fff}
.topicEntry{display:inline-flex;margin-top:6px;padding:6px 12px;border-radius:99px;background:#0f3337;color:var(--glow)!important;font-weight:700;font-size:14px;text-decoration:none}

/* Basis screen */
.evidence{border-top:0;padding-top:18px}
.sourcerow{padding:12px 14px!important;margin-bottom:8px;border:1px solid var(--line);border-radius:12px;background:#fff}

@media print{.tabbar{display:none!important}body[data-screen] .screen{display:block!important}}
