/* ═══════════════════════════════════════════════════════════════════════
   Frases Motivacionais: cartão para compartilhar e API. Visual escuro e quente, com o âmbar do projeto.
   A cor do projeto vem de --accent / --accent-2 (o <body> as recebe do catálogo, src/data/projects.js).
   Movimento: juice.js põe data-motion="reduced" no <html> (opção Animações ou sistema pedindo menos movimento).
   Não depende de tokens.css nem de Bootstrap.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
	color-scheme: dark;
	--accent: #f5c451;
	--accent-2: #fb923c;
	--bg: #0c0906;
	--panel: rgb(255 255 255 / .045);
	--panel-2: rgb(255 255 255 / .075);
	--ink: #f7f0e6;
	--ink-2: #cfc1af;
	--ink-3: #a0927f;
	--line: rgb(255 255 255 / .11);
	--bad: #fca5a5;
	--ease: cubic-bezier(.2, .8, .2, 1);
	--font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	--mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
	--serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
	--radius: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 1rem; }
body { min-height: 100vh; min-height: 100dvh; margin: 0; display: flex; flex-direction: column; overflow-x: hidden; background: var(--bg); color: var(--ink); font: 400 1rem/1.55 var(--font); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { color: var(--accent-2); }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, dl, dd, figure, blockquote, fieldset { margin: 0; padding: 0; }
fieldset { border: 0; min-width: 0; }
.i { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.flip { transform: scaleX(-1); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: absolute; left: .6rem; top: -4rem; z-index: 300; padding: .5rem .9rem; border-radius: 10px; background: var(--accent); color: #1a1204; font-weight: 700; text-decoration: none; }
.skip:focus { top: .6rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }
kbd { display: inline-block; min-width: 1.6em; padding: .05em .45em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: rgb(255 255 255 / .06); font: 600 .78em/1.5 var(--mono); text-align: center; }
code { font: 500 .9em/1.4 var(--mono); }

/* ───────── Fundo ───────── */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: radial-gradient(120% 80% at 50% -10%, #261a0b 0%, var(--bg) 62%); }
.bg i { position: absolute; width: 56vmax; height: 56vmax; border-radius: 50%; filter: blur(120px); opacity: .14; }
.bg i:nth-child(1) { left: -22vmax; top: -28vmax; background: var(--accent); animation: drift 30s ease-in-out infinite alternate; }
.bg i:nth-child(2) { right: -28vmax; bottom: -32vmax; background: var(--accent-2); opacity: .1; animation: drift 36s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(7vmax, 5vmax) scale(1.12); } }
.grid { position: absolute; inset: 0; opacity: .5; background-image: linear-gradient(color-mix(in srgb, var(--accent) 5%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--accent) 5%, transparent) 1px, transparent 1px); background-size: 48px 48px; mask-image: radial-gradient(70% 55% at 50% 0%, #000, transparent); }

/* ───────── Esqueleto de carregamento ───────── */
.sk { display: block; border-radius: 8px; background: linear-gradient(100deg, rgb(255 255 255 / .06) 30%, rgb(255 255 255 / .15) 50%, rgb(255 255 255 / .06) 70%) 0 0 / 220% 100%; animation: shimmer 1.4s linear infinite; }
.sk--line { height: 1.1em; margin: .55em 0; }
.sk--short { width: 55%; }
@keyframes shimmer { to { background-position: -220% 0; } }

/* ───────── Topo ───────── */
.top { position: relative; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: max(.8rem, env(safe-area-inset-top)) clamp(.9rem, 3vw, 1.6rem) .8rem; }
.pill { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .35rem .95rem .35rem .75rem; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink-2); font-size: .88rem; font-weight: 600; text-decoration: none; transition: border-color .2s, color .2s; }
.pill:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--ink); }
.brand { display: flex; align-items: center; gap: .55rem; font: 800 1.3rem/1 var(--font); letter-spacing: -.01em; }
.brand__logo { width: 1.9rem; height: 1.9rem; stroke: none; }
.top__tools { display: flex; gap: .4rem; }
.tool { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink-2); transition: border-color .2s, color .2s, background .2s; }
.tool:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--ink); }
.tool[aria-pressed="false"] { color: var(--ink-3); background: transparent; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--bad) 70%, transparent); }
.tool[aria-pressed="false"] .i { opacity: .55; }

/* ───────── Corpo ───────── */
.wrap { width: min(1240px, 100%); margin: 0 auto; padding: .4rem clamp(.9rem, 3vw, 1.6rem) 2.5rem; flex: 1; }
.wrap:focus { outline: 0; }
.lead { max-width: 62ch; padding: .2rem .2rem .4rem; }
.kicker { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.lead__title { margin-top: .35rem; font: 800 clamp(1.8rem, 4.4vw, 2.5rem)/1.1 var(--font); letter-spacing: -.025em; }
.lead__title em { font: italic 700 1em/1 var(--serif); letter-spacing: 0; color: var(--accent); }
.lead__text { margin-top: .6rem; color: var(--ink-2); }
.nojs, .initial { padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 1rem; }
.initial { display: none; }
.initial blockquote { font: italic 700 1.4rem/1.35 var(--serif); }
.initial figcaption { margin-top: .5rem; color: var(--ink-2); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .45rem 1.05rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); font-weight: 600; font-size: .92rem; text-decoration: none; transition: transform .15s var(--ease), border-color .2s, background .2s, box-shadow .2s; }
.btn:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--ink); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn--primary { border-color: transparent; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1a1204; box-shadow: 0 10px 28px -12px var(--accent); }
.btn--primary:hover { color: #1a1204; filter: brightness(1.06); }
.btn--ghost { background: transparent; }
.btn--lg { min-height: 54px; padding: .5rem 1.2rem; font-size: 1rem; border-radius: 14px; }
.btn--sm { min-height: 40px; padding: .25rem .8rem; font-size: .85rem; }
.btn--block { width: 100%; }
.kbd-hint { margin-left: .2rem; border-color: rgb(26 18 4 / .35); background: rgb(26 18 4 / .12); color: #1a1204; }
@media (hover: none) { .kbd-hint { display: none; } }

.mini { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); transition: background .15s, color .15s, transform .15s var(--ease); }
.mini:hover { background: rgb(255 255 255 / .09); color: var(--ink); }
.mini:active { transform: scale(.9); }
.mini:disabled { opacity: .35; cursor: default; }
.mini--lg { width: 54px; height: 54px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.mini--heart[aria-pressed="true"] { color: #fb7185; border-color: color-mix(in srgb, #fb7185 60%, transparent); background: color-mix(in srgb, #fb7185 14%, transparent); }
.mini--heart[aria-pressed="true"] .i { fill: currentColor; }
.linklike { padding: 0; border: 0; background: none; color: var(--ink-3); text-decoration: underline dotted; text-underline-offset: .25em; }
.stage__meta .linklike { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .5rem; margin: -.5rem 0; }
.linklike:hover { color: var(--accent); }

/* ───────── Estúdio ───────── */
.studio { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }
.stage { min-width: 0; }
.stage__frame { --ar: 1; position: relative; width: min(100%, calc(min(72vh, 780px) * var(--ar))); aspect-ratio: var(--ar); margin: 0 auto; overflow: hidden; border-radius: 20px; background: #15100b; box-shadow: 0 0 0 1px var(--line), 0 40px 90px -40px color-mix(in srgb, var(--accent) 55%, transparent), 0 24px 50px -30px #000; transition: width .45s var(--ease), aspect-ratio .45s var(--ease); }
.stage__frame canvas { display: block; width: 100%; height: 100%; }
.stage__frame.is-swap canvas { animation: swap .42s var(--ease); }
@keyframes swap { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.sk-card { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; padding: 12%; background: linear-gradient(150deg, #1c150d, #120d08); transition: opacity .35s; }
.sk-card .sk { width: 100%; }
.sk--mark { width: 14% !important; aspect-ratio: 1; margin-bottom: 4%; border-radius: 50%; }
.sk--bar { width: 14% !important; height: .4rem; margin-top: 6%; }
.sk--author { width: 38% !important; height: .8rem; margin-top: 2%; }
body:not([data-phase="boot"]) .sk-card { opacity: 0; pointer-events: none; }
.stage__meta { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem .6rem; margin-top: .8rem; font-size: .85rem; color: var(--ink-3); }
.stage__meta b { color: var(--ink-2); }
.stage__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin: 1rem auto 0; max-width: 520px; }
.stage__mini { grid-column: 1 / -1; display: flex; justify-content: center; gap: .6rem; }

.panels { display: grid; gap: 1rem; min-width: 0; align-content: start; }
.panel { min-width: 0; padding: 1.15rem 1.15rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.panel__title { display: flex; align-items: center; gap: .65rem; margin-bottom: 1rem; font: 700 1.08rem/1.2 var(--font); }
.num { display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--accent); color: #1a1204; font-size: .85rem; font-weight: 800; }
.group { margin-top: 1rem; }
.group:first-of-type { margin-top: 0; }
.group legend, .field__label, .subtle { display: block; margin-bottom: .45rem; padding: 0; font-size: .8rem; font-weight: 600; color: var(--ink-3); }
.hint { margin: .5rem 0 1rem; font-size: .8rem; color: var(--ink-3); }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 1rem; }

.field { position: relative; display: flex; align-items: center; gap: .5rem; min-height: 46px; padding: 0 .35rem 0 .8rem; border: 1px solid var(--line); border-radius: 12px; background: rgb(255 255 255 / .04); transition: border-color .2s; }
.field:focus-within { border-color: var(--accent); }
.field input, .field select { flex: 1; min-width: 0; min-height: 44px; border: 0; outline: 0; background: transparent; }
.field input::placeholder { color: var(--ink-3); }
.field select option { background: #1a130c; color: var(--ink); }
.field__icon { color: var(--ink-3); }
.field--select { display: block; padding: .5rem .8rem .2rem; }
.field--select select { width: 100%; min-height: 36px; font-family: var(--mono); font-size: .88rem; }
.field--tight { min-height: 42px; padding-left: .7rem; }
.search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .75rem; }
.group .chips { margin-top: 0; }
.chip { min-height: 44px; padding: .3rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink-2); font-weight: 600; font-size: .9rem; transition: border-color .2s, background .2s, color .2s, transform .15s var(--ease); }
.chip:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.chip:active { transform: scale(.96); }
.chip[aria-checked="true"] { border-color: color-mix(in srgb, var(--accent) 75%, transparent); background: color-mix(in srgb, var(--accent) 17%, transparent); color: var(--ink); }
.chip--font { font-size: 1.05rem; }
.chip--icon { width: 48px; padding: 0; display: grid; place-items: center; }
.quick { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .85rem; }
.count { display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; padding: 0 .35rem; border-radius: 999px; background: var(--panel-2); font-size: .75rem; font-weight: 700; }
.status { margin-top: .9rem; min-height: 1.7rem; font-size: .88rem; color: var(--ink-2); }
.status b { color: var(--ink); }
.status .linklike { margin-left: .4rem; }
.status.is-empty { padding: .75rem .9rem; border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--accent) 6%, transparent); }

.themes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; }
.theme { display: grid; gap: .35rem; justify-items: center; padding: .3rem; border: 0; border-radius: 14px; background: transparent; color: var(--ink-2); font-size: .72rem; font-weight: 600; }
.theme__sw { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 12px; background: var(--sw); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .16); transition: transform .2s var(--ease), box-shadow .2s; }
.theme__sw::before { content: 'Aa'; color: var(--ink); font: italic 700 1.25rem/1 var(--serif); }
.theme__sw i { position: absolute; left: 50%; bottom: 17%; width: 34%; height: 4px; border-radius: 2px; background: var(--dot); transform: translateX(-50%); }
.theme:hover .theme__sw { transform: translateY(-2px); }
.theme[aria-checked="true"] { color: var(--ink); }
.theme[aria-checked="true"] .theme__sw { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }

.formats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.format { display: grid; justify-items: center; align-content: start; gap: .25rem; min-height: 96px; padding: .65rem .3rem .55rem; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--ink-2); transition: border-color .2s, background .2s; }
.format:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.format__shape { width: calc(30px * var(--w) / var(--h)); height: 30px; margin-bottom: .2rem; border: 2px solid currentColor; border-radius: 5px; opacity: .8; }
.format__name { font-size: .85rem; font-weight: 700; color: var(--ink); }
.format__hint { font-size: .72rem; color: var(--ink-3); }
.format[aria-checked="true"] { border-color: color-mix(in srgb, var(--accent) 75%, transparent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.format[aria-checked="true"] .format__shape { color: var(--accent); opacity: 1; }

.switches { display: grid; gap: .3rem; margin: 1rem 0; }
.switch { position: relative; display: flex; align-items: center; gap: .7rem; min-height: 44px; cursor: pointer; font-weight: 500; color: var(--ink-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__box { position: relative; flex: none; width: 44px; height: 26px; border-radius: 999px; background: rgb(255 255 255 / .16); transition: background .2s; }
.switch__box::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.switch input:checked + .switch__box { background: var(--accent); }
.switch input:checked + .switch__box::after { transform: translateX(18px); background: #1a1204; }
.switch input:focus-visible + .switch__box { outline: 3px solid var(--accent); outline-offset: 3px; }

.actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.actions--small { margin-top: .9rem; }
.subtle { margin: 1rem 0 .5rem; }
.networks { display: flex; flex-wrap: wrap; gap: .5rem; }
.net { display: inline-flex; align-items: center; min-height: 44px; padding: .3rem 1.05rem; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink); font-size: .9rem; font-weight: 600; text-decoration: none; transition: border-color .2s, transform .15s var(--ease); }
.net:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--ink); }
.net:active { transform: scale(.97); }

/* ───────── A API ───────── */
.api { margin-top: 3.2rem; padding-top: 2.2rem; border-top: 1px solid var(--line); }
.api__title { margin-top: .35rem; font: 800 clamp(1.5rem, 3.4vw, 2.1rem)/1.15 var(--font); letter-spacing: -.02em; }
.api__head { max-width: 66ch; margin-bottom: 1.4rem; }
.api__main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.api__sub { margin: 2rem 0 .8rem; font: 700 1.1rem/1.2 var(--font); }
.try, .code { min-width: 0; padding: 1.15rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.try { display: grid; grid-template-columns: minmax(0, 1fr); gap: .8rem; align-content: start; }
.try__title { font: 700 1.05rem/1.2 var(--font); }
.try__params { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .55rem; }
.try__params .field { min-height: 56px; padding: .35rem .7rem 0; flex-direction: column; align-items: stretch; gap: 0; }
.try__params .field__label { margin: 0; font-size: .72rem; }
.try__params .field input, .try__params .field select { min-height: 30px; font-size: .9rem; }
.try__url { display: flex; align-items: center; gap: .3rem; padding: .35rem .35rem .35rem .8rem; border: 1px solid var(--line); border-radius: 12px; background: #0a0805; }
.try__url code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font-size: .82rem; color: var(--ink-2); scrollbar-width: thin; }
.try__out { display: grid; gap: .6rem; }
.try__meta { font-size: .85rem; color: var(--ink-2); }
.try__meta b.ok { color: #86efac; }
.try__meta b.err { color: var(--bad); }
.try__body, .code__pre { margin: 0; padding: .9rem 1rem; max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: #0a0805; font: 500 .82rem/1.65 var(--mono); color: #e8dccb; white-space: pre; tab-size: 4; scrollbar-width: thin; }
.try__img { display: block; width: 100%; max-height: 360px; object-fit: contain; border-radius: 12px; background: #0a0805; }

.code { display: grid; grid-template-columns: minmax(0, 1fr); gap: .7rem; align-content: start; }
.code__tabs { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.code__tabs button[role="tab"] { min-height: 40px; padding: .2rem .85rem; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--ink-2); font-weight: 600; font-size: .85rem; }
.code__tabs button[role="tab"][aria-selected="true"] { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--ink); }
.code__copy { margin-left: auto; }
.code__pre { max-height: 420px; white-space: pre-wrap; overflow-wrap: anywhere; } /* o exemplo quebra a linha: a URL inteira fica à vista */
.code__note { font-size: .8rem; color: var(--ink-3); }

.endpoints { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.endpoint { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .2rem .8rem; padding: .8rem 1rem; }
.endpoint + .endpoint { border-top: 1px solid var(--line); }
.method { padding: .1rem .5rem; border-radius: 6px; background: rgb(134 239 172 / .15); color: #86efac; font: 700 .72rem/1.6 var(--mono); }
.endpoint__path { min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
.endpoint__text { grid-column: 2; font-size: .86rem; color: var(--ink-2); }
.endpoint__try { grid-column: 3; grid-row: 1 / span 2; }
.params { margin-top: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.params summary { display: flex; align-items: center; min-height: 48px; padding: 0 1rem; font-weight: 700; cursor: pointer; }
.table-wrap { overflow-x: auto; padding: 0 1rem 1rem; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { padding: .55rem .6rem; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { border-top: 0; color: var(--ink-3); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }
tbody th { white-space: nowrap; font-weight: 600; }
td:nth-child(2) { min-width: 9rem; color: var(--ink-2); }
.rules { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin-top: 1rem; }
.rule { padding: 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.rule h3 { margin-bottom: .5rem; font: 700 1rem/1.2 var(--font); }
.rule p { font-size: .88rem; color: var(--ink-2); }
.rule p + p { margin-top: .6rem; }
.rule code { color: var(--ink); }
.wrap .usage { margin-top: 2.4rem; }

/* ───────── Rodapé, avisos e diálogos ───────── */
.foot { padding: 1.4rem clamp(.9rem, 3vw, 1.6rem) max(1.6rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); text-align: center; font-size: .85rem; color: var(--ink-3); }
.foot p + p { margin-top: .4rem; }
.foot a { color: var(--ink-2); }

.toasts { position: fixed; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 400; display: grid; gap: .5rem; width: min(440px, calc(100% - 1.6rem)); transform: translateX(-50%); pointer-events: none; }
.toast { padding: .7rem 1rem; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; background: #241b11; box-shadow: 0 16px 40px -16px #000; font-size: .9rem; animation: toast-in .3s var(--ease) both; }
.toast--err { border-left-color: #f87171; }
.toast.is-out { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

.dlg { width: min(520px, calc(100% - 1.6rem)); max-height: calc(100dvh - 1.6rem); padding: 0; border: 1px solid var(--line); border-radius: 22px; background: #17110b; color: var(--ink); box-shadow: 0 40px 100px -30px #000; }
.dlg--wide { width: min(640px, calc(100% - 1.6rem)); }
.dlg::backdrop { background: rgb(0 0 0 / .62); backdrop-filter: blur(5px); }
.dlg[open] { animation: dlg-in .3s var(--ease); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.dlg__box { padding: 1.2rem 1.3rem 1.3rem; }
.dlg__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.dlg__head h2 { font: 800 1.25rem/1.2 var(--font); }
.dlg__lead { margin-bottom: .8rem; color: var(--ink-2); }
.dlg__sub { margin: 1.1rem 0 .5rem; font: 700 .95rem/1.2 var(--font); }
.dlg__area { width: 100%; padding: .8rem; border: 1px solid var(--line); border-radius: 12px; background: #0a0805; color: var(--ink); resize: vertical; }
.dlg__fine { margin-top: .9rem; font-size: .82rem; color: var(--ink-3); }
.dlg__foot { display: flex; justify-content: flex-end; margin-top: 1rem; }
.steps { display: grid; gap: .7rem; padding-left: 1.2rem; list-style: decimal; color: var(--ink-2); }
.steps li::marker { color: var(--accent); font-weight: 700; }
.steps b { color: var(--ink); }
.keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .45rem .8rem; }
.keys > div { display: flex; align-items: center; gap: .6rem; font-size: .88rem; color: var(--ink-2); }
.keys dt { flex: none; min-width: 3.6rem; }
.favs { display: grid; gap: .6rem; max-height: min(60vh, 460px); overflow: auto; }
.fav { display: grid; gap: .35rem; padding: .8rem .9rem; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.fav__text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font: italic 700 1rem/1.4 var(--serif); }
.fav__author { font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.fav__actions { display: flex; gap: .5rem; margin-top: .2rem; }
.empty { display: grid; justify-items: center; gap: .3rem; padding: 1.4rem 1rem; text-align: center; color: var(--ink-2); }
.empty__icon { width: 2.4rem; height: 2.4rem; color: #fb7185; opacity: .8; }

/* ───────── Telas pequenas ───────── */
/* o texto de abertura vem antes do cartão: os filhos de .panels viram itens da grade do .studio e o .lead passa na frente */
@media (max-width: 999px) {
	.panels { display: contents; }
	.lead { order: -1; }
}
@media (max-width: 519px) {
	.pill { width: 44px; padding: 0; justify-content: center; }
	.pill span { display: none; }
	.btn { white-space: nowrap; }
	.btn--lg { padding-inline: .8rem; }
	.kbd-hint { display: none; }
	.top__tools { gap: .3rem; }
}

@media (max-width: 359px) {
	.stage__actions { grid-template-columns: minmax(0, 1fr); }
	.themes { gap: .15rem; }
	.panel { padding: 1rem .85rem 1.1rem; }
}

/* ───────── Telas maiores ───────── */
@media (min-width: 520px) {
	.stage__actions { grid-template-columns: 1fr 1fr auto; }
	.stage__mini { grid-column: auto; }
	.row2 { grid-template-columns: minmax(0, 1fr) auto; }
}
@media (min-width: 720px) {
	.themes { grid-template-columns: repeat(5, minmax(0, 1fr)); }
	.rules { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
	.api__main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}
@media (min-width: 1000px) {
	.studio { grid-template-columns: minmax(0, 1fr) minmax(0, 470px); gap: 2.4rem; align-items: start; }
	.stage { position: sticky; top: 1rem; }
	.stage__frame { width: min(100%, calc(min(74vh, 800px) * var(--ar))); }
	.row2 { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 1200px) { .row2 { grid-template-columns: minmax(0, 1fr) auto; } }
@media (max-width: 420px) {
	.themes { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .3rem; }
	.theme { padding: .15rem; font-size: .66rem; }
	.formats { gap: .35rem; }
	.format__hint { display: none; }
	.format { min-height: 80px; }
	.endpoint { grid-template-columns: minmax(0, 1fr) auto; }
	.endpoint .method { grid-column: 1; justify-self: start; }
	.endpoint__path, .endpoint__text { grid-column: 1; }
	.endpoint__try { grid-column: 2; grid-row: 1; }
}

/* ───────── Menos movimento ───────── */
html[data-motion="reduced"] .bg i, html[data-motion="reduced"] .sk { animation: none; }
html[data-motion="reduced"] .stage__frame, html[data-motion="reduced"] .stage__frame.is-swap canvas, html[data-motion="reduced"] .toast, html[data-motion="reduced"] .dlg[open] { animation: none; transition: none; }
html[data-motion="reduced"] { scroll-behavior: auto; }
@media (prefers-reduced-motion: reduce) {
	.bg i, .sk, .stage__frame.is-swap canvas, .toast, .dlg[open] { animation: none; }
	.stage__frame { transition: none; }
	html { scroll-behavior: auto; }
}
