/* Titillium Web (títulos da Climate Ventures), servida pelo próprio site */
@font-face { font-family: "Titillium Web"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/titillium-web-600.woff2") format("woff2"); }
@font-face { font-family: "Titillium Web"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/titillium-web-700.woff2") format("woff2"); }
@font-face { font-family: "Titillium Web"; font-style: normal; font-weight: 900; font-display: swap; src: url("fonts/titillium-web-900.woff2") format("woff2"); }
/* Shared by every page: brand tokens, header, navigation, modal, version banner. */
:root {
  --cv-deep: #110820; --cv-dark: #1d092b; --cv-purple: #4d1f74; --cv-purple-2: #673c8e;
  --cv-lilac: #9c7fb6; --cv-lavender: #ead2ff; --cv-cream: #f9eef6; --cv-coral: #ff7c7b; --cv-pink: #ef97a6;
  --bg: var(--cv-dark); --bg-rgb: 29, 9, 43; --surface: rgba(255,255,255,.06); --surface-2: rgba(255,255,255,.10);
  --card: #ffffff; --card-ink: #1d092b; --card-ink-2: #5a4a6b;
  --ink: #ffffff; --ink-2: #d9cde8; --ink-3: #b9a0d0; --line: rgba(255,255,255,.14);   /* ink-3 ≥ 4.5:1 também nos fundos tintados */
  --accent-text: #ff7c7b;
  /* variantes de TEXTO (>= 4.5:1 sobre os fundos de cada tema): mesma família de cor da marca, só muda a luminosidade */
  --accent-ink: #ff9594;
  --sph-ctrl: #c4a0ec; --sph-infl: #ff8fa6; --sph-int: #5fd3b4; --sph-none: #b4a3c7;
  --ph-intel-ink: #c9a8ee; --ph-mob-ink: #ff93a4; --ph-acao-ink: #ff9594;
  --focus: #ff7c7b;          /* anel de foco: coral no escuro; vira #b8323a nos fundos claros (contraste ≥ 3:1) */
  /* ===== Tokens do sistema de design (fonte única; arquitetura.css e as páginas só consomem) ===== */
  /* tipografia: escala 12/14/16/20/24/32 + display (piso de 12px na tela) */
  --fs-xs: 12px; --fs-sm: 14px; --fs-md: 16px; --fs-lg: 20px; --fs-xl: 24px; --fs-2xl: 32px; --fs-display: clamp(36px, 2rem + 2.2vw, 48px);
  --lh-body: 1.55; --lh-tight: 1.2; --measure: 70ch;
  /* espaçamento: 4/8/12/16/24/32/48/64 */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;
  /* raios: 6/10/16/pílula */
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-pill: 999px;
  --radius: var(--r-sm);
  /* alvo mínimo de toque (WCAG 2.5.8), largura máxima da página e áreas seguras */
  --hit-min: 24px; --page-max: 1400px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-r: env(safe-area-inset-right, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px);
  /* movimento: entradas com ease-out, saídas mais rápidas com ease-in */
  --ease-out: cubic-bezier(.22,1,.36,1); --ease-in: cubic-bezier(.64,0,.78,0); --ease-io: cubic-bezier(.65,0,.35,1); --ease-pop: cubic-bezier(.34,1.4,.64,1);
  --dur-1: 120ms; --dur-2: 200ms; --dur-view: 240ms; --dur-3: 320ms; --dur-4: 480ms;
  --hdr-h: 96px;             /* altura real do cabeçalho, atualizada por shared.js */
  --font-title: "Titillium Web", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
:root[data-theme="light"] {
  --bg: var(--cv-cream); --bg-rgb: 249, 238, 246; --surface: #ffffff; --surface-2: #f1e7f5;
  --ink: #1d092b; --ink-2: #4d3a63; --ink-3: #66507f; --line: #e2d5ec;
  --accent-text: #b8323a;
  --accent-ink: #b8323a;
  --sph-ctrl: #7240ad; --sph-infl: #ad3459; --sph-int: #157560; --sph-none: #6f5d80;
  --ph-intel-ink: #673c8e; --ph-mob-ink: #a23a50; --ph-acao-ink: #a8403c;
  --focus: #b8323a;
}
.cv-page.home { --focus: #b8323a; }
.cv-page * { box-sizing: border-box; }
.cv-page { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh; min-height: 100dvh; position: relative; }
.cv-page::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 85% -10%, rgba(255,124,123,var(--glow, .28)) 0, rgba(255,124,123,0) 32%),
    radial-gradient(circle at 85% -10%, transparent 0 22%, rgba(255,255,255,.035) 22.2% 30%, transparent 30.2% 40%, rgba(255,255,255,.03) 40.2% 50%, transparent 50.2% 62%, rgba(255,255,255,.025) 62.2% 74%, transparent 74.2%),
    linear-gradient(160deg, var(--g1, #2a1147) 0%, var(--g2, var(--cv-dark)) 45%, var(--g3, var(--cv-deep)) 100%);
}
:root[data-theme="light"] .cv-page::before {
  background:
    radial-gradient(circle at 85% -10%, rgba(255,124,123,var(--glow-l, .25)) 0, rgba(255,124,123,0) 32%),
    linear-gradient(160deg, #ffffff 0%, var(--l2, var(--cv-cream)) 60%, var(--l3, #f3e6f2) 100%);
}
/* Tom de fundo por página (body data-page): mesma família da marca, coral como único destaque.
   g1→g3: degradê do tema escuro; l2/l3: do claro; glow: brilho coral do canto (mais suave nas páginas de leitura) */
body[data-page="arquitetura"], body[data-page="validacao"] { --g1: #30154f; --g2: #231039; --g3: #170b29; --bg: #231039; --bg-rgb: 35, 16, 57; }
body[data-page="fluxo"]       { --g1: #3a1236; --g2: #2a0d27; --g3: #1a0818; --bg: #2a0d27; --bg-rgb: 42, 13, 39; }
body[data-page="alavancas"]   { --g1: #1c2350; --g2: #141a3c; --g3: #0d1128; --bg: #141a3c; --bg-rgb: 20, 26, 60; }
body[data-page="programas"]   { --g1: #3a2a14; --g2: #2b1f10; --g3: #1b1309; --bg: #2b1f10; --bg-rgb: 43, 31, 16; }
body[data-page="teoria"], body[data-page="modelo26"] { --g1: #123a3a; --g2: #0d2b2c; --g3: #081c1d; --bg: #0d2b2c; --bg-rgb: 13, 43, 44; }
body[data-page="base"]        { --g1: #2a2530; --g2: #201c25; --g3: #151218; --bg: #201c25; --bg-rgb: 32, 28, 37; --glow: .14; --glow-l: .12; }
body[data-page="versoes"]     { --g1: #262236; --g2: #1c1929; --g3: #13111c; --bg: #1c1929; --bg-rgb: 28, 25, 41; --glow: .14; --glow-l: .12; }
:root[data-theme="light"] body[data-page="arquitetura"], :root[data-theme="light"] body[data-page="validacao"] { --l2: #f1eafb; --l3: #e8def6; --bg: #f1eafb; --bg-rgb: 241, 234, 251; }
:root[data-theme="light"] body[data-page="fluxo"]       { --l2: #fbecef; --l3: #f6dfe5; --bg: #fbecef; --bg-rgb: 251, 236, 239; }
:root[data-theme="light"] body[data-page="alavancas"]   { --l2: #ebeffa; --l3: #dfe6f6; --bg: #ebeffa; --bg-rgb: 235, 239, 250; }
:root[data-theme="light"] body[data-page="programas"]   { --l2: #f8f0e4; --l3: #f0e4d2; --bg: #f8f0e4; --bg-rgb: 248, 240, 228; }
:root[data-theme="light"] body[data-page="teoria"], :root[data-theme="light"] body[data-page="modelo26"] { --l2: #e9f4f1; --l3: #dcece7; --bg: #e9f4f1; --bg-rgb: 233, 244, 241; }
:root[data-theme="light"] body[data-page="base"]        { --l2: #f5f1ea; --l3: #ece6dc; --bg: #f5f1ea; --bg-rgb: 245, 241, 234; }
:root[data-theme="light"] body[data-page="versoes"]     { --l2: #f0eff4; --l3: #e6e4ee; --bg: #f0eff4; --bg-rgb: 240, 239, 244; }
.cv-page h1, .cv-page h2, .cv-page h3 { font-family: var(--font-title); font-weight: 700; }
.cv-page button { font: inherit; color: inherit; cursor: pointer; }
.cv-page [contenteditable]:focus { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.cv-page [contenteditable]:empty::before { content: attr(data-placeholder); opacity: .7; }
.cv-page header { position: sticky; top: 0; z-index: 20; background: rgba(var(--bg-rgb), .8); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.cv-page .bar { max-width: 1400px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cv-page .brand { display: flex; align-items: center; gap: 14px; margin-right: auto; color: inherit; text-decoration: none; }
.cv-page .brand img { height: 34px; width: auto; display: block; }
:root[data-theme="light"] .cv-page .brand img { filter: invert(1) hue-rotate(180deg) brightness(.25); }
.cv-page .brand .txt { display: flex; flex-direction: column; border-left: 1px solid var(--line); padding-left: 14px; min-width: 0; }
.cv-page .brand .eyebrow { font-family: var(--font-title); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.cv-page .brand h1 { font-size: 20px; margin: 0; line-height: 1.1; letter-spacing: -.01em; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--cv-coral); color: #1d092b; font: 700 13px var(--font-title); padding: 10px 14px; border-radius: 4px; text-decoration: none; }
.skip-link:focus { top: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cv-page .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.cv-page .btn { border: 1px solid var(--line); background: var(--surface); padding: 7px 12px; border-radius: 4px; font-size: 13px; font-weight: 500; font-family: var(--font-title); letter-spacing: .02em; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); text-decoration: none; transition: background .15s, border-color .15s; }
.cv-page .btn:hover { border-color: var(--cv-lilac); background: var(--surface-2); }
.cv-page .btn.primary { background: var(--cv-coral); color: #1d092b; border-color: var(--cv-coral); font-weight: 700; }
.cv-page .btn.primary:hover { filter: brightness(1.06); }
.cv-page .btn.danger { border-color: rgba(255, 124, 123, .6); color: var(--accent-text); }
.cv-page .btn.danger:hover { color: var(--accent-text); border-color: var(--cv-coral); background: rgba(255, 124, 123, .12); }
.cv-page .saved { font-size: 12px; color: var(--ink-3); }
.cv-page .saved.warn { color: var(--accent-text); }
.cv-page footer:not(.site-footer) { max-width: 1400px; margin: 0 auto; padding: 18px 16px 40px; color: var(--ink-3); font-size: 12px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); }

/* ---------- Navegação do site: abas (páginas) + faixa (subpáginas); folha no celular ---------- */
.site-nav { order: 10; flex-basis: 100%; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a { text-decoration: none; -webkit-tap-highlight-color: transparent; }
.nl-x { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }   /* resto do nome: só leitor de tela */
.nav-ink { display: none; }
.nav-exp { display: none; }
.site-nav a:focus-visible, .nav-exp:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 6px; }
.nav-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.site-nav a:active { opacity: .7; transition-duration: 60ms; }

.nav-toggle { display: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 4px; width: 44px; height: 44px; padding: 0; place-items: center; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 1px; position: relative; transition: transform .2s, background .2s; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; } .nav-toggle span::after { top: 6px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle span::after { transform: translateY(-6px) rotate(-45deg); }

/* ===== Desktop e tablet (≥ 821): abas + faixa ===== */
@media (min-width: 821px) {
  :is(.cv-page, body) header { --strip-h: 36px; }
  :is(.cv-page, body) header .bar { row-gap: 0; padding-top: 8px; padding-bottom: 0; }
  :is(.cv-page, body) header.has-strip { margin-bottom: var(--strip-h); }   /* a faixa fica pendurada sob o cabeçalho; este espaço a reserva */

  .nav-top { display: flex; gap: 2px; margin-left: -14px; }       /* texto da 1ª aba alinhado com a marca */
  .nav-main { position: relative; display: flex; align-items: center; height: 42px; padding: 0 14px; font: 700 13px/1 var(--font-title); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); transition: color var(--dur-1) var(--ease-out), opacity var(--dur-1); }
  .nav-item.on > .nav-main { color: var(--ink); }
  /* traço de hover: varre da esquerda ao entrar, sai pela direita */
  .nav-main::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--ink-3); transform: scaleX(0); transform-origin: right; transition: transform var(--dur-1) var(--ease-in); }
  .nav-main[aria-current]::after { display: none; }
  @media (hover: hover) {
    .nav-main:hover { color: var(--ink); }
    .nav-main:hover::after { transform: scaleX(1); transform-origin: left; transition: transform var(--dur-2) var(--ease-out); }
  }
  .nav-main:focus-visible { color: var(--ink); }
  /* traço da página atual (coral): é o elemento que desliza entre páginas na troca (view-transition-name: nav-ink) */
  .nav-ink { display: block; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--accent-text); view-transition-name: nav-ink; }
  .nav-main[aria-current="page"] .nav-ink { height: 3px; }

  /* faixa de subpáginas: largura total, mais leve que as abas */
  .nav-sub { position: absolute; left: 0; right: 0; top: 100%; height: var(--strip-h); display: flex; align-items: center;
    padding-inline: max(16px, calc((100% - 1400px) / 2 + 16px));
    background: rgba(var(--bg-rgb), .94); border-bottom: 1px solid var(--line);
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity 80ms linear, transform 80ms var(--ease-in), visibility 0s linear 80ms; }
  .nav-sub::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }   /* ponte: o hover não se perde entre a aba e a faixa */
  .nav-sub > ul { display: flex; gap: 2px; margin-left: -12px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .nav-sub > ul::-webkit-scrollbar { display: none; }
  .nav-item.on > .nav-sub, .nav-item.has-sub:is(:hover, :focus-within) > .nav-sub {
    opacity: 1; visibility: visible; transform: none;
    transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out), visibility 0s; }
  @supports selector(:has(a)) {   /* espiar outro grupo: a faixa dele substitui a do grupo atual */
    .nav-top:has(.nav-item.has-sub:not(.on):is(:hover, :focus-within)) > .nav-item.on > .nav-sub { opacity: 0; visibility: hidden; transform: translateY(-4px); transition-duration: 80ms, 80ms, 0s; transition-delay: 0s, 0s, 80ms; }
  }
  /* rolando para baixo: a faixa recolhe; reaparece ao rolar para cima, ao passar o mouse no cabeçalho ou com foco dentro dele */
  :is(.cv-page, body) header.is-tucked:not(:hover):not(:focus-within) .nav-sub { opacity: 0; visibility: hidden; transform: translateY(-4px); }

  .nav-child { position: relative; display: flex; align-items: center; height: var(--strip-h); padding: 0 12px 0 22px; white-space: nowrap; font: 600 13px/1 var(--font-title); letter-spacing: .02em; color: var(--ink-3); transition: color var(--dur-1) var(--ease-out); }
  .nav-child::before { content: ""; position: absolute; left: 10px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--ink-3); opacity: 0; transform: scale(.4); transition: opacity var(--dur-1) var(--ease-out), transform var(--dur-2) var(--ease-pop); }
  @media (hover: hover) { .nav-child:hover { color: var(--ink); } .nav-child:hover::before { opacity: .7; transform: none; } }
  .nav-child:focus-visible { color: var(--ink); }
  .nav-child[aria-current="page"] { color: var(--ink); }
  .nav-child[aria-current="page"]::before { background: var(--accent-text); opacity: 1; transform: none; }
}
@media (min-width: 821px) and (pointer: coarse) {   /* tablet no toque: alvos de 44 px */
  :is(.cv-page, body) header { --strip-h: 44px; }
  .nav-main { height: 44px; }
}

/* ===== Celular e tablet pequeno (≤ 820): folha com acordeão ===== */
@media (max-width: 820px) {
  .nav-toggle { display: grid; order: 1; margin-left: auto; }
  header .bar > .brand { order: 0; flex: 1 1 calc(100% - 108px); min-width: 0; }   /* marca + lápis + menu ocupam a linha inteira */
  header .bar > .actions { order: 3; }
  header .bar > .saved { order: 4; }

  .site-nav { position: absolute; z-index: 1; left: 0; right: 0; top: 100%; order: 0; padding: 2px 16px 20px; background: rgb(var(--bg-rgb)); border-bottom: 1px solid var(--line);
    max-height: calc(100vh - var(--hdr-h)); max-height: calc(100dvh - var(--hdr-h)); overflow-y: auto; overscroll-behavior: contain;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity var(--dur-1) var(--ease-in), transform var(--dur-1) var(--ease-in), visibility 0s linear var(--dur-1); }
  .nav-open .site-nav { opacity: 1; visibility: visible; transform: none;
    transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-3) var(--ease-out), visibility 0s; }
  .nav-open::after { content: ""; position: absolute; z-index: 0; left: 0; right: 0; top: 100%; height: 100vh; height: 100dvh; background: rgba(17, 8, 32, .55); animation: m-fade var(--dur-2) var(--ease-out) both; }

  .nav-item { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; border-bottom: 1px solid var(--line); }
  .nav-item:last-child { border-bottom: 0; }
  .nav-item:not(.has-sub) > .nav-main { grid-column: 1 / -1; }
  .nav-main { position: relative; display: flex; align-items: center; min-height: 52px; padding: 0 12px; font: 700 15px/1.2 var(--font-title); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
  .nav-item.on > .nav-main { color: var(--ink); }
  .nl-x { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; margin-left: .32em; }
  .nav-main[aria-current="page"]::before, .nav-child[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--accent-text); }

  .nav-exp { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: var(--ink-2); border-radius: 6px; }
  .nav-exp::before { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform var(--dur-2) var(--ease-out); }
  .nav-item.open > .nav-exp::before { transform: translateY(2px) rotate(-135deg); }

  .nav-sub { grid-column: 1 / -1; display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-2) var(--ease-out); }
  .nav-item.open > .nav-sub { grid-template-rows: 1fr; }
  .nav-sub > ul { min-height: 0; overflow: hidden; margin-left: 12px; border-left: 2px solid var(--line); visibility: hidden; transition: visibility 0s linear var(--dur-2); }
  .nav-item.open > .nav-sub > ul { visibility: inherit; transition-delay: 0s; }
  .nav-item.open { padding-bottom: 8px; }
  .nav-child { position: relative; display: flex; align-items: center; min-height: 44px; padding: 0 12px 0 16px; font: 600 15px/1.2 var(--font-title); color: var(--ink-2); }
  .nav-child[aria-current="page"] { color: var(--ink); }
  .nav-child[aria-current="page"]::before { left: -2px; top: 8px; bottom: 8px; width: 2px; border-radius: 0; }

  .nav-open .nav-item { animation: nav-item var(--dur-3) var(--ease-out) both; }
  .nav-open .nav-item:nth-child(2) { animation-delay: 30ms; } .nav-open .nav-item:nth-child(3) { animation-delay: 60ms; } .nav-open .nav-item:nth-child(4) { animation-delay: 90ms; }
}
@keyframes nav-item { from { opacity: 0; translate: 0 -6px; } }

/* ---------- Embedded preview (home cards) ---------- */
/* ---------- Rodapé (todas as páginas) ---------- */
footer.site-footer { all: unset; display: block; margin-top: 40px; background: #613a8e; color: #fff; font-family: var(--font-body); font-size: 13px; line-height: 1.5; }
.site-footer .sf-in { max-width: 1400px; margin: 0 auto; padding: 34px 16px 22px; display: flex; justify-content: space-between; gap: 32px 48px; flex-wrap: wrap; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.site-footer a:focus-visible, .site-footer button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 3px; }
.sf-left { flex: 1 1 520px; display: flex; gap: 28px 36px; flex-wrap: wrap; align-items: flex-start; min-width: 0; }
.sf-logo img { height: 40px; width: auto; display: block; }
.sf-map { flex: 1 1 300px; display: grid; grid-template-columns: repeat(4, max-content); gap: 14px 32px; align-items: start; min-width: 0; }
@media (max-width: 1499px) { .sf-map { grid-template-columns: repeat(2, max-content); } }
@media (max-width: 359px) { .sf-map { grid-template-columns: minmax(0, 1fr); } }
.sf-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sf-col > a { font: 700 12px var(--font-title); letter-spacing: .1em; text-transform: uppercase; }
.sf-kid { position: relative; padding-left: 14px; color: #e6daf3; font-size: 13px; }
.sf-kid::before { content: ""; position: absolute; left: 2px; top: -6px; height: 15px; width: 8px; border-left: 1px solid rgba(255,255,255,.45); border-bottom: 1px solid rgba(255,255,255,.45); }
.sf-kid a { color: #f1e9fa; }
.sf-right { flex: 0 1 auto; display: flex; flex-direction: column; gap: 14px; align-items: flex-end; text-align: right; min-width: 0; background: #54317c; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 18px 20px; }
.sf-right .sf-k, .sf-right .sf-person small { color: #e6daf3; }
.sf-right .sf-person { padding-top: 14px; border-top: 1px solid rgba(255,255,255,.14); }
.sf-right a.sf-btn:hover, .sf-right .sf-open:hover { color: #54317c; }
.sf-right .sf-dev, .sf-right .sf-person { justify-content: flex-end; }
@media (max-width: 900px) { .sf-right { flex-basis: 100%; align-items: flex-start; text-align: left; } .sf-right .sf-dev, .sf-right .sf-person { justify-content: flex-start; } }
.sf-dev { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.sf-k { font: 700 12px var(--font-title); letter-spacing: .14em; text-transform: uppercase; color: #e6daf3; }
.sf-viva-txt { font: 900 20px var(--font-title); letter-spacing: .12em; color: #fff; }
.sf-viva-img { height: 26px; width: auto; display: block; }
.sf-dl { display: inline-flex; gap: 8px; align-items: center; color: #e6daf3; }
.sf-soon { opacity: .75; cursor: default; }
.sf-person { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sf-person img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.7); }
.sf-person b { display: block; font: 700 15px var(--font-title); }
.sf-person small { color: #e6daf3; font-size: 12px; }
.sf-btn, .site-footer a.sf-btn { display: inline-flex; align-items: center; min-height: 34px; border: 1.5px solid rgba(255,255,255,.85); border-radius: 999px; padding: 6px 14px; color: #fff; font: 700 12px var(--font-title); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; }
.site-footer a.sf-btn:hover { background: #fff; color: #613a8e; text-decoration: none; }
.sf-open { border: 1.5px solid #fff; background: transparent; color: #fff; border-radius: 999px; padding: 8px 16px; font: 700 12px var(--font-title); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; min-height: 36px; }
.sf-open:hover { background: #fff; color: #613a8e; }
.sf-base { max-width: 1400px; margin: 0 auto; padding: 12px 16px 24px; border-top: 1px solid rgba(255,255,255,.18); color: #e6daf3; font-size: 12px; }
.sf-share { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; padding-top: 14px; border-top: 1px solid #ece3f3; }
.sf-card .sf-sh { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 7px 14px; border: 1.5px solid #8566f2; border-radius: 999px; background: #fff; color: #4d1f74; font: 700 12px var(--font-title); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; cursor: pointer; }
.sf-card .sf-sh:hover { background: #8566f2; color: #fff; }
.sf-card .sf-sh svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sf-card-logo-link { display: inline-block; margin-bottom: 14px; }
.sf-card-logo { height: 34px; width: auto; display: block; }
.sf-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.sf-card-head img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.sf-card-head h3 { margin: 0; }
.sf-card-head p { margin: 2px 0 0; color: var(--ink-2); font-size: 13.5px; }
.sf-card .sf-org { margin: 0 0 10px; font-weight: 600; }
.sf-card .sf-links { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.sf-card a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.sf-card .sf-apps { color: var(--ink-2); }
.sf-card .sf-place { margin: 0 0 6px; color: var(--ink-2); font-size: 13.5px; }
@media (max-width: 640px) { .site-footer .sf-in { padding-top: 28px; } .sf-map { gap: 14px 22px; } .site-footer .sf-base { padding-right: 72px; } }   /* o botão "voltar ao topo" não cobre o texto */
html.embed header, html.embed footer, html.embed .version-banner { display: none !important; }
html.embed body { overflow: hidden; }

/* ---------- Read-only version view ---------- */
a.brand { color: inherit; text-decoration: none; }
.version-banner { position: relative; z-index: 30; background: var(--cv-coral); color: #1d092b; }
.version-banner .in { max-width: 1400px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.version-banner b { font-family: var(--font-title); }
.version-banner .sp { all: unset; margin-right: auto; display: flex; align-items: center; gap: 10px; color: inherit; }   /* "all: unset" isola do .sp de cartão (impacto) */
.version-banner .sp::before, .version-banner .sp::after { content: none; }
.version-banner .btn { background: rgba(255,255,255,.35); border-color: rgba(29,9,43,.25); color: #1d092b; }
.version-banner .btn:hover { background: rgba(255,255,255,.6); }
.viewer-banner { background: var(--cv-lavender); }
body.readonly [contenteditable] { cursor: default; }
body.readonly .edit-only { display: none !important; }

/* ---------- People / avatars ---------- */
.person-av { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(29,9,43,.35); background: var(--cv-lavender); display: inline-grid; place-items: center; font: 700 12px var(--font-title); color: var(--cv-purple); flex-shrink: 0; }

/* ---------- Modal ---------- */
.cv-modal { position: fixed; inset: 0; z-index: 100; background: rgba(17,8,32,.62); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; }
.cv-modal .box { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; width: min(460px, 100%); background: var(--card); color: var(--card-ink); border-radius: 8px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.4); font-family: var(--font-body); }
.cv-modal .box:has(#v-note) { width: min(680px, 100%); }   /* salvar versão: espaço para um resumo longo */
.cv-modal h3 { margin: 0 0 4px; font: 700 20px var(--font-title); }
.cv-modal p { margin: 0 0 16px; color: var(--card-ink-2); font-size: 13px; }
.cv-modal .who { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; margin-bottom: 14px; }
.cv-modal .who button { position: relative; border: 2px solid #a08bb8; background: #fff; border-radius: 8px; padding: 12px 6px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; font: 700 13px var(--font-title); color: var(--card-ink); cursor: pointer; }
.cv-modal .who button img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.cv-modal .who button[aria-pressed="true"] { border-color: var(--cv-coral); background: #fff4f3; }
.cv-modal .who button:disabled { opacity: .35; cursor: not-allowed; }
.cv-modal .who button:focus-visible { outline: 2px solid var(--cv-purple-2); outline-offset: 2px; }
.cv-modal label, .cv-modal .lbl { display: block; font: 700 12px var(--font-title); letter-spacing: .12em; text-transform: uppercase; color: var(--cv-purple-2); margin-bottom: 6px; }
.cv-modal textarea { width: 100%; min-height: 120px; line-height: 1.5; border: 1px solid #e2d5ec; border-radius: 6px; padding: 8px 10px; font: 13px var(--font-body); color: var(--card-ink); resize: vertical; }
.cv-modal .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.cv-modal .row button { border: 1px solid #e2d5ec; background: #fff; color: var(--card-ink); border-radius: 4px; padding: 8px 14px; font: 600 13px var(--font-title); cursor: pointer; }
.cv-modal .row button.go { background: var(--cv-coral); border-color: var(--cv-coral); color: #1d092b; font-weight: 700; }
.cv-modal .row button:disabled { opacity: .45; cursor: not-allowed; }
.cv-modal .row button.go.danger { background: #b8323a; border-color: #b8323a; color: #fff; }
.cv-modal .warn { color: var(--card-ink); font-size: 14px; }
.cv-modal .pages { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; font-size: 13px; color: var(--card-ink); }
.cv-modal .pages label { display: flex; align-items: center; gap: 8px; cursor: pointer; text-transform: none; letter-spacing: 0; font: 13px var(--font-body); color: var(--card-ink); margin: 0; }
.cv-modal .pages input { width: 18px; height: 18px; accent-color: #b8323a; }
.cv-modal .err { color: #c0353f; font-size: 12px; margin-top: 8px; min-height: 1em; }

.cv-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 110; background: var(--cv-dark); color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 6px; padding: 10px 16px; font: 600 13px var(--font-title); box-shadow: 0 10px 30px rgba(0,0,0,.35); }

/* Ícone do botão de tema (meio círculo desenhado em CSS, não depende de fonte) */
.ti { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid currentColor; background: linear-gradient(90deg, currentColor 50%, transparent 50%); box-sizing: border-box; }

/* Celular: cabeçalho compacto, menu e faixa de versão contidos */
@media (max-width: 820px) {
  header .brand .eyebrow { display: none; }
  header .brand h1, .cv-page header .brand h1 { font-size: 17px; }
  header .brand img, .cv-page header .brand img { height: 28px; }
  header .bar, .cv-page header .bar { gap: 8px 10px; padding-top: 8px; padding-bottom: 8px; }
  header .actions .btn { padding: 6px 9px; font-size: 12px; }
  header .saved { flex-basis: 100%; font-size: 12px; }
  .version-banner .in { font-size: 12px; gap: 8px; padding: 8px 16px; }
  .version-banner .btn { padding: 5px 8px; font-size: 12px; }
}
@media (max-width: 480px) { .version-banner .all-versions { display: none; } }
@media (max-width: 640px) { header .wide-only { display: none !important; } }
@media (max-height: 520px) and (max-width: 1000px) {   /* celular deitado: cabeçalho rola junto com a página */
  header { position: static !important; }
  .cv-modal .who button { flex-direction: row; justify-content: center; padding: 8px 6px; }
  .cv-modal .who button img { width: 32px; height: 32px; }
}

/* Foco visível padronizado */
.cv-page .btn:focus-visible, a.brand:focus-visible, .cv-modal button:focus-visible, .cv-modal textarea:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.cv-modal button:focus-visible, .cv-modal textarea:focus-visible { outline-color: #b8323a; }
@media print { .site-nav, .nav-toggle, .version-banner { display: none !important; } }

/* ---------- Busca na página ---------- */
.cv-search { display: flex; align-items: center; min-width: 0; }
.cv-search .cs-open { display: none; }
.cs-field { display: flex; align-items: center; gap: 2px; border: 1.5px solid var(--pill-line, rgba(255,255,255,.34)); border-radius: 999px; background: var(--surface); padding: 0 4px 0 12px; height: 36px; width: 300px; transition: border-color .15s, width .2s; }
:root[data-theme="light"] .cs-field { --pill-line: rgba(29,9,43,.32); }
.cs-field:focus-within { border-color: var(--focus); }
.cs-field input { flex: 1; min-width: 0; width: 0; border: 0; background: transparent; color: var(--ink); font: 13px var(--font-body); padding: 0 6px; height: 100%; outline: none; }
.cs-field input::placeholder { color: var(--ink-3); opacity: 1; }
.cs-field input::-webkit-search-cancel-button { display: none; }
.cs-count { font: 600 12px var(--font-title); color: var(--ink-2); white-space: nowrap; padding: 0 4px; }
.cs-count:empty { display: none; }
.cs-count.none { color: var(--accent-text); }
.cs-field button { border: 0; background: transparent; color: var(--ink); width: 28px; height: 28px; border-radius: 50%; font-size: 18px; line-height: 1; display: grid; place-items: center; padding: 0; }
.cs-field button:hover:not(:disabled) { background: var(--surface-2); }
.cs-field button:disabled { opacity: .3; cursor: default; }
.cs-field .cs-prev:disabled, .cs-field .cs-next:disabled { display: none; }
.cs-field .cs-close { display: none; }
.cv-search button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
/* lupa desenhada em CSS */
.cs-ic { width: 13px; height: 13px; border: 1.8px solid currentColor; border-radius: 50%; position: relative; flex-shrink: 0; color: var(--ink-3); box-sizing: border-box; }
.cs-ic::after { content: ""; position: absolute; width: 6px; height: 1.8px; background: currentColor; right: -5px; bottom: -3px; transform: rotate(45deg); border-radius: 1px; }
::highlight(cv-search) { background-color: rgba(255, 196, 64, .42); color: inherit; }
::highlight(cv-search-current) { background-color: #ffb020; color: #1d092b; }
.cv-hit { outline: 2px solid #ffb020 !important; outline-offset: 2px; border-radius: 3px; }
@media (max-width: 1100px) { .cs-field { width: 220px; } }
@media (max-width: 820px) {
  .cv-search { order: 3; }   /* lupa na linha dos botões; a linha da marca fica só com o menu à direita */
  .cv-search .cs-open { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 4px; }
  .cv-search .cs-open .cs-ic { color: var(--ink); }
  .cv-search .cs-field { display: none; }
  .cv-search.open { order: 2; flex-basis: 100%; }
  .cv-search.open .cs-open { display: none; }
  .cv-search.open .cs-field { display: flex; width: 100%; height: 44px; }
  .cv-search.open .cs-field .cs-close { display: grid; }
  .cs-field input { font-size: 16px; }   /* evita o zoom automático do iOS */
  .cs-field button { width: 34px; height: 34px; }
}
@media print { .cv-search { display: none !important; } ::highlight(cv-search), ::highlight(cv-search-current) { background-color: transparent; } }

/* ---------- Login (home e diálogo "Entrar para editar") ---------- */
.cv-login { display: grid; gap: 12px; color: var(--card-ink); font-family: var(--font-body); }
.cv-login .lbl, .cv-login label { display: block; font: 700 12px var(--font-title); letter-spacing: .12em; text-transform: uppercase; color: var(--cv-purple-2); margin: 0; }
.cv-login .who { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; margin: 0; }
.cv-login .who button { position: relative; border: 2px solid #a08bb8; background: #fff; border-radius: 8px; padding: 12px 6px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; font: 700 13px var(--font-title); color: var(--card-ink); cursor: pointer; }
.cv-login .who button img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.cv-login .who button[aria-pressed="true"], .cv-modal .who button[aria-pressed="true"] { border-color: #b8323a; background: #fff4f3; }
.cv-login .who button[aria-pressed="true"]::after, .cv-modal .who button[aria-pressed="true"]::after { content: "✓"; position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: #b8323a; color: #fff; font: 700 12px/20px var(--font-body); text-align: center; }
.cv-login .who button:focus-visible, .cv-login input:focus-visible, .cv-login .go:focus-visible { outline: 2px solid var(--cv-purple-2); outline-offset: 2px; }
.cv-login .pw { display: grid; gap: 6px; }
.cv-login input { width: 100%; border: 1.5px solid #8a6fa6; border-radius: 8px; padding: 11px 12px; font: 600 16px var(--font-body); letter-spacing: .1em; color: var(--card-ink); background: #fff; box-sizing: border-box; }
.cv-login .go { border: 0; background: var(--cv-coral); color: #1d092b; border-radius: 999px; padding: 12px 20px; font: 700 13px var(--font-title); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.cv-login .go:disabled { opacity: .6; cursor: wait; }
.cv-login .err { color: #b8323a; font-size: 13px; font-weight: 600; min-height: 1em; }
.cv-login .err:empty { display: none; }
.cv-modal .lg { margin-bottom: 4px; }

/* Quem está editando (topo das páginas) */
.me-chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 4px 3px 3px; font: 700 13px var(--font-title); color: var(--ink); }
.me-chip .person-av { width: 28px; height: 28px; border-width: 1.5px; }
.me-chip span { display: flex; flex-direction: column; line-height: 1.1; }
.me-chip small { font: 600 12px var(--font-title); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.me-chip button { border: 1px solid var(--line); background: transparent; color: var(--ink-2); border-radius: 999px; padding: 4px 10px; font: 600 12px var(--font-title); cursor: pointer; }
.me-chip button:hover { color: var(--ink); border-color: var(--cv-coral); }
.me-chip button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 820px) { header .bar > .me-chip { order: 3; } }
@media print { .me-chip { display: none !important; } }
@media (max-width: 480px) { .cv-modal .who, .cv-login .who { grid-template-columns: repeat(2, 1fr); } }

/* Lápis de edição ao lado do menu (só no celular) */
.edit-toggle { display: none; }
@media (max-width: 820px) {
  .edit-toggle { display: grid; place-items: center; order: 1; margin-left: auto; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 4px; cursor: pointer; }
  .edit-toggle + .nav-toggle { margin-left: 0; }
  .edit-toggle.on { border-color: rgba(255, 124, 123, .7); }
  .edit-toggle .person-av { width: 32px; height: 32px; border-width: 1.5px; }
  .edit-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
  header .bar > .me-chip { display: none; }
}
.cv-modal .me-who { display: flex; gap: 14px; align-items: center; }
.cv-modal .me-who .person-av { width: 56px; height: 56px; }
.cv-modal .me-who p { margin: 0; }
@media (max-width: 360px) {   /* telas muito estreitas (iPhone SE 1ª geração): marca mais compacta */
  header .brand, .cv-page header .brand { gap: 10px; }
  header .brand img, .cv-page header .brand img { height: 24px; }
  header .brand .txt, .cv-page header .brand .txt { padding-left: 10px; }
  header .brand h1, .cv-page header .brand h1 { font-size: 15px; }
}

.cv-modal fieldset.pages { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.cv-modal fieldset.pages legend { padding: 0; margin-bottom: 6px; }
.cv-modal .row button.go.danger:focus-visible { outline-color: #1d092b; }

/* Alvos de toque de pelo menos 36 px no celular */
@media (pointer: coarse), (max-width: 760px) {
  .viewer-banner .btn, .version-banner .btn { min-height: 36px; }
  a.brand { min-height: 36px; }
  .me-chip button { min-height: 32px; }
}

/* ================= Movimento (leve: só opacity/transform, sem bibliotecas) ================= */
html { scroll-padding-top: calc(var(--hdr-h) + 12px); }   /* foco e âncoras nunca ficam sob o cabeçalho fixo */
@media (max-height: 520px) and (max-width: 1000px) { html { scroll-padding-top: 8px; } }

/* Troca de página: o cabeçalho fica parado, o traço da aba atual desliza, o conteúdo entra 14 px na direção da hierarquia */
@media (prefers-reduced-motion: no-preference) { @view-transition { navigation: auto; } }
header { view-transition-name: site-header; }
::view-transition-group(site-header), ::view-transition-group(nav-ink) { animation-duration: var(--dur-3); animation-timing-function: var(--ease-out); }
::view-transition-old(root) { animation: vt-out 100ms var(--ease-in) both; }
::view-transition-new(root) { animation: vt-in 240ms var(--ease-out) 40ms both; }
:root { --vt-x: 0px; --vt-y: 10px; }
:root:active-view-transition-type(fwd)  { --vt-x: 14px;  --vt-y: 0px; }
:root:active-view-transition-type(back) { --vt-x: -14px; --vt-y: 0px; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translate(var(--vt-x), var(--vt-y)); } }
/* Sem a API (Firefox, Safari antigo): entrada leve do conteúdo; o cabeçalho não anima */
.no-vt .cv-page main { animation: page-in var(--dur-3) var(--ease-out) both; }
@keyframes page-in { from { opacity: 0; translate: 0 8px; } }

/* Conteúdo abaixo da dobra entra uma vez, de leve (armado por shared.js; sem JS tudo aparece normal) */
.rv { opacity: 0; translate: 0 12px; }
.rv.rv-in { opacity: 1; translate: 0 0; transition: opacity var(--dur-3) var(--ease-out) var(--rv-d, 0ms), translate var(--dur-3) var(--ease-out) var(--rv-d, 0ms); }

/* Toque e clique: resposta imediata */
.cv-page .btn, .cv-modal .row button, .cv-login .go, .cv-login .who button, .cv-modal .who button, .cs-field button, .me-chip button, .nav-toggle, .edit-toggle, .cs-open {
  transition: background-color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out), filter var(--dur-1); }
.cv-page .btn:active, .cv-modal .row button:active, .cv-login .go:active, .cv-login .who button:active, .cv-modal .who button:active, .nav-toggle:active, .edit-toggle:active, .cs-open:active { transform: scale(.96); }
.cv-login .who button[aria-pressed="true"] img, .cv-modal .who button[aria-pressed="true"] img { animation: pop var(--dur-3) var(--ease-pop); }
@keyframes pop { 50% { scale: 1.12; } }

/* Diálogos e avisos: entram de leve, saem mais rápido */
.cv-modal { animation: m-fade var(--dur-2) var(--ease-out) both; }
.cv-modal .box { animation: m-pop var(--dur-3) var(--ease-out) both; }
.cv-modal.is-out { animation: m-fade-out var(--dur-1) var(--ease-in) both; pointer-events: none; }
.cv-modal.is-out .box { animation: m-pop-out var(--dur-1) var(--ease-in) both; }
@keyframes m-fade { from { opacity: 0; } } @keyframes m-fade-out { to { opacity: 0; } }
@keyframes m-pop { from { opacity: 0; translate: 0 10px; scale: .97; } } @keyframes m-pop-out { to { opacity: 0; translate: 0 6px; scale: .98; } }
@media (pointer: coarse) { .cv-modal { backdrop-filter: none; background: rgba(17,8,32,.74); } }
.cv-toast { animation: t-in var(--dur-3) var(--ease-out) both; }
.cv-toast.is-out { animation: t-out var(--dur-2) var(--ease-in) both; }
@keyframes t-in { from { opacity: 0; translate: 0 12px; } } @keyframes t-out { to { opacity: 0; translate: 0 8px; } }

/* Menu do celular: desce do cabeçalho, itens em cascata curta */
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { transition-duration: var(--dur-2); transition-timing-function: var(--ease-out); }

/* Sem movimento: preferência do sistema, miniaturas da home e impressão */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0s !important; animation-duration: .01ms !important; animation-delay: 0s !important; scroll-behavior: auto !important; }
  .rv { opacity: 1 !important; translate: none !important; }
}
html.embed *, html.embed *::before, html.embed *::after { animation: none !important; transition: none !important; }
html.embed .rv { opacity: 1 !important; translate: none !important; }
@media print { .rv { opacity: 1 !important; translate: none !important; } * { animation: none !important; transition: none !important; } }

.cv-modal .note-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cv-modal .note-head label { margin: 0; }
.cv-modal .note-head .bul { border: 1px solid #c9b6da; background: #fff; color: var(--card-ink); border-radius: 999px; padding: 4px 12px; min-height: 30px; font: 600 12px var(--font-title); cursor: pointer; }
.cv-modal .note-head .bul:hover { border-color: #b8323a; }
.cv-modal .note-tip { display: block; margin-top: 4px; font-size: 12px; color: var(--card-ink-2); }

/* Fluxo Metodológico: legenda dos três blocos e da saída (spin-off), usada na página do Fluxo e na Arquitetura */
.fx-blocks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 10px; }
.fx-block { border: 1px solid var(--line); border-top: 4px solid var(--ph, var(--ink-3)); border-radius: 10px; background: var(--surface); padding: 10px 12px 12px; display: grid; gap: 4px; }
.fx-block.exit { border-top-style: dashed; border-top-color: var(--ink-3); }
.fx-bn { font: 700 13px var(--font-title); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.fx-bs { display: flex; gap: 4px; align-items: center; color: var(--ink-3); font: 700 13px var(--font-title); }
.fx-bs b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ph, var(--ink-3)); color: #fff; font-size: 12px; }
.fx-block.exit .fx-bs b { background: #e9716f; color: #1d092b; }
.fx-bd { font-size: 13px; line-height: 1.4; color: var(--ink-2); white-space: pre-wrap; }
.fx-bx { font-size: 12px; color: var(--ink-3); }
.fx-bx [contenteditable] { color: var(--ink-2); }
.fx-blocks [contenteditable] { outline: none; border-radius: 3px; }
.fx-blocks [contenteditable]:hover, .fx-blocks [contenteditable]:focus { box-shadow: inset 0 0 0 1px var(--line); }
body.readonly .fx-blocks [contenteditable]:hover { box-shadow: none; }
/* nomes dos blocos em volta do anel: tons claros no escuro (contraste ≥ 4.5:1) e halo da cor do fundo; no claro, tons escuros */
svg .phase { font-family: var(--font-title); font-weight: 700; paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
svg .phase.p0 { fill: #c9b0f2; } svg .phase.p1 { fill: #f4a3b6; } svg .phase.p2 { fill: #ffb4ad; }
:root[data-theme="light"] svg .phase.p0 { fill: #4d1f74; } :root[data-theme="light"] svg .phase.p1 { fill: #8a2f4c; } :root[data-theme="light"] svg .phase.p2 { fill: #a8403c; }
svg .exit { color: var(--ink); }
svg .exit-t { font-family: var(--font-title); }

/* =====================================================================
   Upgrade de interação (sistema): tokens, ícones, botões, vidro, swipe,
   carregamento, voltar ao topo, parallax. Sem sombras em botões.
   ===================================================================== */
:root {
  --blk-int: #673c8e; --blk-mob: #b8485e; --blk-act: #e9716f;
  --c-primary: #ff7c7b; --c-primary-hover: #ff9291; --c-primary-active: #f06a69; --c-on-primary: #1d092b;
  --ok: #4cc9a0; --test: #e0b341; --open: #8fb4ff; --danger: #ff7c7b;
  --glass-1: rgba(255,255,255,.07); --glass-2: rgba(255,255,255,.11); --glass-edge-hi: rgba(255,255,255,.22); --glass-edge-lo: rgba(255,255,255,.08);
  --glass-blur: 14px; --glass-sat: 1.4; --dur-5: 700ms; --ease-spring: var(--ease-pop);
}
:root[data-theme="light"] {
  --c-primary-hover: #ff6a69; --c-primary-active: #e85b5a;
  --ok: #17785a; --test: #8a6200; --open: #2f56a8; --danger: #b8323a;
  --glass-1: rgba(255,255,255,.62); --glass-2: rgba(255,255,255,.78); --glass-edge-hi: rgba(255,255,255,.9); --glass-edge-lo: rgba(29,9,43,.08);
}
.cv-ic { width: 1.25em; height: 1.25em; flex-shrink: 0; vertical-align: -.22em; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* Botões: preenchimento que desliza no hover (sem sombra, sem brilho) */
.cv-page .btn { position: relative; overflow: hidden; isolation: isolate; }
.cv-page .btn::before { content: ""; position: absolute; inset: 0; z-index: -1; translate: -101% 0; background: var(--slide, rgba(255, 124, 123, .16)); transition: translate var(--dur-3) var(--ease-out); }
.cv-page .btn:hover::before, .cv-page .btn:focus-visible::before { translate: 0 0; }
.cv-page .btn:hover { background: var(--surface); }
.cv-page .btn.primary { --slide: var(--c-primary-hover); }
.cv-page .btn.primary:hover { filter: none; background: var(--c-primary); }
.cv-page .btn.primary:active { background: var(--c-primary-active); }
.cv-page .btn.danger { --slide: rgba(255, 124, 123, .16); }
.cv-page .btn, .cv-modal .row button, .cv-login .go { transition: background-color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out), translate 320ms var(--ease-spring); }
.cv-modal .row button.go, .cv-login .go { position: relative; overflow: hidden; isolation: isolate; }
.cv-modal .row button.go::before, .cv-login .go::before { content: ""; position: absolute; inset: 0; z-index: -1; translate: -101% 0; background: var(--c-primary-hover); transition: translate var(--dur-3) var(--ease-out); }
.cv-modal .row button.go.danger::before { background: #9e2830; }
.cv-modal .row button.go:hover::before, .cv-login .go:hover::before { translate: 0 0; }

/* Carregamento integrado: spinner dentro do botão, largura travada, aria-busy */
.is-busy { pointer-events: none; cursor: progress !important; }
.is-busy > * { opacity: .55; }
.is-busy::after { content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 8px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; vertical-align: -2px; animation: cv-spin .7s linear infinite; }
.is-done::after { content: "✓"; margin-left: 8px; font-weight: 700; animation: pop var(--dur-3) var(--ease-pop); }
@keyframes cv-spin { to { rotate: 360deg; } }

/* Vidro fosco no cabeçalho; mais opaco depois de rolar */
.cv-page header { background: rgba(var(--bg-rgb), .72); backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)); -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)); border-bottom-color: var(--glass-edge-lo); transition: background-color var(--dur-3) var(--ease-out); }
.cv-page header.is-stuck { background: rgba(var(--bg-rgb), .88); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .cv-page header { background: rgba(var(--bg-rgb), .96); } }
@media (prefers-reduced-transparency: reduce) { .cv-page header { backdrop-filter: none; background: var(--bg); } }
.cv-modal { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* Toasts por tipo, com ícone; sem sombra */
.cv-toast { box-shadow: none; display: inline-flex; align-items: center; gap: 8px; max-width: min(92vw, 560px); }
.cv-toast .cv-ic { width: 18px; height: 18px; }
.cv-toast.ok .cv-ic { color: #4cc9a0; } .cv-toast.err { border-color: rgba(255,124,123,.6); } .cv-toast.err .cv-ic { color: #ff7c7b; }

/* Deslizar para confirmar (ações irreversíveis), com alternativa por teclado e clique */
.swipe { position: relative; height: 48px; border-radius: 999px; background: var(--card-swipe, #f3ebf8); border: 1px solid #e2d5ec; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: pan-y; margin-top: 16px; }
.swipe .sw-fill { position: absolute; inset: 0 auto 0 0; width: 48px; background: var(--sw-fill, rgba(255, 124, 123, .28)); border-radius: 999px; }
.swipe .sw-label { position: absolute; inset: 0; display: grid; place-items: center; padding-left: 48px; font: 700 12px var(--font-title); letter-spacing: .12em; text-transform: uppercase; color: #4d3a63; pointer-events: none; transition: opacity var(--dur-1); }
.swipe .sw-thumb { position: absolute; top: 3px; left: 3px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--sw-c, #ff7c7b); color: #1d092b; display: grid; place-items: center; cursor: grab; font: 700 18px var(--font-title); touch-action: none; }
.swipe .sw-thumb:active { cursor: grabbing; }
.swipe.is-back .sw-thumb, .swipe.is-back .sw-fill { transition: translate 320ms var(--ease-spring), width 320ms var(--ease-spring); }
.swipe.danger { --sw-c: #b8323a; --sw-fill: rgba(184, 50, 58, .28); } .swipe.danger .sw-thumb { color: #fff; }
.swipe .sw-thumb:focus-visible { outline: 2px solid #1d092b; outline-offset: 2px; }
.swipe-alt { margin-top: 8px; font-size: 12px; color: #66507f; }
.swipe-alt button { border: 0; background: none; color: #b8323a; text-decoration: underline; text-underline-offset: 3px; font: 700 12px var(--font-title); cursor: pointer; padding: 4px 2px; }

/* Voltar ao topo */
.to-top { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 30; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--glass-edge-hi); background: rgba(var(--bg-rgb), .7); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--ink); display: grid; place-items: center; cursor: pointer; opacity: 0; translate: 0 12px; pointer-events: none; transition: opacity var(--dur-3) var(--ease-out), translate var(--dur-3) var(--ease-out), background-color var(--dur-2); }
.to-top.on { opacity: 1; translate: 0 0; pointer-events: auto; }
.to-top:hover { background: var(--c-primary); color: var(--c-on-primary); border-color: var(--c-primary); }
.to-top:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.to-top .cv-ic { width: 20px; height: 20px; }
html.embed .to-top { display: none; }

/* Atalho de busca: dica de teclado */
.cs-kbd { display: none; font: 600 12px var(--font-body); color: var(--ink-3); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; line-height: 18px; margin-right: 4px; }
@media (hover: hover) and (pointer: fine) and (min-width: 821px) { .cs-kbd { display: inline-block; } .cs-field input:focus ~ .cs-kbd, .cs-field.has-q .cs-kbd { display: none; } }

/* Parallax multicamadas (Home): só ponteiro fino e telas largas */
[data-depth] { will-change: auto; }
.px-layer { position: absolute; pointer-events: none; z-index: 0; }

/* Toque: alvos mínimos de 44px */
@media (pointer: coarse) { .cv-page .btn, .cv-modal .row button { min-height: 44px; } }

@media (prefers-reduced-motion: reduce) {
  .cv-page .btn::before, .cv-modal .row button.go::before, .cv-login .go::before { transition: none; }
  .is-busy::after { animation: none; border-right-color: currentColor; opacity: .5; }
  .to-top, .swipe .sw-thumb, .swipe .sw-fill { transition: none !important; }
}

/* Auditoria de acessibilidade: contraste no tema claro, foco do anel, pílulas */
:root[data-theme="light"] svg .exit-t, :root[data-theme="light"] svg .exit-t tspan:first-child { fill: #a8403c; }
.seg:focus-visible path, .fx-ring .seg:focus-visible path { stroke: #fff !important; stroke-width: 4 !important; paint-order: stroke; }
:root[data-theme="light"] .seg:focus-visible path { stroke: #1d092b !important; }
.sf-soon { opacity: .85; }

/* QA: alvos de toque em ponteiro grosso */
@media (pointer: coarse) {
  .cv-modal .note-head .bul, .cv-modal .row button { min-height: 44px; }
  .item .status, .item .del { position: relative; }
  .item .status::after, .item .del::after { content: ""; position: absolute; inset: -6px; }
  .item .del { opacity: .7; }
}

/* Esferas dos resultados (Alavancas e Arquitetura) */
.sph { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; margin: 0 0 2px; font: 700 12px var(--font-title); letter-spacing: .12em; text-transform: uppercase; color: var(--sph, #8a76a0); cursor: pointer; text-align: left; }
.sph svg { flex-shrink: 0; overflow: visible; }
.sph circle { fill: none; stroke: currentColor; stroke-width: 1.4; opacity: .35; }
.sph circle.r0 { fill: currentColor; stroke: none; }
.sph circle.on { opacity: 1; stroke-width: 2.4; }
.sph circle.r0.on { r: 3; }
/* cores das esferas como texto: vêm dos tokens do tema; a folha A4 é sempre branca e usa as variantes escuras */
.sph-ctrl { --sph: var(--sph-ctrl); } .sph-infl { --sph: var(--sph-infl); } .sph-int { --sph: var(--sph-int); } .sph-none { --sph: var(--sph-none); }
.a4, .a4v-stage { --sph-ctrl: #7240ad; --sph-infl: #ad3459; --sph-int: #157560; --sph-none: #6f5d80; }
.sph-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 8px 18px; margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 12.5px; color: var(--ink-2); }
.sph-legend .sl-t { grid-column: 1 / -1; font: 700 12px var(--font-title); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.sph-legend .sl { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 8px; line-height: 1.4; }
.sph-legend .sl > span:last-child { grid-column: 2; }
@media (max-width: 760px) { .sph-legend { grid-template-columns: minmax(0, 1fr); } }
.sph-legend .sl b { font-family: var(--font-title); color: var(--ink); }
.sph-legend .sph { margin: 0; }
:root:not([data-theme="light"]) .sph-legend .sph-ctrl { --sph: #c4a0ec; }
:root:not([data-theme="light"]) .sph-legend .sph-infl { --sph: #ff8fa6; }
:root:not([data-theme="light"]) .sph-legend .sph-int { --sph: #5fd3b4; }
/* 5 pessoas: no celular, 3 por linha (3 + 2) em vez de 4 + 1 */
@media (max-width: 480px) { .cv-login .who, .cv-modal .who { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Regras que se repetiam, idênticas, em várias páginas */
.page-head .eyebrow { font: 700 12px var(--font-title); letter-spacing: .16em; text-transform: uppercase; color: var(--accent-text); }
.note .comment { min-height: 3em; margin-top: 6px; color: var(--ink-2); white-space: pre-wrap; }
.note .lbl { font: 700 12px var(--font-title); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); }
.note .nlbl { font: 700 12px var(--font-title); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); }

/* =====================================================================
   Sistema de design: alvos de toque (WCAG 2.5.8), leitura, movimento e telas.
   Camada final: só consome os tokens do :root (sem valores soltos novos).
   ===================================================================== */
/* ---------- Alvos de toque >= 24 x 24 (área invisível, sem inchar o visual) ---------- */
.site-footer .sf-col a, .site-footer .sf-kid a, .site-footer .sf-base a, .site-footer .sf-dl a { display: inline-flex; align-items: center; min-height: var(--hit-min); }
.sf-col { gap: 0; }
.sf-kid::before { top: -4px; }
button.sph, .sph[role="button"] { min-height: var(--hit-min); }
.sdot { position: relative; }
.sdot::after { content: ""; position: absolute; inset: -10px; z-index: 1; border-radius: var(--r-sm); }   /* alvo de 28-30px (descontada a borda) em volta do ponto de 12-18px */

/* ---------- Leitura: entrelinha 1.55 e medida de ~70ch ---------- */
.cv-page, body { line-height: var(--lh-body); }
:is(.cv-page, body) :is(p, .lead, .desc, .cd, .ac, .fr) { max-width: var(--measure); text-wrap: pretty; }
:is(.cv-page, body) :is([style*="text-align:center"], [style*="text-align: center"]) p { margin-inline: auto; }
/* títulos: a tag segue a hierarquia (h1 > h2 > h3); o visual vem das classes */
.h-as-2 { font-size: var(--fs-2xl); } .h-as-3 { font-size: var(--fs-xl); } .h-as-4 { font-size: var(--fs-lg); }

/* ---------- Impacto: piso de 12px (regras genéricas; a página em si não é editada aqui) ---------- */
body[data-page="impacto"] :is(.page-head .eyebrow, .sp .lvl, .bar2 .k, .tag, .ind .fl b, .ind .mo, .ind .ex .et, .ind .ex .lt b, .alv > button, .alv > span, .alv i, .use h5, .sp .flt, .ind button.tag.st, .orbit-fig .cv, .orbit-cap span) { font-size: var(--fs-xs); }
body[data-page="impacto"] .alv i { opacity: 1; color: var(--ink-2); }
body[data-page="impacto"] .sp .sh > button { min-height: 28px; }

/* ---------- Foco visível único (inclui SVG e elementos com tabindex/role=button) ---------- */
body :is([tabindex]:not([tabindex="-1"]), [role="button"]):focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* ---------- Microinterações: só transform, opacidade e cor; nunca sombra ---------- */
:is(.cv-page, body) :is(button.sph, .rst, .due-btn, .gate-btn, .vt, .sf-btn, .sf-open, .nav-exp, .to-top, .login-btn) { box-shadow: none; }
@media (prefers-reduced-motion: no-preference) {
  :is(.cv-page, body) :is(button.sph, .rst, .due-btn, .gate-btn, .vt, .sf-btn, .sf-open, .sdot, .nav-main, .nav-child) {
    transition: color var(--dur-1) var(--ease-out), background-color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out), opacity var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out); }
  @media (hover: hover) {
    :is(.cv-page, body) :is(button.sph, .rst, .due-btn, .gate-btn, .vt, .sf-btn, .sf-open, .sdot):not(:disabled):hover { transform: translateY(-1px); }
  }
  :is(.cv-page, body) :is(.btn, button.sph, .rst, .due-btn, .gate-btn, .vt, .sf-btn, .sf-open, .sdot, .card):not(:disabled):active { transform: scale(.97); transition-duration: 60ms; }
}
@media (prefers-reduced-motion: reduce) {
  :is(.cv-page, body) :is(.btn, button.sph, .rst, .due-btn, .gate-btn, .vt, .sf-btn, .sf-open, .sdot, .card, .nav-main, .nav-child):is(:hover, :active) { transform: none !important; }
}

/* ---------- Telas: áreas seguras, campos sem zoom no iOS, cabeçalho compacto, telas grandes ---------- */
:is(.cv-page, body) header { padding-top: var(--safe-t); }
:is(.cv-page, body) header .bar { padding-left: max(16px, var(--safe-l)); padding-right: max(16px, var(--safe-r)); }
.version-banner .in { padding-left: max(16px, var(--safe-l)); padding-right: max(16px, var(--safe-r)); }
.site-footer .sf-in, .site-footer .sf-base { padding-left: max(16px, var(--safe-l)); padding-right: max(16px, var(--safe-r)); }
.site-footer .sf-base { padding-bottom: calc(24px + var(--safe-b)); }
@media (pointer: coarse), (max-width: 820px) {
  :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="button"], [type="submit"], [type="color"]), textarea, select) { font-size: var(--fs-md) !important; }   /* 16px: o iOS não dá zoom ao focar */
}
@media (max-width: 820px) {
  .site-nav { max-height: calc(100dvh - var(--hdr-h) - var(--safe-b)); }
  body:has(.version-banner) .site-nav { max-height: calc(100dvh - var(--hdr-h) - 120px); }   /* o banner "Modo leitura" fica acima do cabeçalho */
}
@media (max-width: 820px) and (max-height: 700px) {   /* telas baixas: cabeçalho compacto */
  header .bar, .cv-page header .bar { padding-top: 4px; padding-bottom: 4px; gap: 4px 8px; }
  header .brand img, .cv-page header .brand img { height: 22px; }
  header .brand h1, .cv-page header .brand h1 { font-size: var(--fs-md); }
  .nav-toggle, .edit-toggle { width: 36px; height: 36px; }
  .cv-search .cs-open { width: 36px; height: 36px; }
  .cv-search.open .cs-field { height: 36px; }
  header .saved { margin: 0; font-size: var(--fs-xs); line-height: 1.2; }
}
/* rodapé: fundo de ponta a ponta, conteúdo alinhado ao cabeçalho e às páginas em qualquer largura */
footer.site-footer { width: 100%; max-width: none; box-sizing: border-box; }

/* Painel de dashboard: o resumo em números no topo das páginas (Arquitetura, Validação, Alavancas, Impacto, Programas) */
.dash-panel { position: relative; padding: clamp(18px, 2.4vw, 32px); padding-top: clamp(34px, 3.4vw, 44px); border: 1px solid var(--line); border-radius: var(--r-lg, 16px); background: var(--surface-2); }
:root[data-theme="light"] .dash-panel { background: #efe2f7; border-color: #d6c1e6; }
.dash-panel > .dash-tag { position: absolute; left: clamp(18px, 2.4vw, 32px); top: 14px; margin: 0; font: 700 12px var(--font-title); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
