/* FatoForma visual system (v0.28) — the reference-matched skin. Loaded LAST on every public page.
   Colours, radii, shadows, gradients, fonts and art come from tokens.css (--brand-*, --grad-*, --radius-*, --shadow-*,
   --art-*); this file only applies them to existing components. No markup or behaviour depends on it: removing the
   <link> restores the previous look. Mobile layout (≤760px) still lives in mobile.css; the rules here refine it. */

/* ---------- Type: Sora for display/headings, Manrope for body/UI ---------- */
body{font-family:var(--sans);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
:is(h1,h2,.path-card h2,.essay-header h1,.essay-section h2,.essay-sources h2,.essay-related h2,.latest-article h2,.score-question,.not-scored-panel .not-scored-value){font-weight:700;letter-spacing:-.03em}
:is(h3,h4,.investigation-card h3,.archive-row h3,.area-panel h3,.evidence-card h3,.essay-card h3,.search-title,.kn-node>h3,.kn-node>h4,.kn-source h3,.method-strip h3,.reading-placeholder h3,.enr-entry h4){font-weight:650;letter-spacing:-.02em}
/* long-form reading and small data labels stay in the body face */
:is(.essay-body,.excerpt,.claim-line,.enr-md blockquote,.essay-subtitle,.latest-article-dek,.hero-search input,.footer-top p,.kn-table tbody th,.kn-person-name,.kn-family-name,.imp-map-head strong,.index-number,.method-strip li>span){font-family:var(--sans)}
.eyebrow,.card-meta,.edition-line,.note-label{font-family:var(--sans);font-weight:700;letter-spacing:.14em;color:var(--muted)}
.text-link{color:var(--health-dark);font-weight:700}
h1 em{font-style:normal;color:var(--health-primary)}   /* Sora has no italic: emphasis is colour, as in the hero */
.text-link:hover{color:var(--ink)}

/* ---------- Header: airy, translucent, no hard rule ---------- */
.site-header{background:rgba(246,248,247,.82);-webkit-backdrop-filter:saturate(1.4) blur(14px);backdrop-filter:saturate(1.4) blur(14px);border-bottom:1px solid rgba(23,50,71,.06);box-shadow:none}
.hbtn,.ubtn{border-color:transparent;border-radius:var(--radius-pill);background:transparent;color:var(--ink);font-weight:700}
.hbtn:hover,.ubtn:hover,.hbtn:active,.ubtn:active,.hbtn[aria-expanded="true"]{border-color:transparent;background:rgba(23,50,71,.06);color:var(--ink)}
.hbtn[aria-current="page"],.ubtn[aria-current="page"]{border-color:transparent;background:var(--card-bg);color:var(--ink);box-shadow:var(--card-shadow)}
.site-header .search-toggle{background:var(--card-bg);box-shadow:var(--card-shadow)}
.search-toggle .hbtn-icon,.utility-search .hbtn-icon{color:var(--ink)}
#navigation>a{font-weight:600;color:var(--text)}
#navigation>a:hover,#navigation>a[aria-current="page"]{color:var(--ink)}
.utility-bar{background:rgba(246,248,247,.9);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border-top-color:rgba(23,50,71,.06)}

/* ---------- Buttons, chips, inputs ---------- */
.button{border:0;border-radius:var(--radius-pill);background:var(--brand-navy);color:#fff;padding:12px 22px;box-shadow:0 6px 16px #17324726}
.button:hover{background:var(--health-block);color:#fff}
.filters button{border-radius:var(--radius-pill);border-color:var(--line);background:var(--card-bg);font-weight:600}
.filters button[aria-pressed=true]{background:var(--brand-navy);border-color:var(--brand-navy);color:#fff}
input[type="text"],input[type="number"],input[type="search"],select,textarea{border-radius:var(--radius-sm)}

/* ---------- Search: pill field + teal CTA (reusable: hero and search dialog) ---------- */
.hero-search-box{min-height:64px;padding:0 7px 0 22px;gap:14px;border:1px solid rgba(23,50,71,.05);border-radius:var(--radius-pill);background:var(--card-bg);box-shadow:var(--shadow-soft);transition:box-shadow .2s}
.hero-search-box:hover{border-color:rgba(23,50,71,.08);background:var(--card-bg);box-shadow:var(--shadow-lift)}
.hero-search-box:focus-within{outline:2px solid var(--focus);outline-offset:2px}
.hero-search-box>.hbtn-icon{width:22px;height:22px;color:var(--ink)}
.hero-search input{font:500 1.05rem/1.3 var(--sans);color:var(--ink)}
.hero-search input::placeholder{color:var(--muted)}
.hero-search-submit{height:50px;padding:0 22px;border-radius:var(--radius-pill);background:var(--health-block);color:#fff;font:700 .8rem/1 var(--sans);letter-spacing:.16em;box-shadow:0 6px 14px #17706c33}
.hero-search-submit:hover{background:var(--health-dark);text-decoration:none}
.hero-search-kbd{border-radius:6px}
.hero-search-label{color:var(--muted)}
.hero-search-examples button{border-color:var(--line);background:var(--card-bg);border-radius:var(--radius-pill);font-weight:600}
.hero-search-examples button:hover{border-color:var(--health-primary);color:var(--health-dark);background:var(--card-bg)}

/* ---------- Home: soft art direction ---------- */
body[data-page="home"]{background:var(--art-hero) no-repeat right -70px top -40px/min(56vw,720px) auto,var(--paper)}
body[data-page="home"] .edition-line{color:var(--faint)}
body[data-page="home"] .hero h1{color:var(--ink);font-size:clamp(3rem,5.2vw,4.6rem);line-height:1.02;letter-spacing:-.045em}
body[data-page="home"] .hero h1 em{font-style:normal;color:var(--health-primary)}
body[data-page="home"] .hero h1 .accent{color:var(--health-primary)}
body[data-page="home"] .hero-description{font-size:1.1rem;line-height:1.6;color:var(--muted)}
body[data-page="home"] .hero .eyebrow{color:var(--health-dark)}
.mini-rule{background:currentColor}
/* the illustrative index floats over the art as a frosted card */
.hero-score{border:1px solid rgba(255,255,255,.7);border-radius:var(--radius-lg);background:rgba(255,255,255,.72);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);box-shadow:var(--shadow-soft)}
.outline-tag{border-radius:var(--radius-pill)}

/* Saúde / Exercício entry cards: gradient, art overlay, icon badge, round arrow */
.paths{gap:20px;margin:36px 0 28px}
.path-card{--path:var(--health-block);--grad:var(--grad-health);--art:var(--art-health);position:relative;overflow:hidden;min-height:250px;padding:30px 30px 92px;gap:10px;border:0;border-radius:var(--radius-lg);background:var(--art) no-repeat right -30px bottom -40px/min(330px,62%) auto,var(--grad);color:#fff;box-shadow:0 14px 30px #0f58561f;transition:transform .2s,box-shadow .2s}
.path-card[data-path="exercicio"]{--path:var(--exercise-block);--grad:var(--grad-exercise);--art:var(--art-exercise);box-shadow:0 14px 30px #bf4f3c24}
.path-card:hover{background:var(--art) no-repeat right -30px bottom -40px/min(330px,62%) auto,var(--grad);transform:translateY(-2px);box-shadow:0 20px 38px #17324729;filter:none}
.path-card .eyebrow{display:none}
.path-icon{display:inline-flex;align-items:center;justify-content:center;width:56px;height:56px;border-radius:50%;background:rgba(255,255,255,.2);box-shadow:inset 0 0 0 1px rgba(255,255,255,.25);color:#fff;margin-bottom:6px}
.path-icon .ico{width:28px;height:28px}
.path-card h2{font-family:var(--serif);font-weight:700;font-size:clamp(1.8rem,2.6vw,2.4rem);line-height:1.05;letter-spacing:-.03em;color:#fff}
.path-card p{max-width:30ch;font-size:1.02rem;line-height:1.5;font-weight:500;color:rgba(255,255,255,.94)}
.path-link{position:absolute;left:30px;bottom:26px;display:inline-flex;align-items:center;gap:12px;padding:0;color:#fff;font-weight:700}
.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:44px;height:44px;border-radius:50%;background:#fff;color:var(--path);font-size:0;box-shadow:0 6px 14px #0000001f}
.path-arrow::before{content:'';width:9px;height:9px;border-top:2.5px solid currentColor;border-right:2.5px solid currentColor;transform:translateX(-2px) rotate(45deg);border-radius:1px}
@media(prefers-reduced-motion:reduce){.path-card{transition:none}.path-card:hover{transform:none}}

/* Prototype band: icon badge · label · divider · explanation */
.prototype-note{display:grid;grid-template-columns:auto auto minmax(0,1fr);align-items:center;gap:0 18px;padding:16px 22px;margin:20px 0;border:0;border-radius:var(--radius-md);background:#EAF2EF;color:var(--muted);font-size:.86rem;line-height:1.55}
.prototype-note::before{content:'';width:48px;height:48px;border-radius:50%;background:var(--health-light) no-repeat center/24px 24px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23146A67' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 3h6M10 3v6.2L4.8 18.4A1.7 1.7 0 0 0 6.3 21h11.4a1.7 1.7 0 0 0 1.5-2.6L14 9.2V3'/%3E%3Cpath d='M7.5 15h9'/%3E%3C/svg%3E")}
.prototype-note .note-label{padding-right:18px;border-right:1px solid var(--line-strong);color:var(--ink);font-size:.78rem;letter-spacing:.2em}
.prototype-note>span:last-child{min-width:0}

/* Section headings */
.section-heading{align-items:end;margin-bottom:18px}
.section-heading h2{font-size:clamp(1.6rem,2.4vw,2.1rem);line-height:1.1}
.section-heading>.text-link{color:var(--health-dark);font-weight:700}
:root[data-domain="exercicio"] .section-heading>.text-link{color:var(--exercise-dark)}
.investigation-section{padding-top:28px}

/* Claim / question cards: separate soft cards with a teal edge */
.investigation-grid,.related-grid{gap:18px;border:0}
.investigation-card{position:relative;border:1px solid rgba(23,50,71,.06);border-radius:var(--card-radius);background:var(--card-bg);box-shadow:var(--card-shadow);padding:20px 22px 18px;transition:box-shadow .2s,transform .2s}
a.investigation-card:not(.tool-card){box-shadow:var(--card-shadow);border-left:4px solid var(--health-primary)}
.investigation-card:hover{background:var(--card-bg);box-shadow:var(--shadow-lift);transform:translateY(-1px)}
.investigation-card h3{color:var(--ink);line-height:1.22}
.investigation-card p{color:var(--muted)}
.investigation-card .index-number{color:var(--faint)}
.card-arrow{border-color:var(--line)!important;color:var(--ink)}
@media(prefers-reduced-motion:reduce){.investigation-card{transition:none}.investigation-card:hover{transform:none}}
/* tool cards: soft coral surface */
.tool-card{border:0!important;background:var(--exercise-soft);box-shadow:none;border-radius:var(--card-radius)}
.tool-card:hover{background:#FAE4DE}
.tool-card .tool-icon{background:var(--card-bg);color:var(--exercise-primary);border-radius:14px;box-shadow:0 2px 6px #bf4f3c14}

/* Lower home bands */
.method-strip{border-radius:var(--radius-lg);background:linear-gradient(150deg,#1D4560 0%,var(--brand-navy) 100%);overflow:hidden;box-shadow:var(--shadow-soft)}
.community-actions>div{border-radius:var(--radius-sm)}
.advertisement{border-radius:var(--radius-md);border-color:var(--line-strong);background:rgba(255,255,255,.5)}
.site-footer{background:var(--footer-bg);border-top:0}

/* ---------- Section identity bands (hubs, calculator, article title): gradient + art ---------- */
body[data-page="saude"] .page-intro,body[data-page="exercicio"] .page-intro,.tool-intro{border-radius:var(--radius-lg);background:var(--art-health) no-repeat right -30px bottom -50px/min(46%,300px) auto,var(--grad-health);box-shadow:0 14px 30px #0f58561a}
body[data-page="exercicio"] .page-intro,.tool-intro{background:var(--art-exercise) no-repeat right -20px bottom -40px/min(46%,300px) auto,var(--grad-exercise);box-shadow:0 14px 30px #bf4f3c1f}
.article-score,.verdict-panel,.argument-box,.evidence-card,.article-rail,.toc,#context,.tool-result,.tool-rows,.tool-note,.tool-formula{border-radius:var(--radius-md)}
.tool-submit,.tool-next{border-radius:var(--radius-pill)}
.tool-form{border-radius:var(--radius-md);background:var(--card-bg);box-shadow:var(--card-shadow)}

/* ---------- Phones (≤760px): refinements of mobile.css ---------- */
@media(max-width:760px){
body[data-page="home"]{background:var(--art-hero) no-repeat right -84px top -80px/340px auto,var(--paper)}
body[data-page="home"] .site-header{background:transparent;border-bottom-color:transparent;-webkit-backdrop-filter:none;backdrop-filter:none;position:relative}
.site-header{background:rgba(246,248,247,.86)}
.header-tools>.search-toggle{width:44px;height:44px;background:rgba(255,255,255,.8);box-shadow:var(--card-shadow)}
.site-logo-img{height:32px}
body[data-page="home"] .hero{padding:22px 0 6px}
body[data-page="home"] .hero h1{font-size:clamp(2rem,9.4vw,2.6rem);line-height:1.04;letter-spacing:-.045em}
body[data-page="home"] .hero-description{font-size:.98rem;line-height:1.5;margin-top:14px;max-width:34ch}
.hero-search{margin-top:22px}
.hero-search-box{min-height:62px;padding:0 6px 0 16px;gap:10px}
.hero-search-box>.hbtn-icon{width:20px;height:20px}
.hero-search input{font-size:.95rem}
.hero-search-submit{width:auto;height:50px;padding:0 14px;gap:7px;letter-spacing:.1em}
.hero-search-submit-label{position:static;width:auto;height:auto;overflow:visible;clip:auto}
.paths{grid-template-columns:1fr 1fr;gap:12px;margin:16px 0 12px}
.path-card{min-height:190px;padding:16px 14px 62px;border-radius:20px;gap:6px;background-size:78% auto,auto;background-position:right -18px bottom -22px,0 0}
.path-card:hover{background-size:78% auto,auto;background-position:right -18px bottom -22px,0 0}
.path-icon{width:44px;height:44px;margin-bottom:4px}
.path-icon .ico{width:24px;height:24px}
.path-card h2{font-size:1.5rem}
.path-card p{font-size:.84rem;line-height:1.4}
.path-link{left:14px;bottom:14px}
.path-arrow{width:36px;height:36px}
.path-arrow::before{width:8px;height:8px}
.prototype-note{grid-template-columns:auto auto minmax(0,1fr);gap:0 10px;padding:12px 12px;margin:12px 0;border-radius:16px;font-size:.72rem;line-height:1.45}
.prototype-note::before{width:36px;height:36px;background-size:18px 18px}
.prototype-note .note-label{padding-right:10px;font-size:.64rem;letter-spacing:.14em}
/* inner pages carry longer labels: stack label over text beside the icon */
body:not([data-page="home"]) .prototype-note{grid-template-columns:auto minmax(0,1fr);row-gap:2px}
body:not([data-page="home"]) .prototype-note::before{grid-row:span 2}
body:not([data-page="home"]) .prototype-note .note-label{border-right:0;padding-right:0}
.section-heading{align-items:end}
.section-heading h2{font-size:1.5rem}
.section-heading .eyebrow{font-size:.66rem;letter-spacing:.16em}
.section-heading>.text-link{font-size:.84rem;color:var(--health-dark)}
.section-heading>.text-link::after{content:'';width:6px;height:6px;border-top:2px solid currentColor;border-right:2px solid currentColor;transform:rotate(45deg);margin-left:-4px}
.investigation-grid,.related-grid{gap:12px}
.investigation-card{padding:16px 46px 14px 18px;border-radius:18px}
.investigation-card h3{font-size:1.08rem}
.investigation-card .card-arrow::after{color:var(--ink)}
.tool-card{border-radius:18px}
/* Bottom navigation: soft elevated sheet, teal active state with a pill marker */
.tabbar{height:calc(var(--tabbar-h) + 6px + env(safe-area-inset-bottom));border-top:0;border-radius:22px 22px 0 0;background:rgba(255,255,255,.97);box-shadow:0 -8px 28px #1732471a}
.tab{position:relative;font-weight:600;color:var(--muted);font-size:.7rem}
.tab[aria-current="page"],.tab[aria-expanded="true"]{color:var(--health-block)}
.tab[data-tab="exercicio"][aria-current="page"]{color:var(--exercise-block)}
.tab[aria-current="page"]::after{content:'';position:absolute;bottom:5px;left:50%;width:22px;height:4px;margin-left:-11px;border-radius:4px;background:currentColor;opacity:.45}
}
@media(max-width:380px){
.path-card{min-height:184px;padding:14px 12px 58px}
.path-card h2{font-size:1.32rem}
.path-card p{font-size:.78rem}
.hero-search-submit{padding:0 14px;letter-spacing:.12em}
}
@media(max-width:359px){
.hero-search-submit{width:44px;padding:0;justify-content:center}
.hero-search-submit-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
}
@media(min-width:901px) and (max-width:1279px){
.hero-score{grid-template-columns:1fr;grid-template-areas:"top" "q" "meter" "cap" "exp"}
.hero-score .score-question{margin-bottom:var(--s2)}
}
@media(max-width:400px){
body[data-page="home"] .prototype-note{grid-template-columns:auto minmax(0,1fr);row-gap:2px}
body[data-page="home"] .prototype-note::before{grid-row:span 2}
body[data-page="home"] .prototype-note .note-label{border-right:0;padding-right:0}
}

/* ---------- Header (v0.38, Phase 1 dashboard): nav icons, Ferramentas, search pill, future account area ---------- */
#navigation a[data-nav="saude"]::before,#navigation a[data-nav="exercicio"]::before{display:none}   /* icons replace the dots */
#navigation>a{display:inline-flex;align-items:center;gap:8px}
.nav-ico{flex:none;opacity:.85}
#navigation>a[aria-current="page"] .nav-ico,#navigation>a:hover .nav-ico{opacity:1}
.header-future{display:none}
@media(min-width:1080px){
.home-button{margin-left:28px}
.site-header .home-button{height:44px;padding:0 18px;gap:9px;border:0;border-radius:var(--radius-pill);font:600 .95rem/1 var(--sans);letter-spacing:0;text-transform:none;color:var(--text)}
.site-header .home-button[aria-current="page"],.site-header .home-button.active{background:var(--card-bg);box-shadow:var(--card-shadow);color:var(--ink)}
.site-header .home-button .hbtn-icon{width:18px;height:18px}
.site-header nav{gap:26px;margin-left:22px}
.header-tools{margin-left:auto;gap:10px}
.site-header .header-tools>.search-toggle{width:190px;height:44px;justify-content:flex-start;gap:10px;padding:0 16px;border:0;border-radius:var(--radius-pill);font:500 .9rem/1 var(--sans);letter-spacing:0;text-transform:none;color:var(--muted)}
.site-header .header-tools>.search-toggle .stable-label{justify-items:start}
.site-header .header-tools>.search-toggle [data-i18n="search.open"]::after{content:'…'}
.header-future{display:flex;align-items:center;gap:10px;padding-left:12px;margin-left:4px;border-left:1px solid var(--line)}
.header-bell{width:40px;height:40px;padding:0;border:0;border-radius:50%;color:var(--ink);background:transparent}
.header-bell .hbtn-icon{width:20px;height:20px}
.header-bell[aria-disabled="true"]{opacity:.5;cursor:default}
.header-bell[aria-disabled="true"]:hover{background:transparent}
.header-account{white-space:nowrap;display:inline-flex;align-items:center;gap:10px;height:44px;padding:0 14px 0 4px;border-radius:var(--radius-pill);font-weight:600;font-size:.9rem;color:var(--ink);text-decoration:none}
.header-account:hover{background:var(--card-bg);box-shadow:var(--card-shadow);text-decoration:none}
.header-avatar{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;background:var(--health-soft);color:var(--health-dark)}
}
@media(min-width:1080px) and (max-width:1379px){.header-account>span[data-i18n]{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.header-account{padding:0 4px}.site-header .header-tools>.search-toggle{width:150px}.site-header nav{gap:18px;margin-left:12px}.home-button{margin-left:16px}}
/* Phones (v0.43): the same account entry as desktop, reduced to its avatar beside the search button; no bell. */
@media(max-width:760px){
.header-future{display:flex;align-items:center;margin-left:2px}
.header-bell{display:none}
.header-account{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:50%;background:rgba(255,255,255,.8);box-shadow:var(--card-shadow);color:var(--health-dark)}
.header-account>span[data-i18n]{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
.header-avatar{display:inline-flex}
.header-account:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.site-header{box-shadow:0 1px 0 rgba(23,50,71,.05)}
body[data-page="home"] .site-header{box-shadow:none}
}

/* ==========================================================================
   Calculator suite (v0.48): Ferramentas hub (ferramentas.html) + tool pages (ferramenta.html). Calculators belong to
   SAÚDE: on these two pages the Exercise tokens are remapped to the Saúde (teal) family, so every existing tool rule
   (mobile.css, theme.css) turns teal without being rewritten. Tool cards are teal everywhere.
   ========================================================================== */
body[data-page="tool"],body[data-page="ferramentas"]{--exercise-primary:var(--health-primary);--exercise-secondary:var(--health-secondary);--exercise-soft:var(--health-soft);--exercise-dark:var(--health-dark);--exercise-block:var(--health-block);--grad-exercise:var(--grad-health);--art-exercise:var(--art-health)}
body[data-page="ferramentas"] .page-intro{margin-top:var(--s3);padding:clamp(18px,3vw,32px) clamp(18px,3vw,36px);border-radius:var(--radius-lg);background:var(--art-health) no-repeat right -30px bottom -50px/min(46%,300px) auto,var(--grad-health);box-shadow:0 14px 30px #0f58561a;color:#fff}
body[data-page="ferramentas"] .page-intro *{color:#fff!important}
body[data-page="ferramentas"] .page-intro .accent{color:rgba(255,255,255,.7)!important}
body[data-page="ferramentas"] .edition-line{display:none}
body[data-page="ferramentas"] .prototype-note{background:var(--health-soft)}

/* Tool cards (hub, home, hubs, related, saved): Saúde accent, hover lift on desktop, pressed state on touch */
.tool-card{background:var(--health-soft)}
.tool-card:hover{background:#DDEFEA}
.tool-card .tool-icon,.tool-icon{color:var(--health-block)}
.tool-card .tool-icon{background:var(--card-bg);box-shadow:0 2px 6px #17706c14}
.tool-card:active{transform:scale(.985);background:#D3EAE4}
.tool-card:focus-visible{outline:2px solid var(--focus);outline-offset:3px}
@media(prefers-reduced-motion:reduce){.tool-card:active{transform:none}}

.tool-cta{color:var(--health-dark)}
/* Limitation notes: the phone style (soft amber card with a dot) on every width */
.tool-note{position:relative;margin:0 0 var(--s2);padding:10px 12px 10px 34px;border:0;border-radius:var(--radius-sm);background:#FFF8E1;font-size:.86rem;line-height:1.45;text-align:left}
.tool-note::before{content:'';position:absolute;left:13px;top:15px;width:9px;height:9px;border-radius:50%;background:#E9B100;box-shadow:0 0 0 4px #f7d77a66}
/* Hub: one section per category */
.tools-category{padding-top:28px}
.tools-category-intro{margin:6px 0 0;max-width:60ch;color:var(--muted);font-size:.95rem;line-height:1.5}
.tools-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:18px}
.tools-grid .tool-card{min-height:190px}
.tools-grid .tool-card .card-meta{display:none}   /* the category heading already says it */
.tools-grid .tool-card .tool-icon{margin-bottom:var(--s3)}
.tools-flow-list{display:flex;flex-wrap:wrap;align-items:center;gap:10px 8px;margin:0;padding:0;list-style:none;counter-reset:flow}
.tools-flow-list li{display:flex;align-items:center;gap:8px;counter-increment:flow}
.tools-flow-list li+li::before{content:'→';color:var(--faint)}
.tools-flow-list a{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px;border-radius:var(--radius-pill);background:var(--card-bg);box-shadow:var(--card-shadow);color:var(--ink);font-weight:700;text-decoration:none}
.tools-flow-list a::before{content:counter(flow);display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;background:var(--health-soft);color:var(--health-dark);font-size:.75rem}
.tools-flow-list a:hover{background:var(--health-soft)}

/* Tool page: form */
.tool-field[hidden],.tool-segmented[hidden]{display:none!important}
.tool-help{display:block;font-size:.78rem;line-height:1.4;color:var(--muted)}
.tool-help a{color:var(--health-dark);font-weight:700;text-decoration:underline;text-underline-offset:2px}
.tool-optional{font-weight:500;color:var(--muted);font-size:.8em}
.tool-prefill{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;margin:0 0 var(--s3);padding:10px 14px;border-radius:var(--radius-sm);background:var(--health-soft);color:var(--health-dark);font-size:.84rem;line-height:1.4}
.tool-prefill .text-link{min-height:32px;padding:0;border:0;background:none;font:inherit;font-weight:700;cursor:pointer;text-decoration:underline;text-underline-offset:2px}
.tool-error{margin-top:var(--s3);padding:12px 14px;border-left:4px solid var(--ev-1);border-radius:var(--radius-sm);background:#FDECEB;color:#8E2A1F;font-size:.9rem;line-height:1.45}
.tool-error p{margin:0}
.tool-error ul{margin:6px 0 0;padding-left:1.1em}
.tool-error[hidden]{display:none}
/* Tool page: result hierarchy — main value → interpretation band → meaning → rows/table → notes → next → method */
.tool-band{display:inline-flex;align-items:center;gap:8px;margin:0 0 var(--s2);padding:6px 12px;border-radius:var(--radius-pill);font-weight:700;font-size:.88rem;background:var(--health-soft);color:var(--health-dark)}
.tool-band::before{content:'';width:8px;height:8px;border-radius:50%;background:currentColor}
.tool-band[data-tone="info"]{background:#EAF0F4;color:var(--brand-navy)}
.tool-band[data-tone="warn"]{background:#FFF1D6;color:#7A5200}
.tool-band[data-tone="alert"]{background:#FDECEB;color:#9B3325}
.tool-meaning{margin:0 0 var(--s3);color:var(--ink);font-size:1rem;line-height:1.5}
.tool-result-main.is-warning strong{font-size:1.6rem;line-height:1.2;color:#9B3325}
.tool-bars{display:flex;gap:3px;height:12px;margin:0 0 var(--s3);border-radius:var(--radius-pill);overflow:hidden}
.tool-bars span{display:block;flex-grow:0;flex-shrink:0}
.tool-bars [data-i="0"],.tool-table[data-cols="4"] tbody tr:nth-child(1) th::before{background:var(--brand-navy)}
.tool-bars [data-i="1"],.tool-table[data-cols="4"] tbody tr:nth-child(2) th::before{background:var(--health-primary)}
.tool-bars [data-i="2"],.tool-table[data-cols="4"] tbody tr:nth-child(3) th::before{background:var(--brand-mint)}
.tool-table{width:100%;margin:0 0 var(--s3);border-collapse:collapse;font-size:.9rem;text-align:left;background:var(--card-bg);border-radius:var(--radius-sm);overflow:hidden}
.tool-table caption{padding:0 0 6px;text-align:left;font-size:.72rem;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}
.tool-table th,.tool-table td{padding:9px 12px;border-bottom:1px solid var(--line)}
.tool-table thead th{font-size:.75rem;font-weight:700;color:var(--muted);background:var(--soft)}
.tool-table td,.tool-table thead th:not(:first-child){text-align:right;font-variant-numeric:tabular-nums}
.tool-table tbody th{font-weight:600;color:var(--ink)}
.tool-table[data-cols="4"] tbody th::before{content:'';display:inline-block;width:10px;height:10px;margin-right:8px;border-radius:3px;vertical-align:-1px}
.tool-table tr[aria-current="true"]{background:var(--health-soft)}
.tool-table tr[aria-current="true"] :is(th,td){font-weight:800;color:var(--health-dark)}
.tool-you{display:inline-block;margin-left:6px;padding:1px 8px;border-radius:var(--radius-pill);background:var(--health-block);color:#fff;font-size:.7rem;font-weight:700;vertical-align:1px}
.tool-method{margin-top:var(--s3);border-top:1px solid var(--line);padding-top:var(--s2);text-align:left}
.tool-method summary{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:10px;min-height:44px;padding:4px 0;cursor:pointer;font-weight:700;color:var(--ink);list-style:none}
.tool-method summary::-webkit-details-marker{display:none}
.tool-method summary::after{content:'';grid-column:2;grid-row:1 / span 2;width:7px;height:7px;margin-right:4px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);transition:transform .15s}
.tool-method[open] summary::after{transform:rotate(-135deg)}
.tool-method summary:focus-visible{outline:2px solid var(--focus);outline-offset:2px;border-radius:6px}
.tool-method-label{grid-column:1;font-weight:500;color:var(--muted);font-size:.82rem;line-height:1.35}
.tool-method .tool-formula{margin:var(--s2) 0}
.tool-method .text-link{min-height:36px;font-size:.85rem}

/* Phones: one-column cards, stacked tables, full-width touch targets */
@media(max-width:760px){
.tool-field .tool-help,.tool-segmented .tool-help{grid-column:1 / -1;margin-top:-2px}
.tool-segmented .segmented{min-width:0}
.tool-segmented .segmented span{padding:0 4px;text-align:center}
.tool-result .tool-band{margin-top:2px}
.tool-meaning{font-size:.95rem}
.tool-result-main strong{overflow-wrap:anywhere}
.tool-result-main.is-warning strong{font-size:1.45rem}
.tool-table{background:transparent;font-size:.88rem}
.tool-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
.tool-table,.tool-table tbody{display:block}
.tool-table tr{display:block;margin-bottom:8px;padding:10px 12px;border-radius:12px;background:var(--card-bg)}
.tool-table th,.tool-table td{display:flex;justify-content:space-between;gap:10px;padding:3px 0;border:0;text-align:right}
.tool-table tbody th{display:block;text-align:left;margin-bottom:2px}
.tool-table td::before{content:attr(data-label);color:var(--muted);font-weight:500;text-align:left}
.tool-table[data-cols="2"] tr{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:6px}
.tool-table[data-cols="2"] tbody th{margin:0}
.tool-table[data-cols="2"] td::before{content:none}
.tool-table[data-cols="4"] tr{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:2px 10px}
.tool-table[data-cols="4"] tbody th{grid-column:1 / -1}
.tool-table[data-cols="4"] td{flex-direction:column;align-items:flex-start;gap:0;text-align:left;font-weight:700;color:var(--ink)}
.tool-table[data-cols="4"] td::before{font-size:.72rem;font-weight:500}
.tools-category{padding-top:18px}
.tools-category .section-heading h2{font-size:1.35rem}
.tools-category-intro{font-size:.86rem}
.tools-grid{grid-template-columns:1fr;gap:10px}
.tools-grid .tool-card{display:grid;grid-template-columns:44px minmax(0,1fr) 28px;grid-template-areas:"icon title arrow" "icon desc arrow";align-items:center;column-gap:12px;row-gap:2px;min-height:0;padding:14px;border-radius:18px;text-align:left}
.tools-grid .tool-card .tool-icon{grid-area:icon;margin:0;width:44px;height:44px}
.tools-grid .tool-card h3{grid-area:title;margin:0;font-size:1rem}
.tools-grid .tool-card p{grid-area:desc;margin:0;font-size:.8rem;-webkit-line-clamp:2}
.tools-grid .tool-card .card-bottom{grid-area:arrow;margin:0;padding:0}
.tools-flow-list{gap:8px 6px}
.tools-flow-list a{min-height:40px;padding:0 12px;font-size:.88rem}
}

/* ==========================================================================
   Top navigation affordance (added in 0.49): every nav item is a pill control with a section-coloured hover/active state.
   Colours are resolved on :root from the existing tokens, so page-level remaps (the tool pages turn the Exercise
   tokens teal) never recolour the nav. Saúde = health family · Exercício = exercise family · Artigos = navy ·
   Ferramentas = sage. Hover and active share the same look; the active item also keeps its underline.
   ========================================================================== */
:root{
--nav-saude-c:var(--health-dark);--nav-saude-bg:var(--health-soft);--nav-saude-accent:var(--health-primary);
--nav-exercicio-c:var(--exercise-dark);--nav-exercicio-bg:var(--exercise-soft);--nav-exercicio-accent:var(--exercise-primary);
--nav-alimentacao-c:var(--food-dark);--nav-alimentacao-bg:var(--food-soft);--nav-alimentacao-accent:var(--food-block);
--nav-articles-c:var(--brand-navy);--nav-articles-bg:var(--exercise-blue-soft);--nav-articles-accent:var(--brand-navy);
--nav-ferramentas-c:var(--ink);--nav-ferramentas-bg:var(--soft);--nav-ferramentas-accent:var(--brand-mint);
--nav-default-c:var(--ink);--nav-default-bg:var(--hover);--nav-default-accent:var(--ink)}
@supports (background:color-mix(in srgb,red 50%,white)){:root{--nav-ferramentas-bg:color-mix(in srgb,var(--brand-mint) 26%,var(--card-bg))}}
#navigation>a{--nav-c:var(--nav-default-c);--nav-bg:var(--nav-default-bg);--nav-accent:var(--nav-default-accent);
  position:relative;padding:9px 14px;border-radius:var(--radius-pill);color:var(--text);text-decoration:none;cursor:pointer;
  transition:background-color .18s ease,color .18s ease,box-shadow .18s ease,transform .12s ease}
#navigation>a[data-nav="saude"]{--nav-c:var(--nav-saude-c);--nav-bg:var(--nav-saude-bg);--nav-accent:var(--nav-saude-accent)}
#navigation>a[data-nav="exercicio"]{--nav-c:var(--nav-exercicio-c);--nav-bg:var(--nav-exercicio-bg);--nav-accent:var(--nav-exercicio-accent)}
#navigation>a[data-nav="alimentacao"]{--nav-c:var(--nav-alimentacao-c);--nav-bg:var(--nav-alimentacao-bg);--nav-accent:var(--nav-alimentacao-accent)}
#navigation>a[data-nav="articles"]{--nav-c:var(--nav-articles-c);--nav-bg:var(--nav-articles-bg);--nav-accent:var(--nav-articles-accent)}
#navigation>a[data-nav="ferramentas"]{--nav-c:var(--nav-ferramentas-c);--nav-bg:var(--nav-ferramentas-bg);--nav-accent:var(--nav-ferramentas-accent)}
#navigation>a .nav-ico{color:var(--nav-accent);transition:transform .18s ease}
/* underline indicator: grows from the centre on hover, stays on the current section */
#navigation>a::after{content:'';position:absolute;left:14px;right:14px;bottom:3px;height:2px;border-radius:2px;background:var(--nav-accent);transform:scaleX(0);transition:transform .2s ease}
#navigation>a:hover,#navigation>a:focus-visible,#navigation>a[aria-current="page"],#navigation>a.active{background:var(--nav-bg);color:var(--nav-c);text-decoration:none}
#navigation>a:hover::after,#navigation>a:focus-visible::after,#navigation>a[aria-current="page"]::after,#navigation>a.active::after{transform:scaleX(1)}
#navigation>a:hover{box-shadow:0 0 0 1px color-mix(in srgb,var(--nav-accent) 22%,transparent),0 4px 12px color-mix(in srgb,var(--nav-accent) 16%,transparent)}
#navigation>a:hover .nav-ico{transform:scale(1.1)}
#navigation>a:active{transform:scale(.97)}
#navigation>a:focus-visible{outline:2px solid var(--nav-c);outline-offset:2px}   /* text colour: ≥ 3:1 on the page for every section */
#navigation>a[aria-current="page"],#navigation>a.active{font-weight:700}
@media(min-width:1080px){.site-header nav{gap:4px}}                               /* the pills' own padding now carries the spacing */
@media(min-width:1080px) and (max-width:1379px){.site-header nav{gap:0;margin-left:6px}#navigation>a{padding:9px 8px}#navigation>a::after{left:8px;right:8px}}
@media(prefers-reduced-motion:reduce){#navigation>a,#navigation>a::after,#navigation>a .nav-ico{transition:none}#navigation>a:active,#navigation>a:hover .nav-ico{transform:none}}

/* ==========================================================================
   UI polish (2026-09-27): top bar + version label.
   - Nav items: no underline line any more. Hover = soft section tint + hairline border in the section colour + slight
     lift; the current page keeps the tint + a slightly stronger border. Saúde stays teal, Exercício coral.
   - Top bar: a little taller and airier (desktop +8px, tablet/phone +4px), still compact.
   - Version label: removed from the header markup; now a small centred label in the bottom bar (.bar-version).
   ========================================================================== */
#navigation>a::after{content:none;display:none}
#navigation>a{border:1px solid transparent}
#navigation>a:hover,#navigation>a:focus-visible{background:var(--nav-bg);color:var(--nav-c);border-color:color-mix(in srgb,var(--nav-accent) 30%,transparent);box-shadow:0 3px 10px color-mix(in srgb,var(--nav-accent) 14%,transparent);transform:translateY(-1px)}
#navigation>a[aria-current="page"],#navigation>a.active{background:var(--nav-bg);color:var(--nav-c);border-color:color-mix(in srgb,var(--nav-accent) 42%,transparent);box-shadow:none;transform:none}
#navigation>a[aria-current="page"]:hover,#navigation>a.active:hover{box-shadow:0 3px 10px color-mix(in srgb,var(--nav-accent) 14%,transparent)}
#navigation>a:active{transform:translateY(0) scale(.98)}
@media(min-width:1080px){
:root{--header-h:68px}
.site-header nav{gap:6px}
#navigation>a{padding:10px 16px}
}
@media(min-width:1080px) and (max-width:1379px){.site-header nav{gap:0}#navigation>a{padding:10px 7px}}
@media(min-width:651px) and (max-width:1079px){:root{--header-h:58px}}
@media(max-width:650px){:root{--header-h:56px}}
@media(prefers-reduced-motion:reduce){#navigation>a:hover,#navigation>a:focus-visible,#navigation>a:active{transform:none}}
/* Version label in the bottom bars (text filled by app.js from data/i18n.js `version`). */
.site-version{display:none!important}
.utility-row{position:relative}
.bar-version{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font-size:.6rem;line-height:1;letter-spacing:.06em;color:var(--faint);opacity:.85;font-variant-numeric:tabular-nums;white-space:nowrap;pointer-events:none;user-select:none}
.tabbar .bar-version{top:auto;bottom:calc(2px + env(safe-area-inset-bottom));transform:translateX(-50%);font-size:.52rem}
/* Search (2026-09-27): the home page already shows the big search field, so on phones the header search icon is hidden
   there only (inner pages keep it). */
@media(max-width:760px){body[data-page="home"] .site-header .header-tools>.search-toggle{display:none!important}}

/* Alimentação tab (v0.53): the longest label in the phone tab bar — slightly tighter so it fits a 1/6 column at 320 px. */
@media(max-width:760px){.tabbar{grid-template-columns:repeat(6,minmax(0,1fr))}.tab>span{max-width:100%;white-space:nowrap}.tab[data-tab="alimentacao"]>span{font-size:.6rem;letter-spacing:-.02em}}
@media(max-width:380px){.tab[data-tab="alimentacao"]>span{font-size:.55rem}}
.tab[data-tab="alimentacao"][aria-current="page"]{color:var(--food-block)}
/* v0.53: with "Alimentação" in the top nav the header needs ~120 px more between 1080 and 1599 px. The "Início" pill
   beside the logo is dropped in that range only: the logo links home and the bottom bar keeps "Início". */
@media(min-width:1080px) and (max-width:1599px){.site-header .home-button{display:none}}
/* Footer (v0.57): the three pillars lead the footer links, each in its own colour. */
.footer-links>a.footer-pillar{font-weight:700;display:inline-flex;align-items:center;gap:7px}
.footer-links>a.footer-pillar::before{content:'';width:8px;height:8px;border-radius:50%;background:var(--health-primary);flex:none}
.footer-links>a.footer-pillar[data-pillar="saude"]{color:var(--health-dark)}
.footer-links>a.footer-pillar[data-pillar="exercicio"]{color:var(--exercise-dark)}
.footer-links>a.footer-pillar[data-pillar="exercicio"]::before{background:var(--exercise-primary)}
.footer-links>a.footer-pillar[data-pillar="alimentacao"]{color:var(--food-dark)}
.footer-links>a.footer-pillar[data-pillar="alimentacao"]::before{background:var(--food-block)}
.footer-links>a.footer-pillar[data-pillar="meudia"]{color:var(--brand-navy)}
.footer-links>a.footer-pillar[data-pillar="meudia"]::before{background:conic-gradient(var(--health-primary) 0 33%,var(--exercise-primary) 0 66%,var(--food-block) 0)}
/* Meu Dia (v0.58): the personal hub in the top nav (navy) and a highlighted slot in the phone tab bar. */
#navigation>a[data-nav="meudia"]{--nav-c:var(--brand-navy);--nav-bg:var(--exercise-blue-soft);--nav-accent:var(--brand-navy)}
.tabbar .tab-meudia .ico{padding:3px;border-radius:9px;background:var(--brand-navy);color:#fff;width:28px;height:28px;box-sizing:border-box}
.tab-meudia[aria-current="page"]{color:var(--brand-navy)}
/* v0.58: "Meu Dia" joins the top nav (~120 px). Make room only where the header was already tight:
   1080–1199 nav icons hidden (labels stay) · 1380–1599 the account label hides (avatar stays, as below 1380) ·
   the "Início" pill beside the logo stays hidden up to 1719 (logo + bottom bar go home). */
@media(min-width:1080px) and (max-width:1199px){#navigation>a .nav-ico{display:none}}
@media(min-width:1380px) and (max-width:1599px){.header-account>span[data-i18n]{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.header-account{padding:0 4px}}
@media(min-width:1600px) and (max-width:1719px){.site-header .home-button{display:none}}
