/* Rec Wave — interface em preto e verde, com ondas como motivo.
   Telas públicas são sempre escuras; a área logada aceita tema escuro ou claro (data-theme). */

@font-face { font-family: "Bricolage Grotesque"; src: url("../fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../fonts/figtree-latin-wght-normal.woff2") format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; }

/* ---------- Tokens ---------- */
:root, :root[data-theme="dark"], [data-theme="dark"].theme-preview {
	color-scheme: dark;
	--bg: #02100c;
	--bg-soft: #061811;
	--surface: #0a1d15;
	--surface-2: #0e281d;
	--line: #16332a;
	--line-strong: #20503e;
	--text: #d7e8de;
	--heading: #f1fbf5;
	--muted: #93ae9f;
	--faint: #5f7d6d;
	--accent: #3ddc97;
	--accent-strong: #2fc384;
	--on-accent: #03140d;
	--accent-soft: rgba(61, 220, 151, .12);
	--accent-line: rgba(61, 220, 151, .5);
	--warn: #f0c56a; --warn-bg: rgba(240, 197, 106, .1); --warn-line: rgba(240, 197, 106, .38);
	--danger: #ff938c; --danger-bg: rgba(255, 120, 110, .1); --danger-line: rgba(255, 120, 110, .4);
	--shadow: 0 18px 48px rgba(0, 0, 0, .45);
	--font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
	--font-body: "Figtree", "Segoe UI", system-ui, sans-serif;
	--r-s: 8px; --r-m: 12px; --r-l: 20px;
	--gutter: clamp(1.25rem, 4.5vw, 4rem);
}

:root[data-theme="light"], [data-theme="light"].theme-preview {
	color-scheme: light;
	--bg: #eff6f2;
	--bg-soft: #e6f0ea;
	--surface: #ffffff;
	--surface-2: #f4f9f6;
	--line: #d3e2d9;
	--line-strong: #b4cfc0;
	--text: #1b3025;
	--heading: #08170f;
	--muted: #53705f;
	--faint: #7d9988;
	--accent: #0d7f50;
	--accent-strong: #0a6b43;
	--on-accent: #ffffff;
	--accent-soft: rgba(13, 127, 80, .1);
	--accent-line: rgba(13, 127, 80, .42);
	--warn: #8a5d0a; --warn-bg: #fff6df; --warn-line: #ecd28f;
	--danger: #a32a24; --danger-bg: #fdecea; --danger-line: #f0b9b4;
	--shadow: 0 14px 40px rgba(8, 23, 15, .09);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 400 1rem/1.6 var(--font-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; color: var(--heading); font-family: var(--font-display); font-weight: 750; letter-spacing: -.03em; line-height: 1.05; text-wrap: balance; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { color: var(--heading); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--on-accent); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: .6rem 1rem; background: var(--accent); color: var(--on-accent); border-radius: var(--r-s); font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 1rem; }
.muted { color: var(--muted); }
.icon { flex: none; }

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--heading); font: 700 1.15rem/1 var(--font-display); letter-spacing: -.02em; text-decoration: none; }
.brand:hover { color: var(--heading); }
.brand-mark { color: var(--accent); }

/* ---------- Botões ---------- */
.btn, .button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.9rem; padding: .7rem 1.25rem; border: 1px solid transparent; border-radius: var(--r-m); background: linear-gradient(180deg, var(--accent), var(--accent-strong)); color: var(--on-accent); font: 700 .95rem/1.1 var(--font-body); text-decoration: none; cursor: pointer; transition: filter .15s, border-color .15s, background-color .15s; }
.btn:hover, .button:hover { filter: brightness(1.08); color: var(--on-accent); }
.btn:active, .button:active { filter: brightness(.95); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--heading); }
.btn-ghost:hover { background: var(--accent-soft); border-color: var(--accent-line); color: var(--heading); filter: none; }
.btn-block { width: 100%; }
.btn-sm { min-height: 2.2rem; padding: .45rem .85rem; font-size: .85rem; border-radius: 10px; }
.btn[disabled], .button[disabled] { opacity: .7; cursor: progress; }
.danger-button { background: transparent; border-color: var(--danger-line); color: var(--danger); }
.danger-button:hover { background: var(--danger-bg); color: var(--danger); }

/* ---------- Formulários ---------- */
.field { display: block; margin-bottom: 1.15rem; }
.field > label { display: block; margin-bottom: .45rem; color: var(--heading); font-size: .88rem; font-weight: 650; }
input, select, textarea { width: 100%; min-height: 2.9rem; padding: .7rem .95rem; border: 1px solid var(--line-strong); border-radius: var(--r-m); background: var(--bg-soft); color: var(--heading); font: inherit; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--accent-line); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-wrap { position: relative; }
.input-wrap input { padding-right: 3rem; }
.reveal { display: none; position: absolute; right: .35rem; top: 50%; width: 2.3rem; height: 2.3rem; margin-top: -1.15rem; align-items: center; justify-content: center; border: 0; border-radius: var(--r-s); background: transparent; color: var(--muted); cursor: pointer; }
.js .reveal { display: inline-flex; }
.reveal:hover { color: var(--heading); }
.reveal .i-off, .reveal.is-on .i-on { display: none; }
.reveal.is-on .i-off { display: inline; }
.hint { margin-top: .5rem; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; margin-top: .6rem; }
.meter i { height: 3px; border-radius: 3px; background: var(--line-strong); transition: background-color .2s; }
.meter[data-level="1"] i:nth-child(-n+1) { background: var(--danger); }
.meter[data-level="2"] i:nth-child(-n+2) { background: var(--warn); }
.meter[data-level="3"] i:nth-child(-n+3), .meter[data-level="4"] i { background: var(--accent); }
.code-input { text-align: center; font: 700 1.9rem/1 var(--font-display); letter-spacing: .6em; padding-left: calc(.95rem + .6em); min-height: 3.6rem; }
.form-foot { margin-top: 1.5rem; color: var(--muted); font-size: .92rem; }

/* ---------- Avisos e selos ---------- */
.alert { display: flex; gap: .7rem; align-items: flex-start; margin: 0 0 1.35rem; padding: .8rem 1rem; border: 1px solid var(--line-strong); border-radius: var(--r-m); font-size: .92rem; line-height: 1.5; }
.alert .icon { margin-top: .12rem; }
.alert-error { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }
.alert-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.alert-success { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.alert a { color: inherit; font-weight: 700; }
.pill { display: inline-flex; align-items: center; gap: .45rem; padding: .22rem .7rem; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: .75rem; font-weight: 700; }
.pill::before { content: ""; width: .4rem; height: .4rem; border-radius: 50%; background: currentColor; }
.pill.success { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.pill.pending { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.pill.danger { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }

/* ---------- Ondas ---------- */
.waves { position: absolute; inset: auto 0 0 0; overflow: hidden; pointer-events: none; }
.waves svg { display: block; width: 100%; min-width: 900px; height: 100%; }
.waves svg { color: var(--accent); }
.wave-fill { stroke: none; }
.wave-a .wave-fill { opacity: .55; } .wave-b .wave-fill { opacity: .7; }
.wave-line { fill: none; stroke: var(--accent); stroke-width: 1.2; }
.wave-a .wave-line { opacity: .3; } .wave-b .wave-line { opacity: .5; } .wave-c .wave-line { opacity: .85; stroke-width: 1.6; }
.wave { animation: drift 160s linear infinite; }
.wave-b { animation-duration: 110s; animation-direction: reverse; }
.wave-c { animation-duration: 75s; }
@keyframes drift { to { transform: translateX(-1440px); } }

.track { display: block; overflow: visible; }
.track .seg { fill: none; stroke-width: 1.4; stroke-linecap: round; }
.track .seg-done { stroke: var(--accent); } .track .seg-todo { stroke: var(--line-strong); }
.track .node { stroke-width: 1.4; }
.track .node-done { fill: var(--accent); stroke: var(--accent); }
.track .node-current { fill: var(--accent); stroke: var(--accent); filter: drop-shadow(0 0 4px var(--accent)); }
.track .node-todo { fill: var(--bg); stroke: var(--line-strong); }
.track-failed .node, .track-failed .seg { stroke: var(--danger); fill: none; }
.track-expired .node, .track-expired .seg { stroke: var(--faint); fill: none; stroke-dasharray: 2 2; }

/* ---------- Cabeçalho e rodapé públicos ---------- */
.site-header { position: absolute; z-index: 5; inset: 0 0 auto 0; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.4rem var(--gutter); }
.site-nav { display: flex; align-items: center; gap: 1.75rem; }
.site-nav a:not(.btn) { color: var(--muted); font-size: .92rem; font-weight: 600; text-decoration: none; }
.site-nav a:not(.btn):hover { color: var(--heading); }
.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1.75rem var(--gutter); border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }

/* ---------- Página inicial ---------- */
.hero { position: relative; display: flex; align-items: center; min-height: min(100svh, 56rem); padding: 7rem var(--gutter) 6rem; overflow: hidden; }
.hero .waves { height: 48%; }
.hero-copy { position: relative; z-index: 2; max-width: 80rem; width: 100%; margin: 0 auto; }
.hero h1 { max-width: 16ch; font-size: clamp(2.9rem, 6.4vw, 6.4rem); font-weight: 780; letter-spacing: -.045em; line-height: .95; }
.hero p { max-width: 36rem; margin-top: 1.75rem; text-wrap: pretty; color: var(--text); font-size: clamp(1.02rem, 1.5vw, 1.2rem); line-height: 1.65; }
.hero .actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.section { padding: clamp(4rem, 9vw, 7.5rem) var(--gutter); border-top: 1px solid var(--line); }
.section-inner { max-width: 68rem; margin: 0 auto; }
.section h2 { max-width: 14ch; font-size: clamp(2.1rem, 4.6vw, 3.6rem); }
.section .lead { max-width: 36rem; margin-top: 1.25rem; color: var(--muted); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }

.route { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); margin: 3.25rem 0 0; padding: 0; }
.route li { position: relative; padding-right: 1.25rem; }
.route-node { display: block; width: 12px; height: 12px; border: 1.5px solid var(--accent-line); border-radius: 50%; background: var(--bg); }
.route li:last-child .route-node { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.route-link { position: absolute; top: 5px; left: 12px; right: 0; height: 1px; background: var(--line-strong); }
.route-link.is-wave { top: -1px; height: 14px; background: none; }
.route-link svg { display: block; width: 100%; height: 100%; }
.route-link path { fill: none; stroke: var(--accent); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.route-link .wv-v { display: none; }
.route strong { display: block; margin-top: 1rem; color: var(--heading); font: 700 1rem/1.2 var(--font-display); }
.route span:not(.route-node):not(.route-link) { display: block; margin-top: .45rem; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.aside-note { max-width: 36rem; margin-top: 2.75rem; padding-left: 1.1rem; border-left: 2px solid var(--accent-line); color: var(--muted); font-size: .95rem; }

.states { list-style: none; margin: 2.75rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.states li { display: grid; grid-template-columns: 8.5rem 13rem 1fr; gap: 1.5rem; align-items: center; padding: 1.3rem 0; border-bottom: 1px solid var(--line); }
.states strong { color: var(--heading); font: 700 1rem/1.25 var(--font-display); }
.states span { color: var(--muted); font-size: .94rem; }
.section .after { max-width: 40rem; margin-top: 1.75rem; color: var(--muted); }
.section .after b { color: var(--heading); }

.levels { margin: 0; padding: 0; list-style: none; }
.levels li { padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.levels li:first-child { padding-top: 0; }
.levels strong { display: block; color: var(--heading); font: 700 1.1rem/1.2 var(--font-display); }
.levels span { display: block; margin-top: .25rem; color: var(--muted); font-size: .94rem; }

.status-card { padding: clamp(1.5rem, 3vw, 2.25rem); border: 1px solid var(--line); border-radius: var(--r-l); background: linear-gradient(160deg, var(--surface-2), var(--surface)); }
.status-card h3 { font-size: 1.15rem; }
.status-card h3:not(:first-child) { margin-top: 2rem; }
.status-card ul { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .75rem; }
.status-card li { display: flex; gap: .7rem; align-items: flex-start; color: var(--text); font-size: .94rem; line-height: 1.45; }
.status-card li .icon { margin-top: .15rem; color: var(--accent); }
.status-card .building .icon { color: var(--warn); }
.cta { text-align: left; }
.cta .actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

/* ---------- Entrada, cadastro e confirmação ---------- */
.auth { min-height: 100svh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-art { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 3rem; padding: 3.25rem clamp(2rem, 4.5vw, 3.75rem); border-right: 1px solid var(--line); overflow: hidden; }
.auth-art .waves { height: 46%; inset: auto 0 20% 0; }
.auth-copy { position: relative; z-index: 1; max-width: 30rem; }
.auth-copy h2 { font-size: clamp(2.3rem, 3.6vw, 3.4rem); font-weight: 780; letter-spacing: -.04em; line-height: 1; }
.auth-copy p { margin-top: 1.1rem; color: var(--muted); }
.auth-art .brand { position: relative; z-index: 1; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 3rem 2rem; }
.auth-card { width: 100%; max-width: 26.5rem; }
.auth-card h1 { font-size: 2.3rem; font-weight: 780; letter-spacing: -.04em; }
.auth-card .lead { margin: .8rem 0 1.9rem; color: var(--muted); }
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin: 0 0 2.4rem; padding: 0; }
.steps li { padding-top: .6rem; border-top: 3px solid var(--line-strong); border-radius: 3px; color: var(--faint); font-size: .76rem; font-weight: 700; }
.steps li.is-done { border-color: var(--accent-line); color: var(--muted); }
.steps li.is-current { border-color: var(--accent); color: var(--heading); }
.seal { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; margin-bottom: 1.4rem; border: 1px solid var(--accent-line); border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.checklist { list-style: none; margin: 1.75rem 0 2rem; padding: 0; border-top: 1px solid var(--line); }
.checklist li { display: flex; align-items: center; gap: .8rem; padding: .95rem 0; border-bottom: 1px solid var(--line); color: var(--heading); font-weight: 600; font-size: .95rem; }
.checklist .icon { color: var(--accent); }
.checklist li.waiting { color: var(--muted); font-weight: 500; }
.checklist li.waiting .icon { color: var(--warn); }
.stack { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------- Páginas de erro ---------- */
.err { min-height: 100svh; display: grid; place-items: center; padding: 3rem var(--gutter); }
.err-inner { width: 100%; max-width: 31rem; }
.err-code { margin-top: 3rem; color: var(--accent); font: 800 clamp(5.5rem, 17vw, 9rem)/.85 var(--font-display); letter-spacing: -.06em; }
.err h1 { margin-top: 1.5rem; font-size: clamp(1.8rem, 4vw, 2.3rem); font-weight: 750; }
.err p.err-text { margin-top: .9rem; color: var(--muted); }
.err .stack { margin-top: 1.75rem; }
.err-debug { margin-top: 1.5rem; padding: .8rem 1rem; border: 1px dashed var(--line-strong); border-radius: var(--r-m); color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.signal { display: block; width: 100%; max-width: 31rem; height: 2.5rem; margin-top: 3rem; color: var(--faint); }
.signal path { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: .1 9; }
.signal-end { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.signal-jag path { stroke: var(--danger); }

/* ---------- Estrutura da área logada ---------- */
.shell { display: grid; grid-template-columns: 16rem minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2rem; padding: 1.5rem 1rem 1.25rem; border-right: 1px solid var(--line); background: var(--bg); }
.sidebar .brand { padding: 0 .5rem; }
.side-nav { display: grid; gap: .3rem; }
.side-link { display: flex; align-items: center; gap: .75rem; padding: .65rem .8rem; border: 1px solid transparent; border-radius: var(--r-m); color: var(--muted); font-size: .94rem; font-weight: 600; text-decoration: none; transition: background-color .15s, color .15s; }
.side-link:hover { background: var(--accent-soft); color: var(--heading); }
.side-link.is-active { border-color: var(--accent-line); background: var(--accent-soft); color: var(--heading); }
.side-link.is-active .icon { color: var(--accent); }
.badge { margin-left: auto; min-width: 1.35rem; padding: .05rem .4rem; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: .72rem; font-weight: 800; line-height: 1.35; text-align: center; }
.side-user { display: grid; gap: .15rem; margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); }
.side-user strong { color: var(--heading); font-size: .9rem; }
.side-user span { margin-bottom: .75rem; color: var(--muted); font-size: .82rem; }
.shell-main { min-width: 0; padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1.25rem, 4vw, 3.5rem) 4rem; }
.page { max-width: 68rem; }
.page h1 { font-size: clamp(2.1rem, 4vw, 3rem); font-weight: 780; letter-spacing: -.04em; }

/* ---------- Área logada: páginas e componentes ---------- */
.page-head { margin-bottom: 1.75rem; }
.page-sub { max-width: 40rem; margin-top: .65rem; color: var(--muted); }
.page h2 { font-size: 1.2rem; }
.section-title { margin: 2.5rem 0 1rem; }
.note { max-width: 40rem; margin-top: 1.5rem; padding-left: 1.1rem; border-left: 2px solid var(--accent-line); color: var(--muted); font-size: .92rem; }
.card { position: relative; padding: clamp(1.25rem, 2.6vw, 1.75rem); border: 1px solid var(--line); border-radius: var(--r-l); background: linear-gradient(160deg, var(--surface-2), var(--surface)); }
.page .card-title { margin-bottom: 1rem; font-size: 1.1rem; }
.empty { display: grid; gap: .6rem; justify-items: start; }
.empty h2 { font-size: 1.15rem; }
.empty p { max-width: 34rem; }
.empty .btn { margin-top: .5rem; }

/* Onda decorativa dos cartões (estática). */
.card-wave { position: absolute; right: 0; bottom: 0; display: block; width: min(26rem, 70%); height: 7rem; color: var(--accent); pointer-events: none; }
.card-wave .cw-fill { fill: var(--accent); opacity: .08; stroke: none; }
.card-wave .cw-line { fill: none; stroke: var(--accent); stroke-width: 1.4; opacity: .7; vector-effect: non-scaling-stroke; }
.card-wave .cw-soft { opacity: .3; }

/* Painel */
.dash { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 1rem; }
.dash-wide { grid-column: 1 / -1; }
.dash-main { display: flex; flex-direction: column; align-items: flex-start; min-height: 18rem; overflow: hidden; }
.dash-main.has-pending { border-color: var(--accent-line); }
.dash-main > :not(.card-wave) { position: relative; z-index: 1; }
.dash-main .card-wave { width: min(30rem, 64%); height: 10rem; }
.dash-main p:not(.big-number) { max-width: 22rem; color: var(--text); }
.dash-main .btn { margin-top: 1.4rem; }
.big-number { margin: .5rem 0 .6rem; color: var(--muted); font: 800 clamp(4.5rem, 10vw, 7rem)/.9 var(--font-display); letter-spacing: -.05em; }
.has-pending .big-number { color: var(--accent); }
.stat-list { display: grid; margin: 0; }
.stat-list > div { display: flex; justify-content: space-between; align-items: baseline; padding: .95rem 0; border-bottom: 1px solid var(--line); }
.stat-list > div:first-child { padding-top: 0; }
.stat-list > div:last-child { padding-bottom: 0; border-bottom: 0; }
.stat-list dt { color: var(--muted); }
.stat-list dd { margin: 0; color: var(--heading); font: 750 1.75rem/1 var(--font-display); }

/* Tabelas (viram cartões no celular) */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-l); background: linear-gradient(160deg, var(--surface-2), var(--surface)); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.data-table th { color: var(--muted); font-size: .8rem; font-weight: 700; }
.data-table tr:last-child td { border-bottom: 0; }
.who strong { display: block; color: var(--heading); font-weight: 700; }
.who span { display: block; color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.cell-date { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.reason { max-width: 22rem; margin-top: .45rem; color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.row-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row-actions form { margin: 0; }
.reject-toggle, .reject-cancel { display: none; }
.js .reject-toggle, .js .reject-cancel { display: inline-flex; }
.reject-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.reject-form input[name="reason"] { width: 14rem; min-height: 2.2rem; padding: .35rem .7rem; font-size: .85rem; }
.js .reject-form { display: none; }
.js .is-rejecting .reject-form { display: flex; animation: reveal-in .18s ease-out; }
.js .is-rejecting .approve-form, .js .is-rejecting .reject-toggle { display: none; }
@keyframes reveal-in { from { opacity: 0; transform: translateY(-3px); } }

/* Permissões e configurações */
.permission-form, .settings-form { max-width: 44rem; }
.perm-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.settings-group { min-width: 0; margin: 0 0 1.5rem; padding: 0; border: 0; }
.settings-group legend { margin-bottom: .75rem; padding: 0; color: var(--heading); font: 700 1.05rem/1.2 var(--font-display); }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.choice-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice { position: relative; display: block; margin: 0; cursor: pointer; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; border: 0; opacity: 0; appearance: none; cursor: pointer; }
.choice-body { display: flex; flex-direction: column; gap: .7rem; height: 100%; padding: 1rem; border: 1px solid var(--line-strong); border-radius: var(--r-m); background: var(--bg-soft); transition: border-color .15s, background-color .15s; }
.choice:hover .choice-body { border-color: var(--accent-line); }
.choice input:checked + .choice-body { border-color: var(--accent); background: var(--accent-soft); }
.choice input:focus-visible + .choice-body { outline: 2px solid var(--accent); outline-offset: 3px; }
.choice-title { display: flex; justify-content: space-between; align-items: center; gap: .5rem; color: var(--heading); font-weight: 650; }
.choice-check { display: grid; place-items: center; flex: none; width: 1.25rem; height: 1.25rem; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--on-accent); }
.choice-check .icon { opacity: 0; }
.choice input:checked + .choice-body .choice-check { border-color: var(--accent); background: var(--accent); }
.choice input:checked + .choice-body .choice-check .icon { opacity: 1; }
.choice-desc { color: var(--muted); font-size: .86rem; line-height: 1.45; }
.theme-preview { display: flex; flex-direction: column; justify-content: center; gap: .4rem; height: 4rem; padding: .6rem .8rem; border: 1px solid var(--line-strong); border-radius: var(--r-s); background: var(--bg); }
.theme-preview i { display: block; height: .4rem; border-radius: 3px; background: var(--line-strong); }
.theme-preview i:nth-child(1) { width: 38%; background: var(--accent); }
.theme-preview i:nth-child(2) { width: 82%; background: var(--heading); opacity: .75; }
.theme-preview i:nth-child(3) { width: 60%; }

/* Zonas */
.zone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 1rem; }
.zone-card { display: flex; flex-direction: column; align-items: flex-start; min-height: 15rem; overflow: hidden; }
.zone-card > :not(.card-wave) { position: relative; z-index: 1; }
.zone-card.available:hover { border-color: var(--accent-line); }
.zone-card.unavailable { border-style: dashed; background: none; }
.zone-top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; width: 100%; }
.zone-level { color: var(--muted); font-size: .85rem; font-weight: 600; }
.zone-lock { display: grid; place-items: center; color: var(--muted); }
.zone-card h2 { margin: 1.1rem 0 .35rem; font-size: 1.35rem; }
.zone-desc, .zone-ask { max-width: 24rem; color: var(--muted); font-size: .94rem; }
.zone-action { margin-top: auto; align-self: flex-start; }
.zone-card.available .zone-desc { margin-bottom: 1.75rem; }
.zone-card.unavailable .zone-ask { margin-top: .85rem; color: var(--text); }

/* Chat da zona */
.back-link { display: inline-flex; align-items: center; gap: .4rem; margin-bottom: 1.1rem; color: var(--muted); font-size: .9rem; font-weight: 600; text-decoration: none; }
.back-link:hover { color: var(--heading); }
.chat-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.chat { display: flex; flex-direction: column; height: clamp(28rem, calc(100svh - 24rem), 46rem); padding: 0; overflow: hidden; }
.chat-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.25rem; border-bottom: 1px solid var(--line); }
.chat-bar h2 { font-size: 1.05rem; }
.chat-bar span { color: var(--muted); font-size: .85rem; }
.message-list { display: flex; flex: 1; flex-direction: column; gap: .85rem; min-height: 0; margin: 0; padding: 1.25rem; list-style: none; overflow-y: auto; overscroll-behavior: contain; }
.msg { align-self: flex-start; width: fit-content; max-width: min(34rem, 88%); padding: .8rem 1rem; border: 1px solid var(--line-strong); border-radius: var(--r-m); background: var(--bg-soft); }
.msg-me { align-self: flex-end; border-color: var(--accent-line); background: var(--accent-soft); }
.msg-in { border-color: var(--line-strong); border-left: 3px solid var(--accent); }
.msg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .7rem; }
.msg-head strong { color: var(--heading); font-size: .9rem; }
.msg-head time { color: var(--muted); font-size: .78rem; }
.msg-text { margin: .45rem 0 .75rem; color: var(--heading); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-state { display: flex; align-items: center; gap: .7rem; color: var(--muted); font-size: .8rem; font-weight: 600; }
.msg-failed { border-color: var(--danger-line); background: var(--danger-bg); }
.msg-failed .msg-state { color: var(--danger); }
.msg-expired .msg-state { color: var(--faint); }
.chat-empty { margin: auto; max-width: 22rem; text-align: center; }
.chat-empty strong { color: var(--heading); font: 700 1.05rem/1.3 var(--font-display); }
.chat-empty p { margin-top: .4rem; }
.composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem .75rem; align-items: end; padding: 1rem 1.25rem; border-top: 1px solid var(--line); background: var(--surface); }
.composer textarea { min-height: 2.9rem; max-height: 8rem; resize: none; line-height: 1.45; }
.composer .counter { display: none; grid-column: 1 / -1; color: var(--muted); font-size: .78rem; text-align: right; }
.js .composer .counter { display: block; }
.composer .counter.is-near { color: var(--warn); }
.composer-lock { display: flex; align-items: center; gap: .6rem; margin: 0; padding: 1rem 1.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; }

/* ---------- LGPD: aceite, links legais, aviso de cookies ---------- */
.consent { display: flex; gap: .65rem; align-items: flex-start; margin: .25rem 0 .5rem; color: var(--text); font-size: .9rem; line-height: 1.5; cursor: pointer; }
.consent input { flex: none; width: 1.1rem; min-height: 0; height: 1.1rem; margin: .18rem 0 0; padding: 0; accent-color: var(--accent); }
.consent-hint { margin: 0 0 1.25rem; }
.legal-links { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin-top: 1rem; font-size: .85rem; }
.legal-links a { color: var(--muted); }
.legal-links a:hover { color: var(--heading); }
.site-footer .legal-links { margin-top: 0; }
.side-legal { margin-top: .75rem; font-size: .78rem; }
.cookie-note { position: fixed; z-index: 40; left: 1rem; bottom: 1rem; display: flex; align-items: center; gap: 1rem; max-width: min(34rem, calc(100vw - 2rem)); padding: .9rem 1rem; border: 1px solid var(--line-strong); border-radius: var(--r-m); background: var(--surface); color: var(--text); font-size: .86rem; line-height: 1.5; box-shadow: var(--shadow); }
.cookie-note[hidden] { display: none; }
.cookie-note .btn { flex: none; }

/* ---------- Login com Google ---------- */
.or-divider { display: flex; align-items: center; gap: .9rem; margin: 1.35rem 0; color: var(--faint); font-size: .8rem; font-weight: 600; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn-google { background: #ffffff; border-color: #dadce0; color: #1f1f1f; }
.btn-google:hover { background: #f2f6f4; color: #1f1f1f; filter: none; }
.google-g { flex: none; }
.google-profile { display: grid; gap: 0; margin: 0 0 1.5rem; border-top: 1px solid var(--line); }
.google-profile div { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.google-profile dt { color: var(--muted); font-size: .88rem; }
.google-profile dd { margin: 0; color: var(--heading); font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.google-cancel { margin-top: .75rem; }

/* ---------- LGPD: Política de Privacidade e Termos ---------- */
.legal { max-width: 52rem; margin: 0 auto; padding: 1.5rem var(--gutter) 0; }
.legal-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem 0 2.5rem; }
.legal-config { margin-bottom: 1.5rem; }
.legal-config code, .legal-doc code { font-size: .88em; overflow-wrap: anywhere; }
.legal-meta { color: var(--faint); font-size: .82rem; font-weight: 600; }
.legal-doc { padding-bottom: 4rem; }
.legal-doc h1 { margin-top: .5rem; font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 780; letter-spacing: -.04em; }
.legal-lead { max-width: 42rem; margin-top: 1.1rem; color: var(--muted); font-size: 1.05rem; }
.legal-doc section { margin-top: 2.75rem; scroll-margin-top: 1.5rem; }
.legal-doc h2 { margin-bottom: 1rem; font-size: clamp(1.3rem, 2.6vw, 1.6rem); }
.legal-doc p + p, .legal-doc ul + p, .legal-doc .table-wrap + p { margin-top: .85rem; }
.legal-doc ul { margin: .75rem 0 0; padding-left: 1.2rem; display: grid; gap: .5rem; }
.legal-doc strong { color: var(--heading); }
.legal-toc { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .4rem 1.5rem; margin-top: 2rem; padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); font-size: .9rem; }
.legal-toc a { color: var(--muted); text-decoration: none; }
.legal-toc a:hover { color: var(--accent); }
.legal-facts { display: grid; gap: .1rem; margin: 0 0 1rem; border-top: 1px solid var(--line); }
.legal-facts div { display: grid; grid-template-columns: minmax(10rem, 16rem) 1fr; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.legal-facts dt { color: var(--muted); font-size: .9rem; }
.legal-facts dd { margin: 0; color: var(--heading); overflow-wrap: anywhere; }
.legal-missing { color: var(--warn); font-style: normal; font-weight: 600; }
.legal-table { margin-top: 1rem; border: 1px solid var(--line); border-radius: var(--r-l); overflow-x: auto; }
.legal-table .data-table td { vertical-align: top; font-size: .92rem; }

/* ---------- LGPD: Meus dados ---------- */
.data-card { margin-bottom: 1.25rem; }
.data-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem 1.5rem; margin: 0; }
.data-list dt { color: var(--muted); font-size: .8rem; font-weight: 600; }
.data-list dd { margin: .15rem 0 0; color: var(--heading); overflow-wrap: anywhere; }
.data-sub { margin: 1.75rem 0 .75rem; font-size: 1rem; }
.data-zones { display: grid; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.data-zones li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.data-zones span { color: var(--muted); font-size: .9rem; }
.data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-bottom: 1.25rem; }
.data-action { margin-top: 1.25rem; }
.danger-card { border-color: var(--danger-line); }
.danger-card .muted { margin-bottom: 1.25rem; max-width: 42rem; }
.danger-card .field { max-width: 22rem; }
.danger-card .consent { margin-bottom: 1.25rem; }

@media (max-width: 44rem) {
	.data-grid { grid-template-columns: 1fr; }
	.legal-facts div { grid-template-columns: 1fr; gap: .2rem; }
	.legal-table { border: 0; overflow: visible; }
	.legal-table .data-table td { display: block; }
	.legal-table .data-table td[data-label]::before { display: block; margin-bottom: .2rem; }
	.cookie-note { left: .75rem; right: .75rem; bottom: .75rem; max-width: none; flex-direction: column; align-items: stretch; }
	.danger-card .btn, .data-grid .btn { width: 100%; }
}

/* ---------- Telas menores (área logada) ---------- */
@media (max-width: 56rem) {
	.dash { grid-template-columns: 1fr; }
	.dash-main { min-height: 16rem; }
}
@media (max-width: 44rem) {
	.perm-fields { grid-template-columns: 1fr; }
	.choice-grid.three { grid-template-columns: 1fr; }
	.table-wrap { overflow: visible; border: 0; background: none; }
	.data-table, .data-table tbody, .data-table tr, .data-table td { display: block; }
	.data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.data-table tr { margin-bottom: .75rem; padding: .9rem 1.1rem; border: 1px solid var(--line); border-radius: var(--r-l); background: linear-gradient(160deg, var(--surface-2), var(--surface)); }
	.data-table td { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem 0; border: 0; }
	.data-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .82rem; font-weight: 600; }
	.data-table td.cell-who { display: block; padding-top: 0; }
	.data-table td.cell-actions { display: block; margin-top: .4rem; padding: .85rem 0 0; border-top: 1px solid var(--line); }
	.data-table td.cell-actions.is-empty { display: none; }
	.cell-date { white-space: normal; text-align: right; }
	.cell-status > div { text-align: right; }
	.reason { margin-left: auto; text-align: right; }
	.row-actions > form:not(.reject-form), .row-actions .reject-toggle { flex: 1 1 0; }
	.row-actions .btn { width: 100%; }
	.reject-form, .reject-form input[name="reason"] { width: 100%; }
	.reject-form .btn { flex: 1 1 0; }
	.chat { height: clamp(26rem, calc(100svh - 18rem), 44rem); }
	.msg { max-width: 94%; }
	.composer { grid-template-columns: 1fr; }
	.composer .btn { width: 100%; }
	.composer .counter { order: 3; }
}
@media (max-width: 26rem) {
	.choice-grid { grid-template-columns: 1fr; }
}

/* ---------- Telas menores ---------- */
@media (max-width: 62rem) {
	.states li { grid-template-columns: 8.5rem 1fr; }
	.states li span { grid-column: 1 / -1; }
}
@media (max-width: 56rem) {
	.auth { grid-template-columns: 1fr; }
	.auth-art { flex-direction: row; align-items: center; min-height: 7.5rem; padding: 1.5rem var(--gutter); border-right: 0; border-bottom: 1px solid var(--line); }
	.auth-art .waves { inset: 0; height: 100%; opacity: .7; }
	.auth-copy { display: none; }
	.auth-panel { align-items: flex-start; padding: 2.5rem var(--gutter) 3rem; }
	.split { grid-template-columns: 1fr; }
	.site-nav a:not(.btn) { display: none; }
	.hero { padding-top: 6.5rem; }
	.route { grid-template-columns: 1fr; margin-top: 2.5rem; }
	.route li { padding: 0 0 1.9rem 2rem; }
	.route li:last-child { padding-bottom: 0; }
	.route-node { position: absolute; left: 0; top: .2rem; }
	.route strong { margin-top: 0; }
	.route-link { top: 1.1rem; bottom: -.1rem; left: 5.5px; right: auto; width: 1px; height: auto; }
	.route-link.is-wave { top: 1.1rem; left: 0; width: 12px; height: auto; bottom: -.1rem; }
	.route-link .wv-h { display: none; } .route-link .wv-v { display: block; }
	.states li { grid-template-columns: 1fr; gap: .5rem; }
	.shell { grid-template-columns: 1fr; }
	.sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .9rem 1rem; padding: 1rem var(--gutter) 0; border-right: 0; border-bottom: 1px solid var(--line); }
	.sidebar .brand { padding: 0; }
	.side-user { order: 2; margin: 0 0 0 auto; padding: 0; border: 0; }
	.side-user strong, .side-user span, .side-legal { display: none; }
	.side-nav { order: 3; display: flex; width: 100%; gap: .2rem; overflow-x: auto; padding-bottom: .6rem; scrollbar-width: none; }
	.side-link { white-space: nowrap; }
}
@media (max-width: 30rem) {
	.site-header { padding-top: 1rem; }
	.hero .actions .btn, .cta .actions .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
	.wave { animation: none; }
	* { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
