/* FATOFORMA v0.1 — mobile interface (approved mockup: Home · Health article · Exercise hub · Calculator).
   Loaded last. Everything that changes the page layout is scoped to max-width 760px, so desktop is untouched; the first
   block holds the few pieces shared with desktop (tab bar hidden, icons, save button, calculator next step).
   Colours come from tokens.css: --health-*, --exercise-*, --card-*. Saúde = green, Exercício = red, neutral elsewhere. */

/* ---------- Shared (all widths) ---------- */
.tabbar{display:none}
.ico{display:block;width:24px;height:24px}
.tool-icon{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:12px;background:var(--exercise-soft);color:var(--exercise-primary);margin-bottom:var(--s2)}
.tool-icon .ico{width:24px;height:24px}
.article-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:var(--s4)}
.article-actions .share-button{margin-top:0}
.save-button{display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:0 14px;border:1px solid var(--line-strong);border-radius:var(--control-radius);background:transparent;color:var(--ink);font:inherit;font-size:.85rem;cursor:pointer}
.save-button .ico{width:17px;height:17px}
.save-button[aria-pressed="true"]{border-color:var(--accent-fill);color:var(--accent)}
.save-button[aria-pressed="true"] .ico{fill:currentColor}
.tool-intro .save-button{margin-top:var(--s3)}
.tool-next{display:flex;justify-content:center;gap:8px;width:100%;margin-top:var(--s3);background:var(--exercise-block);border-color:var(--exercise-block);color:#fff}
.tool-next:hover{background:var(--exercise-dark);border-color:var(--exercise-dark)}
.tool-submit{background:var(--exercise-block);border-color:var(--exercise-block);color:#fff}
.tool-submit:hover{background:var(--exercise-dark);border-color:var(--exercise-dark)}
.tool-result{background:var(--exercise-soft);border-top-color:var(--exercise-primary)}
.tool-result-label{color:var(--exercise-dark);margin:var(--s1) 0 0}
.tool-result-main{margin:var(--s2) 0 var(--s3)}
.tool-result-main strong,.tool-result-main span{color:var(--exercise-primary)}
.tool-result-main span{font-weight:700;font-size:1.25rem}
.tool-input{position:relative;display:block}
.tool-input .tool-unit{position:absolute;right:12px;top:50%;transform:translateY(-50%);font-size:.85rem;color:var(--muted);pointer-events:none}
.tool-input input{padding-right:52px}
.tool-segmented{border:0;margin:0;padding:0;min-width:0}
.segmented{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:4px;padding:4px;border:1px solid var(--line-strong);border-radius:12px;background:var(--input-bg)}
.segmented label{position:relative;cursor:pointer}
.segmented input{position:absolute;opacity:0;inset:0;margin:0;cursor:pointer}
.segmented span{display:flex;align-items:center;justify-content:center;min-height:38px;border-radius:9px;font-size:.9rem;color:var(--text)}
.segmented input:checked+span{background:var(--exercise-block);color:#fff;font-weight:700}
.segmented input:focus-visible+span{outline:2px solid var(--focus);outline-offset:1px}
.saved-empty{color:var(--muted);padding:var(--s4) 0}
.footer-links>a[href="salvos.html"]{font-size:.8rem}

/* ---------- Phones (≤760px) ---------- */
@media(max-width:760px){
:root{--tabbar-h:60px}
body{padding-bottom:calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px);background:var(--paper)}
html{scroll-padding-bottom:calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px)}
.utility-bar{display:none}
h1,h2,h3,.investigation-card h3,.article-title h1{font-family:var(--serif);font-weight:700;letter-spacing:-.02em}   /* v0.43: Sora, as on desktop */

/* Header: brand + search (Home and Menu live in the tab bar). */
.site-header{background:rgba(247,247,243,.94);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
.site-header .home-button,.site-header .menu-toggle,.site-version{display:none!important}
.header-tools>.search-toggle{display:inline-flex!important;width:40px;height:40px;border-radius:50%;border:0;background:transparent;color:var(--ink)}
.header-tools>.search-toggle .hbtn-icon{width:20px;height:20px}
.site-logo-img{height:30px}
#navigation.open{padding-bottom:var(--s4)}

/* Tab bar: fixed, safe-area aware, icon + short label. */
.tabbar{position:fixed;left:0;right:0;bottom:0;z-index:45;display:grid;grid-template-columns:repeat(5,1fr);height:calc(var(--tabbar-h) + env(safe-area-inset-bottom));padding:0 4px env(safe-area-inset-bottom);background:rgba(255,255,255,.96);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border-top:1px solid var(--line);box-shadow:0 -4px 18px #1e24220a}
.tab{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:0;border:0;background:transparent;font:inherit;font-size:.68rem;font-weight:600;color:var(--muted);text-decoration:none;cursor:pointer;-webkit-tap-highlight-color:transparent}
.tab .ico{width:23px;height:23px}
.tab[aria-current="page"],.tab[aria-expanded="true"]{color:var(--ink)}
.tab[data-tab="saude"][aria-current="page"]{color:var(--health-block)}
.tab[data-tab="exercicio"][aria-current="page"]{color:var(--exercise-primary)}
.tab[aria-current="page"] .ico{stroke-width:2.2}
.tab:focus-visible{outline:2px solid var(--focus);outline-offset:-4px;border-radius:10px}

/* Section headings: title left, "Ver todas" right. */
.section-heading{display:flex;align-items:baseline;justify-content:space-between;gap:var(--s3);margin-bottom:var(--s3)}
.section-heading h2{font-size:1.15rem;line-height:1.2}
.section-heading .eyebrow{font-size:.66rem;margin-bottom:2px}
.section-heading>.text-link{min-height:32px;font-size:.8rem;font-weight:600;color:var(--muted);flex-shrink:0}
.section-heading>.text-link span[aria-hidden]{display:none}
.investigation-section{padding:var(--s4) 0 var(--s2)}
.prototype-note{font-size:.76rem;line-height:1.45;padding:10px 12px;border:0;border-radius:12px;background:var(--soft);margin:var(--s3) 0}

/* Claim cards → compact rows (home, hubs, related, saved). */
.investigation-grid,.related-grid{display:grid;grid-template-columns:1fr;gap:10px;border:0}
.investigation-card{position:relative;border:1px solid var(--line);border-radius:var(--card-radius);background:var(--card-bg);box-shadow:var(--card-shadow);padding:14px 44px 12px 14px;min-height:0}
a.investigation-card:not(.tool-card){box-shadow:var(--card-shadow);border-left:4px solid var(--health-primary)}
.investigation-card h3{font-size:1.02rem;line-height:1.25;margin-top:4px}
.investigation-card p{display:none}
.investigation-card .card-meta{font-size:.64rem}
.investigation-card .index-number,.investigation-card .card-warning{display:none}
.investigation-card .card-bottom{margin-top:8px;padding-top:0;border:0}
.investigation-card .card-arrow{position:absolute;right:12px;top:50%;transform:translateY(-50%);border:0;font-size:0;width:24px;height:24px}
.investigation-card .card-arrow::after{content:'›';font-size:1.6rem;line-height:24px;color:var(--faint)}
.archive-row{border:1px solid var(--line);border-radius:var(--card-radius);background:var(--card-bg);padding:12px 14px;margin-bottom:10px}

/* Tool cards (Exercise): soft red surface, red icon, dark text, large touch target. */
[data-tools-grid],.related-grid:has(.tool-card){grid-template-columns:1fr 1fr}
.tool-card{border:0!important;background:var(--exercise-soft);box-shadow:none;padding:16px 14px 14px;border-radius:16px;min-height:168px}
.tool-card .tool-icon{background:#fff;width:40px;height:40px}
.tool-card .card-meta{display:none}
.tool-card h3{font-size:.98rem;margin-top:2px}
.tool-card p{display:block;font-size:.76rem;line-height:1.4;margin-top:4px;color:var(--text);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.tool-card .card-bottom{margin-top:auto;padding-top:8px}
.tool-card .tool-cta{display:none}
.tool-card .card-arrow{position:static;transform:none;margin-left:auto;width:28px;height:28px;border-radius:50%;background:#fff;display:inline-flex;align-items:center;justify-content:center}
.tool-card .card-arrow::after{color:var(--exercise-blue);font-size:1.3rem;line-height:1}

/* ---------- Home ---------- */
body[data-page="home"] .edition-line,body[data-page="home"] .hero-score,body[data-page="home"] .hero .button-row,
body[data-page="home"] .method-strip,body[data-page="home"] .community-block,body[data-page="home"] .hero .eyebrow{display:none}
body[data-page="home"] .hero{display:block;padding:var(--s4) 0 var(--s2)}
body[data-page="home"] .hero h1{font-size:1.5rem;line-height:1.12;margin:0}
body[data-page="home"] .hero-search-examples{display:none}
body[data-page="home"] .hero h1 em{font-style:normal;color:var(--health-primary)}
body[data-page="home"] .hero h1 .accent{color:var(--exercise-primary)}
.hero-description{font-size:.86rem;line-height:1.45;margin-top:6px;color:var(--muted)}
.hero-search{margin-top:var(--s3)}
.hero-search-label{display:none}
.hero-search-box{border-radius:14px;overflow:hidden;box-shadow:var(--card-shadow);background:#fff}
.hero-search-submit{border-radius:10px}
.hero-search-examples{font-size:.78rem}
.paths{grid-template-columns:1fr 1fr;gap:10px;margin:var(--s3) 0 var(--s2)}
.path-card{position:relative;min-height:176px;padding:16px 14px 58px;border:0;border-radius:18px;background:var(--path);color:#fff;gap:6px;box-shadow:0 6px 18px #1e24221a}
.path-card[data-path="saude"]{--path:var(--health-block)}
.path-card[data-path="exercicio"]{--path:var(--exercise-block)}
.path-card:hover{background:var(--path);filter:brightness(1.04)}
.path-card .eyebrow{display:none}
.path-icon{display:inline-flex;align-items:center;justify-content:center;width:46px;height:46px;border-radius:50%;background:rgba(255,255,255,.2);color:#fff;margin-bottom:4px}
.path-icon .ico{width:26px;height:26px}
.path-card h2{font-family:var(--sans);font-weight:700;font-size:1.3rem;line-height:1.1;color:#fff}
.path-card p{font-size:.78rem;line-height:1.4;color:rgba(255,255,255,.92)}
.path-link{position:absolute;left:14px;bottom:14px;padding:0;color:#fff}
.path-link>span[data-i18n]{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
.path-arrow{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:50%;background:#fff;color:var(--path);font-size:1.5rem;line-height:1;font-weight:700}
body[data-page="home"] #ferramentas [data-tools-grid]{grid-template-columns:repeat(4,1fr);gap:8px}
body[data-page="home"] #ferramentas .tool-card{min-height:0;padding:12px 6px 10px;align-items:center;text-align:center;border-radius:14px}
body[data-page="home"] #ferramentas .tool-card .tool-icon{margin:0 0 6px}
body[data-page="home"] #ferramentas .tool-card h3{font-size:.7rem;line-height:1.2;letter-spacing:0;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
body[data-page="home"] #ferramentas .tool-card p,body[data-page="home"] #ferramentas .tool-card .card-bottom{display:none}

/* ---------- Exercise hub + Health hub ---------- */
body[data-page="exercicio"] .edition-line,body[data-page="saude"] .edition-line,body[data-page="salvos"] .edition-line{display:none}
body[data-page="exercicio"] .page-intro h1,body[data-page="saude"] .page-intro h1{font-size:1.75rem;line-height:1.1}
.discovery{gap:var(--s2)}
.filters{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.filters button{border-radius:999px;white-space:nowrap}

/* ---------- Health article ---------- */
body[data-page="article"] .breadcrumbs{display:none}
.article-header{padding:var(--s4) 0 var(--s3);gap:var(--s3)}
.article-title .eyebrow{display:inline-block;font-size:.62rem;letter-spacing:.08em;color:var(--health-dark);background:var(--health-soft);padding:5px 10px;border-radius:999px;margin-bottom:var(--s2)}
.article-title h1{font-size:1.75rem;line-height:1.12;margin-bottom:6px}
.claim-line{font-family:var(--sans);font-size:1rem;color:var(--muted);line-height:1.45}
.article-meta{font-size:.75rem;margin-top:var(--s2)}
.article-actions{margin-top:var(--s3)}
.article-actions .share-button,.article-actions .save-button{min-height:38px;border-radius:999px;border-color:var(--line-strong);font-size:.82rem;color:var(--ink)}
.article-score{border:0!important;border-radius:16px;background:var(--health-soft)!important;padding:14px 16px!important}
.article-score .score-topline{font-size:.64rem}
.article-score{--bar-gap:var(--health-soft)}
.article-score .evidence-bar{margin-top:10px}
.article-score .micro{font-size:.72rem;text-align:center}
body[data-page="article"] .prototype-note{background:#fffbea;border-left:3px solid #e9c53a}
.article-layout{margin-top:var(--s3);gap:var(--s3)}
.toc{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;padding:6px!important;border-radius:14px;position:sticky!important;top:calc(var(--header-h) + 6px);z-index:5;background:rgba(255,255,255,.96);border:1px solid var(--line);box-shadow:var(--card-shadow)}
.toc::-webkit-scrollbar,.filters::-webkit-scrollbar{display:none}
.toc p{display:none}
.toc a{flex-shrink:0;min-height:34px;padding:6px 12px!important;border:0!important;border-radius:999px;font-size:.82rem;white-space:nowrap}
.toc a[aria-current="location"]{background:var(--health-soft);color:var(--health-dark);font-weight:700}
.prose section{scroll-margin-top:calc(var(--header-h) + 64px)}
.prose h2{font-size:1.25rem;line-height:1.2}
.prose .section-number{font-size:.62rem}
#context{padding:16px 16px 14px;border-radius:16px;background:var(--card-bg);border:1px solid var(--line);border-left:4px solid var(--health-primary);box-shadow:var(--card-shadow)}
#context p{font-size:1.05rem;font-weight:500;line-height:1.6;color:var(--ink)}
.argument-box{border-radius:16px;overflow:hidden}
.evidence-card{border-radius:14px;background:var(--card-bg);border:1px solid var(--line);padding:14px!important}
.verdict-panel{border-radius:16px}
.article-rail{border-radius:14px}
.reading-placeholder,.discussion-preview,.toc a[href="#discussion"]{display:none}

/* ---------- Calculator ---------- */
body[data-page="tool"] .breadcrumbs{display:none}
.tool-intro{padding:var(--s4) 0 var(--s2)}
.tool-intro .eyebrow{color:var(--exercise-dark)}
.tool-intro h1{font-size:1.55rem;line-height:1.15}
.tool-intro p:not(.eyebrow){font-size:.92rem;color:var(--muted);line-height:1.5}
.tool-intro .save-button{min-height:34px;border-radius:999px;font-size:.8rem}
.tool-layout{gap:var(--s3);margin:var(--s2) 0 var(--s5)}
.tool-form{border:0;background:transparent;padding:0}
.tool-fields{grid-template-columns:1fr;gap:12px}
.tool-field:not(:has(select)){display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.5fr);align-items:center;gap:10px}
.tool-segmented{display:grid!important;grid-template-columns:minmax(0,.8fr) minmax(0,1.5fr);align-items:center;gap:10px}
.tool-segmented legend{float:left;padding:0}
.tool-label{font-size:.9rem;font-weight:600;letter-spacing:0}
.tool-field input,.tool-field select{min-height:50px;border-radius:12px;font-size:1.05rem;background:#fff;border-color:var(--line-strong)}
.tool-submit,.tool-next{width:100%;justify-content:center;min-height:54px;border-radius:14px;font-size:1.02rem;margin-top:var(--s4)}
.tool-result{position:static;border:0;border-radius:18px;padding:22px 18px;text-align:center}
.tool-result>.eyebrow{display:none}
.tool-result-label{font-size:.95rem}
.tool-result-main strong{font-size:3rem;font-weight:800;letter-spacing:-.03em}
.tool-result-main span{font-size:1.5rem}
.tool-rows{text-align:left;background:#fff;border:0;border-radius:12px;padding:4px 12px}
.tool-rows div:last-child{border-bottom:0}
.tool-note{text-align:left;border:0;border-radius:12px;background:#fff8e1;padding:12px 12px 12px 36px;position:relative;font-size:.84rem;line-height:1.45}
.tool-note::before{content:'';position:absolute;left:14px;top:17px;width:10px;height:10px;border-radius:50%;background:#e9b100;box-shadow:0 0 0 4px #f7d77a66}
.tool-disclaimer{font-size:.72rem}
.tool-prose h2{font-size:1.2rem}
.tool-formula{border-radius:12px;font-size:.78rem}
.advertisement{border-radius:14px}
.site-footer{padding-bottom:var(--s3)}
}
@media(max-width:380px){
.path-card{min-height:176px;padding:14px 12px 54px}
.path-card h2{font-size:1.15rem}
body[data-page="home"] #ferramentas .tool-card h3{font-size:.66rem}
.tool-field:not(:has(select)),.tool-segmented{grid-template-columns:minmax(0,.7fr) minmax(0,1.5fr)}
}
@media(prefers-reduced-motion:reduce){.path-card{transition:none}}
.tool-next[hidden]{display:none}

/* ---------- Section identity blocks (all widths). Solid domain colour + WHITE text on selected headers only;
   reading surfaces stay white. Saúde = aqua (--health-block) · Exercício = red (--exercise-block) + deep blue support. ---------- */
body[data-page="saude"] .page-intro,body[data-page="exercicio"] .page-intro,.tool-intro{--band:var(--health-block);margin-top:var(--s3);padding:clamp(18px,3vw,32px) clamp(18px,3vw,36px);border-radius:18px;background:var(--band);color:#fff}
body[data-page="exercicio"] .page-intro,.tool-intro{--band:var(--exercise-block)}
body[data-page="saude"] .page-intro *,body[data-page="exercicio"] .page-intro *,.tool-intro :is(h1,p,.eyebrow){color:#fff!important}
body[data-page="saude"] .page-intro .accent,body[data-page="exercicio"] .page-intro .accent{color:rgba(255,255,255,.7)!important}
.page-intro .eyebrow,.tool-intro .eyebrow{opacity:.85}
.tool-intro .save-button{border-color:rgba(255,255,255,.7);color:#fff}
.tool-intro .save-button[aria-pressed="true"]{background:#fff;color:var(--exercise-block)}
/* Health: key summary + category labels */
#context>h2{display:inline-block;background:var(--health-block);color:#fff;font-size:.8rem;letter-spacing:.06em;text-transform:uppercase;padding:5px 10px;border-radius:6px}
:root[data-domain="saude"] .verdict-panel .eyebrow{color:var(--health-light)}
body[data-page="saude"] .prototype-note{background:var(--health-soft)}
body[data-page="saude"] .filters button[aria-pressed="true"]{background:var(--health-block);border-color:var(--health-block);color:#fff}
/* Exercise: deep blue = structure / data / secondary */
body[data-page="exercicio"] .prototype-note{background:var(--exercise-blue-soft)}
body[data-page="exercicio"] .prototype-note .note-label{color:var(--exercise-blue)}
:root[data-domain="exercicio"] .section-heading .eyebrow,:root[data-domain="exercicio"] .tool-prose h2{color:var(--exercise-blue)}
.tool-rows{background:var(--exercise-blue-soft)}
.tool-rows dt{color:var(--exercise-blue)}
.tool-formula{background:var(--exercise-blue);border-color:var(--exercise-blue);color:#fff}
.tool-result-label{display:inline-block;background:var(--exercise-block);color:#fff!important;padding:5px 12px;border-radius:999px;font-size:.85rem}
.tool-card .card-arrow{color:var(--exercise-blue)}

@media(max-width:760px){
.tabbar{grid-template-columns:repeat(6,1fr)}
.tab-back{color:var(--muted)}
body[data-page="saude"] .page-intro h1,body[data-page="exercicio"] .page-intro h1{font-size:1.6rem;line-height:1.1}
body[data-page="saude"] .page-intro p:not(.eyebrow),body[data-page="exercicio"] .page-intro p:not(.eyebrow){font-size:.88rem;line-height:1.45}
.tool-intro{padding:18px}
.tool-intro h1{font-size:1.4rem}
.tool-intro p:not(.eyebrow){font-size:.86rem;opacity:.95}
/* Health article: title block in solid aqua with white text */
.article-title{background:var(--health-block);color:#fff;border-radius:18px;padding:18px 18px 16px}
.article-title .eyebrow{background:rgba(255,255,255,.18);color:#fff}
.article-title h1,.article-title .claim-line,.article-title .article-meta{color:#fff}
.article-title .claim-line{opacity:.92}
.article-title .article-meta{opacity:.8}
.article-actions .share-button,.article-actions .save-button{border-color:rgba(255,255,255,.7);color:#fff;background:transparent}
.article-actions .save-button[aria-pressed="true"]{background:#fff;color:var(--health-dark)}
.article-score{background:var(--health-soft)!important}
.toc a[aria-current="location"]{background:var(--health-block);color:#fff}
}
@media(max-width:380px){.tab{font-size:.62rem}.tab .ico{width:21px;height:21px}}

/* Evidence bar on phones: classification first; the three-point scale collapses to its two ends. */
@media(max-width:760px){
.investigation-card{--bar-gap:#fff}
.investigation-card .card-bottom{align-items:center}
.investigation-card .evidence-bar .evidence-label{display:flex}
.investigation-card .evidence-bar .evidence-num{display:block}
.evidence-bar[data-size="full"] .evidence-label{font-size:.9rem}
}
@media(max-width:380px){.evidence-bar[data-size="full"] .evidence-scale span:nth-child(2){display:none}}

/* ---------- Desktop navigation (v0.16): Metodologia and Sobre leave the top bar and live in the bottom bar with
   Voltar and Início. Below 761px the top nav is the "Mais" menu, so they stay there for phones. ---------- */
@media(min-width:761px){
#navigation>a[data-nav="methodology"],#navigation>a[data-nav="about"],#navigation>a.nav-phone-only{display:none}
.utility-group{display:flex;align-items:center;gap:6px}
.ubtn-text{padding:0 10px}
.utility-bar .ubtn{height:28px}
.ubtn[aria-current="page"]{border-color:var(--ink);color:var(--ink)}
}
