/* ==========================================================================
   ArtMuse: design system
   Tokens (claro/escuro), tipografia em rem (respeita a preferência de tamanho
   de letra), componentes e movimento.
   ========================================================================== */

@font-face { font-family: "Geist"; src: url("../fonts/geist-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/geist-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Consolas, monospace;

  --brand: #ff5a1f;
  --brand-hover: #ff7040;
  --brand-ink: #1a0800;
  --brand-soft: rgba(255, 90, 31, .1);

  --r-xs: 6px; --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px; --r-full: 999px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --t1: 120ms; --t2: 200ms; --t3: 320ms; --t4: 560ms; --t5: 900ms;

  --icon: 1.125rem;
  --header-h: 4rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --max: 80rem;

  /* claro (padrão) */
  color-scheme: light;
  --bg: #fafaf9;
  --bg-elev: #ffffff;
  --bg-sunken: #f3f2f0;
  --bg-hover: rgba(28, 25, 23, .045);
  --bg-active: rgba(28, 25, 23, .08);
  --fg: #0c0a09;
  --fg-2: #44403c;
  --fg-3: #78716c;
  --fg-4: #a8a29e;
  --border: #e7e5e4;
  --border-strong: #d6d3d1;
  --inv-bg: #0c0a09;
  --inv-fg: #fafaf9;
  --overlay: rgba(12, 10, 9, .52);
  --img-bg: #e7e5e4;
  --shadow-sm: 0 1px 2px rgba(12, 10, 9, .06);
  --shadow: 0 1px 2px rgba(12, 10, 9, .05), 0 8px 24px -6px rgba(12, 10, 9, .1);
  --shadow-lg: 0 2px 6px rgba(12, 10, 9, .06), 0 28px 60px -12px rgba(12, 10, 9, .22);
  --ok: #15803d; --ok-bg: #dcfce7;
  --warn: #a16207; --warn-bg: #fef3c7;
  --err: #dc2626; --err-bg: #fee2e2;
  --info: #1d4ed8; --info-bg: #dbeafe;
  --series-1: #2a78d6;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0a;
  --bg-elev: #141414;
  --bg-sunken: #070707;
  --bg-hover: rgba(255, 255, 255, .05);
  --bg-active: rgba(255, 255, 255, .09);
  --fg: #fafafa;
  --fg-2: #d4d4d4;
  --fg-3: #a1a1a1;
  --fg-4: #6b6b6b;
  --border: #262626;
  --border-strong: #383838;
  --inv-bg: #fafafa;
  --inv-fg: #0a0a0a;
  --overlay: rgba(0, 0, 0, .66);
  --img-bg: #1c1c1c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -6px rgba(0, 0, 0, .5);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .4), 0 28px 60px -12px rgba(0, 0, 0, .7);
  --ok: #4ade80; --ok-bg: rgba(74, 222, 128, .12);
  --warn: #fbbf24; --warn-bg: rgba(251, 191, 36, .12);
  --err: #f87171; --err-bg: rgba(248, 113, 113, .12);
  --info: #60a5fa; --info-bg: rgba(96, 165, 250, .12);
  --series-1: #3987e5;
}
@media (prefers-color-scheme: dark) {
  :root:where([data-theme="system"]) {
    color-scheme: dark;
    --bg: #0a0a0a; --bg-elev: #141414; --bg-sunken: #070707;
    --bg-hover: rgba(255, 255, 255, .05); --bg-active: rgba(255, 255, 255, .09);
    --fg: #fafafa; --fg-2: #d4d4d4; --fg-3: #a1a1a1; --fg-4: #6b6b6b;
    --border: #262626; --border-strong: #383838;
    --inv-bg: #fafafa; --inv-fg: #0a0a0a; --overlay: rgba(0, 0, 0, .66); --img-bg: #1c1c1c;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -6px rgba(0, 0, 0, .5);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .4), 0 28px 60px -12px rgba(0, 0, 0, .7);
    --ok: #4ade80; --ok-bg: rgba(74, 222, 128, .12);
    --warn: #fbbf24; --warn-bg: rgba(251, 191, 36, .12);
    --err: #f87171; --err-bg: rgba(248, 113, 113, .12);
    --info: #60a5fa; --info-bg: rgba(96, 165, 250, .12);
    --series-1: #3987e5;
  }
}

/* Preferências do usuário (salvas no banco, aplicadas no <html>) */
:root[data-font="sm"] { font-size: 15px; }
:root[data-font="md"] { font-size: 16px; }
:root[data-font="lg"] { font-size: 18px; }
:root[data-icons="sm"] { --icon: 1rem; }
:root[data-icons="lg"] { --icon: 1.4rem; }

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 260ms; animation-timing-function: var(--ease); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--fg);
  font: 400 1rem/1.55 var(--font); letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  transition: background-color var(--t3), color var(--t3);
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--r-xs); }
::selection { background: var(--brand); color: #fff; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.025em; line-height: 1.15; color: var(--fg); }
p { margin: 0; }
code, kbd { font-family: var(--mono); font-size: .86em; }
code { padding: .1em .4em; border-radius: var(--r-xs); background: var(--bg-sunken); border: 1px solid var(--border); }
kbd { display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; padding: 0 .35rem; border-radius: var(--r-xs); border: 1px solid var(--border-strong); border-bottom-width: 2px; color: var(--fg-3); font-size: .72rem; background: var(--bg-elev); }

.skip-link { position: fixed; top: .5rem; left: .5rem; z-index: 1000; padding: .6rem 1rem; border-radius: var(--r); background: var(--inv-bg); color: var(--inv-fg); transform: translateY(-160%); transition: transform var(--t2); }
.skip-link:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.ic { width: var(--icon); height: var(--icon); flex: none; }
.ic-sm { width: calc(var(--icon) * .85); height: calc(var(--icon) * .85); flex: none; }
.ic-lg { width: calc(var(--icon) * 1.35); height: calc(var(--icon) * 1.35); flex: none; }
.muted { color: var(--fg-3); }
.soft { color: var(--fg-2); }
.num { font-variant-numeric: tabular-nums; }
.stack { display: grid; gap: 1rem; }
.row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- Tipografia ---------- */
.t-display { font-size: clamp(2.6rem, 6.4vw, 5.4rem); font-weight: 650; letter-spacing: -.045em; line-height: .98; }
.t-h1 { font-size: clamp(2rem, 4.2vw, 3.25rem); font-weight: 640; letter-spacing: -.04em; line-height: 1.04; }
.t-h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 620; letter-spacing: -.035em; line-height: 1.1; }
.t-h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; }
.t-lead { font-size: clamp(1.05rem, 1.4vw, 1.25rem); color: var(--fg-2); line-height: 1.6; }
.t-label { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.t-small { font-size: .875rem; }
.t-xs { font-size: .78rem; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: .55rem; font-weight: 640; font-size: 1.32rem; letter-spacing: -.055em; color: var(--fg); }
.logo svg { width: 1.9rem; height: 1.9rem; border-radius: 28%; overflow: hidden; flex: none; }
.logo .lg-m { stroke: #fff; }
/* O ponto de luz sob o A sobe um pouco ao passar o mouse (nada animando em repouso). */
.logo .lg-sun { transition: transform var(--t4) var(--spring); }
.logo:hover .lg-sun { transform: translateY(-2.5px); }

/* ---------- Botões (alvos ≥ 40px: lei de Fitts) ---------- */
.btn {
  --h: 2.5rem;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: var(--h); padding: 0 1rem; border-radius: var(--r-sm); white-space: nowrap; user-select: none;
  font-size: .925rem; font-weight: 550; letter-spacing: -.01em; line-height: 1;
  border: 1px solid transparent; transition: background var(--t2), border-color var(--t2), color var(--t2), transform var(--t2) var(--ease), box-shadow var(--t2), opacity var(--t2);
}
.btn:active:not([disabled]) { transform: scale(.97); }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }
.btn-primary { background: var(--inv-bg); color: var(--inv-fg); }
.btn-primary:hover { opacity: .88; }
.btn-brand { background: var(--brand); color: var(--brand-ink); }
.btn-brand:hover { background: var(--brand-hover); }
.btn-secondary { background: var(--bg-elev); border-color: var(--border-strong); color: var(--fg); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--fg-4); }
.btn-ghost { color: var(--fg-2); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--fg); }
.btn-danger { background: var(--err-bg); color: var(--err); }
.btn-danger:hover { background: var(--err); color: #fff; }
.btn-sm { --h: 2.125rem; padding: 0 .75rem; font-size: .85rem; }
.btn-lg { --h: 3rem; padding: 0 1.4rem; font-size: 1rem; border-radius: var(--r); }
.btn-xl { --h: 3.5rem; padding: 0 1.75rem; font-size: 1.05rem; border-radius: var(--r); }
.btn-block { width: 100%; }
.btn-icon { width: var(--h); padding: 0; }
.btn .ic, .btn .ic-sm { transition: transform var(--t3) var(--ease); }
.btn:hover .ic-arrow { transform: translateX(3px); }
.btn .spin { width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { color: var(--fg); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: .2em; transition: text-decoration-color var(--t2); }
.link:hover { text-decoration-color: var(--fg); }
.link-brand { color: var(--brand); font-weight: 550; }
.link-brand:hover { text-decoration: underline; text-underline-offset: .2em; }

/* ---------- Formulários (rótulo acima: padrão conhecido, lei de Jakob) ---------- */
.field { display: grid; gap: .4rem; }
.field > label, .label { font-size: .875rem; font-weight: 550; color: var(--fg); }
.field .opt { font-weight: 400; color: var(--fg-3); }
.input, .select, .textarea {
  width: 100%; height: 2.75rem; padding: 0 .85rem; border-radius: var(--r-sm); background: var(--bg-elev);
  border: 1px solid var(--border-strong); outline: none; font-size: .95rem; color: var(--fg);
  transition: border-color var(--t2), box-shadow var(--t2), background var(--t2);
}
.textarea { height: auto; min-height: 6.5rem; padding: .7rem .85rem; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 2.25rem; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2378716c' stroke-width='1.6'><path d='M1 1.5l5 5 5-5'/></svg>"); background-repeat: no-repeat; background-position: right .8rem center; }
.input::placeholder, .textarea::placeholder { color: var(--fg-4); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--fg-4); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--fg); box-shadow: 0 0 0 3px var(--bg-active); }
.input-sm, .select-sm { height: 2.25rem; font-size: .875rem; }
.field.is-invalid .input, .field.is-invalid .select { border-color: var(--err); box-shadow: 0 0 0 3px var(--err-bg); }
.field-error { font-size: .8rem; color: var(--err); display: flex; gap: .35rem; align-items: center; }
.field-error:empty { display: none; }
.hint { font-size: .8rem; color: var(--fg-3); }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 2.75rem; }
.input-wrap .addon { position: absolute; right: .3rem; top: 50%; transform: translateY(-50%); width: 2.2rem; height: 2.2rem; border-radius: var(--r-xs); display: grid; place-items: center; color: var(--fg-3); transition: background var(--t2), color var(--t2); }
.input-wrap .addon:hover { background: var(--bg-hover); color: var(--fg); }
.caps { font-size: .8rem; color: var(--warn); }
.check { display: flex; gap: .7rem; align-items: flex-start; font-size: .9rem; color: var(--fg-2); line-height: 1.5; cursor: pointer; }
.check input, .cbox { appearance: none; flex: none; width: 1.15rem; height: 1.15rem; margin: .15rem 0 0; border-radius: 5px; border: 1.5px solid var(--border-strong); background: var(--bg-elev); display: grid; place-items: center; cursor: pointer; transition: background var(--t2), border-color var(--t2); }
.check input::after, .cbox::after { content: ""; width: .55rem; height: .32rem; border: 2px solid var(--inv-fg); border-top: 0; border-right: 0; transform: rotate(-45deg) scale(0); margin-top: -2px; transition: transform var(--t2) var(--spring); }
.check input:checked, .cbox:checked { background: var(--inv-bg); border-color: var(--inv-bg); }
.check input:checked::after, .cbox:checked::after { transform: rotate(-45deg) scale(1); }
.check.is-invalid input { border-color: var(--err); }
.check a { color: var(--fg); text-decoration: underline; text-underline-offset: .2em; }
.switch { display: inline-flex; align-items: center; gap: .7rem; cursor: pointer; font-size: .9rem; }
.switch input { appearance: none; flex: none; width: 2.25rem; height: 1.3rem; border-radius: var(--r-full); background: var(--border-strong); position: relative; cursor: pointer; transition: background var(--t2); }
.switch input::after { content: ""; position: absolute; top: .15rem; left: .15rem; width: 1rem; height: 1rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform var(--t3) var(--spring); }
.switch input:checked { background: var(--fg); }
.switch input:checked::after { transform: translateX(.95rem); background: var(--bg); }
.switch input:disabled { opacity: .5; cursor: not-allowed; }
.alert { display: flex; gap: .65rem; align-items: flex-start; padding: .8rem 1rem; border-radius: var(--r-sm); font-size: .9rem; animation: rise var(--t3) var(--ease-out); }
.alert .ic { margin-top: .1rem; }
.alert-err { background: var(--err-bg); color: var(--err); }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-info { background: var(--info-bg); color: var(--info); }
.alert-warn { background: var(--warn-bg); color: var(--warn); }
.shake { animation: shake .42s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Chips, badges, segmentado, abas ---------- */
.chip { display: inline-flex; align-items: center; gap: .4rem; height: 2.125rem; padding: 0 .8rem; border-radius: var(--r-full); font-size: .85rem; font-weight: 500; color: var(--fg-2); background: var(--bg-elev); border: 1px solid var(--border); white-space: nowrap; transition: background var(--t2), color var(--t2), border-color var(--t2), transform var(--t2) var(--ease); }
.chip:hover { border-color: var(--border-strong); color: var(--fg); }
.chip:active { transform: scale(.96); }
.chip.is-active, .chip[aria-pressed="true"] { background: var(--inv-bg); color: var(--inv-fg); border-color: var(--inv-bg); }
.chip .count { font-size: .75rem; color: inherit; opacity: .55; font-variant-numeric: tabular-nums; }
.chip-x { padding-right: .35rem; }
.chip-x .x { width: 1.35rem; height: 1.35rem; border-radius: 50%; display: grid; place-items: center; transition: background var(--t2); }
.chip-x:hover .x { background: var(--bg-active); }
.badge { display: inline-flex; align-items: center; gap: .3rem; width: max-content; height: 1.35rem; padding: 0 .5rem; border-radius: var(--r-xs); font-size: .72rem; font-weight: 600; letter-spacing: .01em; white-space: nowrap; background: var(--bg-sunken); color: var(--fg-2); border: 1px solid var(--border); }
.badge .ic-sm { width: .8rem; height: .8rem; }
.badge-ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge-err { background: var(--err-bg); color: var(--err); border-color: transparent; }
.badge-info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.badge-brand { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.badge-inv { background: var(--inv-bg); color: var(--inv-fg); border-color: transparent; }
.badge-glass { background: rgba(10, 10, 10, .55); color: #fff; border-color: rgba(255,255,255,.15); backdrop-filter: blur(8px); }
.seg { position: relative; display: inline-flex; padding: .2rem; border-radius: var(--r-sm); background: var(--bg-sunken); border: 1px solid var(--border); isolation: isolate; }
.seg button { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .4rem; height: 2rem; padding: 0 .8rem; border-radius: calc(var(--r-sm) - 2px); font-size: .85rem; font-weight: 500; color: var(--fg-3); transition: color var(--t2); }
.seg button:hover { color: var(--fg); }
.seg button.is-active { color: var(--fg); }
.seg .seg-thumb { position: absolute; z-index: 0; top: .2rem; bottom: .2rem; border-radius: calc(var(--r-sm) - 2px); background: var(--bg-elev); box-shadow: var(--shadow-sm); border: 1px solid var(--border); transition: left var(--t3) var(--ease-out), width var(--t3) var(--ease-out); }
.tabs { position: relative; display: flex; gap: .25rem; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a { position: relative; padding: .75rem .9rem; font-size: .9rem; font-weight: 500; color: var(--fg-3); white-space: nowrap; transition: color var(--t2); }
.tabs button:hover, .tabs a:hover { color: var(--fg); }
.tabs .is-active { color: var(--fg); }
.tabs .tab-ink { position: absolute; bottom: -1px; height: 2px; background: var(--fg); border-radius: 2px; transition: left var(--t3) var(--ease-out), width var(--t3) var(--ease-out); }

/* ---------- Superfícies ---------- */
.card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-lg); }
.card-pad { padding: clamp(1.1rem, 2.4vw, 1.6rem); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: 1.05rem; }
.divider { height: 1px; background: var(--border); border: 0; margin: 1.5rem 0; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .9rem 1.5rem; margin: 0; }
.kv dt { font-size: .75rem; color: var(--fg-3); margin-bottom: .15rem; }
.kv dd { margin: 0; font-size: .925rem; word-break: break-word; }
.skeleton { background: linear-gradient(90deg, var(--bg-sunken) 25%, var(--bg-hover) 37%, var(--bg-sunken) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: var(--r-sm); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.empty { display: grid; justify-items: center; gap: .75rem; text-align: center; padding: 4rem 1rem; color: var(--fg-3); }
.empty .ic-lg { color: var(--fg-4); }
.empty h3 { color: var(--fg); }

/* ---------- Detalhes expansíveis ---------- */
.disclose summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; font-weight: 550; font-size: .925rem; }
.disclose summary::-webkit-details-marker { display: none; }
.disclose summary .ic-sm { transition: transform var(--t3) var(--ease); }
.disclose[open] summary .ic-sm { transform: rotate(180deg); }

/* ---------- Avatar e menu ---------- */
.avatar { width: 2.25rem; height: 2.25rem; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 600; font-size: .85rem; background: var(--inv-bg); color: var(--inv-fg); transition: transform var(--t2) var(--ease), box-shadow var(--t2); }
.avatar:hover { box-shadow: 0 0 0 3px var(--bg-active); }
.avatar-sm { width: 1.9rem; height: 1.9rem; font-size: .75rem; }
.menu { position: absolute; z-index: 150; min-width: 14rem; padding: .35rem; border-radius: var(--r); background: var(--bg-elev); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top right; pointer-events: none; transition: opacity var(--t2), transform var(--t2) var(--ease-out); }
.menu.is-open { opacity: 1; transform: none; pointer-events: auto; }
.menu .menu-head { padding: .6rem .7rem .7rem; border-bottom: 1px solid var(--border); margin-bottom: .3rem; }
.menu .menu-head strong { display: block; font-size: .9rem; }
.menu .menu-head span { font-size: .78rem; color: var(--fg-3); word-break: break-all; }
.menu a, .menu button { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .55rem .7rem; border-radius: var(--r-xs); font-size: .875rem; color: var(--fg-2); text-align: left; transition: background var(--t1), color var(--t1); }
.menu a:hover, .menu button:hover { background: var(--bg-hover); color: var(--fg); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: .3rem 0; }
.menu .kbd-right { margin-left: auto; }

/* ---------- Toast ---------- */
.toasts { position: fixed; z-index: 400; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; width: min(24rem, calc(100vw - 2rem)); }
.toast { display: flex; gap: .7rem; align-items: center; padding: .8rem 1rem; border-radius: var(--r); background: var(--inv-bg); color: var(--inv-fg); box-shadow: var(--shadow-lg); font-size: .9rem; animation: toast-in var(--t4) var(--spring); }
.toast .ic { flex: none; }
.toast.ok .ic { color: #4ade80; } .toast.err .ic { color: #f87171; } .toast.warn .ic { color: #fbbf24; }
.toast .t-action { margin-left: auto; font-weight: 600; text-decoration: underline; text-underline-offset: .2em; }
.toast.out { animation: toast-out var(--t3) var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }

/* ---------- Modal e gaveta ---------- */
.modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 1rem; background: var(--overlay); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity var(--t3); }
.modal.is-open { opacity: 1; pointer-events: auto; }
.modal-card { width: min(32rem, 100%); max-height: calc(100vh - 2rem); overflow: auto; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 1.5rem; transform: translateY(12px) scale(.98); transition: transform var(--t4) var(--spring); }
.modal.is-open .modal-card { transform: none; }
.modal-card h3 { font-size: 1.15rem; margin-bottom: .35rem; }
.modal-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1.5rem; flex-wrap: wrap; }
.drawer { position: fixed; inset: 0; z-index: 280; pointer-events: none; }
.drawer.is-open { pointer-events: auto; }
.drawer-bg { position: absolute; inset: 0; background: var(--overlay); opacity: 0; transition: opacity var(--t3); }
.drawer.is-open .drawer-bg { opacity: 1; }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(38rem, 100%); background: var(--bg-elev); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transform: translateX(102%); transition: transform var(--t4) var(--ease-out); }
.drawer.is-open .drawer-panel { transform: none; }
.drawer.left .drawer-panel { left: 0; right: auto; border-left: 0; border-right: 1px solid var(--border); transform: translateX(-102%); }
.drawer.left.is-open .drawer-panel { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 1.05rem; }
.drawer-body { flex: 1; overflow-y: auto; padding: 1.25rem; display: grid; gap: 1.1rem; align-content: start; }
.drawer-foot { padding: 1rem 1.25rem; border-top: 1px solid var(--border); display: flex; gap: .5rem; justify-content: flex-end; }

/* ---------- Banner de cookies ---------- */
.cookie { position: fixed; z-index: 260; left: 1rem; bottom: 1rem; width: min(26rem, calc(100vw - 2rem)); padding: 1.25rem; border-radius: var(--r-lg); background: var(--bg-elev); border: 1px solid var(--border); box-shadow: var(--shadow-lg); transform: translateY(calc(100% + 2rem)); transition: transform var(--t5) var(--ease-out); }
.cookie.is-open { transform: none; }
.cookie h2 { font-size: 1rem; margin-bottom: .4rem; display: flex; align-items: center; gap: .5rem; }
.cookie p { font-size: .85rem; color: var(--fg-2); line-height: 1.55; }
.cookie .row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: 1rem; }
.cookie .more { margin-top: .6rem; font-size: .82rem; color: var(--fg-3); text-decoration: underline; text-underline-offset: .2em; }
.pref-row { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem 0; border-top: 1px solid var(--border); }
.pref-row strong { display: block; font-size: .925rem; }
.pref-row p { font-size: .82rem; color: var(--fg-3); }

/* ---------- Revelação ao rolar (sutil, 300–600 ms: limiar de Doherty) ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity var(--t4) var(--ease-out), transform var(--t5) var(--ease-out); transition-delay: var(--d, 0s); }
.js [data-reveal="fade"] { transform: none; }
.js [data-reveal="scale"] { transform: scale(.97); }
.js [data-reveal="left"] { transform: translateX(-24px); }
.js [data-reveal="right"] { transform: translateX(24px); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js [data-stagger] > * { opacity: 0; transform: translateY(14px); transition: opacity var(--t4) var(--ease-out), transform var(--t4) var(--ease-out); transition-delay: calc(var(--i, 0) * 55ms); }
.js [data-stagger].is-in > * { opacity: 1; transform: none; }
.words .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .06em; margin-bottom: -.06em; }
.words .w > span { display: inline-block; transform: translateY(105%); transition: transform var(--t5) var(--ease-out); transition-delay: calc(var(--i) * 45ms + var(--d, 0s)); }
.words.is-in .w > span { transform: none; }

/* ---------- Movimento reduzido (sistema ou preferência salva) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js [data-reveal], .js [data-stagger] > *, .words .w > span { opacity: 1 !important; transform: none !important; }
}
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
:root[data-motion="reduce"] [data-reveal], :root[data-motion="reduce"] [data-stagger] > *, :root[data-motion="reduce"] .words .w > span { opacity: 1 !important; transform: none !important; }
.spacer-left { margin-left: auto; }
