/* ============================================================
   Chisei — reskin liquid glass. Carregado por ÚLTIMO (vence a cascata).
   FASE 1: login (escopado em .auth-screen) + fontes.
   As telas internas (gated) entram nas próximas fases.
   ============================================================ */

/* fundo escuro + texto claro só nas telas de auth/license */
.auth-screen,
.license-overlay {
  background: radial-gradient(60% 70% at 35% 25%, #34343a, #15151a 50%, #0a0a0b);
  color: #f4f4f6;
}

/* o card vira vidro */
.auth-screen .auth-card,
.license-overlay .license-card {
  background: rgba(20, 22, 28, 0.55);
  -webkit-backdrop-filter: blur(42px) saturate(150%);
  backdrop-filter: blur(42px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.42),
              inset 0 1.5px 0 rgba(255, 255, 255, 0.5),
              inset 0 -1px 1px rgba(0, 0, 0, 0.18);
  color: #f4f4f6;
}

/* tipografia + textos */
.auth-screen .eyebrow,
.license-overlay .eyebrow {
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.14em;
}
.auth-screen .auth-title,
.license-overlay .auth-title {
  font-family: "Poppins", system-ui, sans-serif;
  font-weight: 600;
  color: #ffffff;
}
.auth-screen .auth-sub,
.auth-screen .auth-foot,
.license-overlay .auth-sub,
.license-overlay .auth-foot {
  color: rgba(255, 255, 255, 0.6);
}
.auth-screen .auth-field {
  color: rgba(255, 255, 255, 0.85);
}

/* inputs em vidro */
.auth-screen .auth-field input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  color: #f4f4f6;
}
.auth-screen .auth-field input::placeholder {
  color: rgba(255, 255, 255, 0.34);
}
.auth-screen .auth-field input:focus {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 1px;
}

/* botão primário sólido (branco) — a ação principal Chisei */
.auth-screen .auth-btn,
.license-overlay .auth-btn {
  background: #ffffff;
  color: #0c0c0d;
  border: 0;
  border-radius: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

/* ---- Login split (estilo Aceternity login-and-signup) ---------------------- */
.auth-screen.chisei-login {
  display: flex;
  align-items: stretch;
  place-content: stretch;
  padding: 0;
  min-height: 100vh;
}
.login-visual {
  flex: 1.05;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 60px;
  color: #f4f4f6;
  background:
    radial-gradient(60% 70% at 30% 25%, rgba(60, 90, 200, 0.30), transparent 60%),
    radial-gradient(50% 60% at 82% 82%, rgba(40, 180, 160, 0.18), transparent 60%),
    #0c0c10;
}
.login-brand {
  font-family: "Poppins", system-ui, sans-serif;
  font-weight: 700;
  font-size: 40px;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}
.login-brand span { color: #c8d2ff; }
.login-visual .login-headline {
  color: #f6f6fa;
  font-family: "Poppins", system-ui, sans-serif;
  font-weight: 500;
  font-size: clamp(36px, 4.6vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.04em;
  margin: 20px 0 0;
}
.login-visual .login-headline em {
  font-family: "Source Serif 4", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.78);
}
.login-tag {
  color: rgba(255, 255, 255, 0.6);
  max-width: 440px;
  font-size: 15px;
  line-height: 1.55;
  margin: 16px 0 0;
}
.login-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 24px; }
.login-chips span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 7px 13px;
  border-radius: 999px;
}
.login-form-panel {
  flex: 0.95;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px clamp(40px, 5vw, 72px);
  background: rgba(14, 16, 22, 0.6);
  -webkit-backdrop-filter: blur(30px) saturate(140%);
  backdrop-filter: blur(30px) saturate(140%);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  color: #f4f4f6;
}
.login-form-panel .eyebrow { color: rgba(255, 255, 255, 0.5); letter-spacing: 0.14em; }
.login-form-panel .auth-title { font-family: "Poppins", system-ui, sans-serif; color: #fff; font-size: 30px; }
.login-form-panel .auth-sub { color: rgba(255, 255, 255, 0.6); }
.login-form-panel .auth-foot { color: rgba(255, 255, 255, 0.5); }
.login-form-panel .auth-form { max-width: 380px; }
@media (max-width: 820px) {
  .auth-screen.chisei-login { flex-direction: column; }
  .login-visual { flex: none; min-height: 36vh; padding: 32px; }
  .login-headline { font-size: 34px; }
  .login-form-panel { flex: 1; border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.1); }
}

/* ============================================================
   LOGIN v2 — liquid glass de verdade (.lg/.lgs) + aurora + card flutuante.
   (rules depois das anteriores → vencem por ordem de fonte)
   ============================================================ */
.lg, .lgs {
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.42),
              inset 0 1.6px 0 rgba(255,255,255,.5),
              inset 0 -1.4px 1px rgba(0,0,0,.16);
}
.lg::before, .lgs::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: linear-gradient(150deg, rgba(255,255,255,.66), rgba(255,255,255,.14) 36%, transparent 56%, rgba(255,255,255,.16) 80%, rgba(255,255,255,.62));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.lgs { -webkit-backdrop-filter: blur(46px) saturate(150%); backdrop-filter: blur(46px) saturate(150%); }
.lg { -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%); }
.lg::after {
  content: ""; position: absolute; left: -10%; top: -60%; width: 70%; height: 130%; pointer-events: none; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,255,255,.18), transparent 70%); transform: rotate(-18deg);
}

@keyframes auroraDrift { 0% { transform: translate(0,0) } 50% { transform: translate(4%,-3%) } 100% { transform: translate(0,0) } }
.auth-screen.chisei-login {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between;
  background: #07070b;
}
.login-aurora { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.login-aurora span { position: absolute; border-radius: 50%; filter: blur(85px); opacity: .5; animation: auroraDrift 24s ease-in-out infinite; }
.login-aurora span:nth-child(1) { width: 540px; height: 540px; background: #3b4dd8; top: -130px; left: 4%; }
.login-aurora span:nth-child(2) { width: 480px; height: 480px; background: #7a3bd8; bottom: -150px; left: 30%; animation-duration: 29s; }
.login-aurora span:nth-child(3) { width: 440px; height: 440px; background: #1f9e8a; top: 16%; right: 6%; animation-duration: 26s; animation-direction: reverse; }
@media (prefers-reduced-motion: reduce) { .login-aurora span { animation: none; } }

.chisei-login .login-visual {
  position: relative; z-index: 2; flex: 1; background: none;
  padding: 56px clamp(40px, 6vw, 88px);
}
.chisei-login .login-stat { margin-top: 30px; width: fit-content; padding: 15px 20px; border-radius: 18px; }
.login-stat-num { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 30px; font-weight: 700; color: #fff; }
.login-stat-lbl { font-size: 12px; color: rgba(255,255,255,.6); margin-top: 2px; }

.chisei-login .login-form-panel {
  position: relative; z-index: 2; flex: 0 0 auto;
  width: min(420px, 42vw); margin-right: clamp(30px, 5vw, 84px);
  border-left: 0; border-radius: 24px; padding: 42px 38px;
  background: rgba(18,20,27,.5);
}
@media (max-width: 820px) {
  .auth-screen.chisei-login { flex-direction: column; justify-content: center; }
  .chisei-login .login-visual { flex: none; text-align: center; padding: 38px 24px 6px; }
  .chisei-login .login-stat { margin-left: auto; margin-right: auto; }
  .chisei-login .login-form-panel { width: min(420px, 92vw); margin: 0 auto 32px; }
}

/* login: vídeo de fundo (substitui a aurora) */
.login-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.login-video { width: 100%; height: 100%; object-fit: cover; }
.login-scrim { position: absolute; inset: 0; background: rgba(8,8,12,.45); }
@media (prefers-reduced-motion: reduce) { .login-video { display: none; } }

/* ============================================================
   FASE 2b — HOME nova (visual do protótipo Vesalor, liquid glass).
   Escopada em .vesa-home. Tokens do protótipo locais ao container.
   ============================================================ */
.vesa-home {
  --ink: #fff; --ink2: rgba(255,255,255,.80); --ink3: rgba(255,255,255,.72);
  --panel: rgba(18,20,26,.68); --glass: rgba(255,255,255,.10); --glass-top: rgba(255,255,255,.5);
  --edge: rgba(255,255,255,.5); --solid: #fff; --solid-ink: #0c0c0d;
  --ok: #5ec27a; --amber: #d9a441; --d-shadow: 0 10px 34px rgba(0,0,0,.34);
  color: var(--ink); font-family: "Poppins", system-ui, sans-serif; text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.vesa-home .vh-row { display: flex; align-items: center; gap: 12px; }
.vesa-home .homewrap { display: flex; gap: 34px; align-items: center; min-height: 46vh; }
.vesa-home .home-main { flex: 1; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.vesa-home h1.hero {
  font-size: clamp(34px, 5.4vw, 60px); line-height: 1.04; font-weight: 500;
  letter-spacing: -.05em; margin: 0; color: var(--ink); font-family: "Poppins", system-ui, sans-serif;
}
.vesa-home .hero .it { font-family: "Source Serif 4", Georgia, serif; font-style: italic; font-weight: 400; color: var(--ink2); }
.vesa-home .hero-sub { font-size: 15px; color: var(--ink2); max-width: 430px; margin: 16px 0 0; line-height: 1.55; }
.vesa-home .home-cta {
  width: fit-content; gap: 10px; padding: 9px 9px 9px 20px; border-radius: 999px; margin-top: 22px;
  cursor: pointer; background: var(--solid); color: var(--solid-ink); box-shadow: var(--d-shadow); border: 0; font-family: inherit; text-shadow: none;
}
.vesa-home .home-cta .lbl { font-size: 14.5px; font-weight: 600; }
.vesa-home .home-cta .arr { width: 30px; height: 30px; border-radius: 50%; background: rgba(127,127,127,.25); display: flex; align-items: center; justify-content: center; }
.vesa-home .home-pills { gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.vesa-home .home-pills span { font-size: 12px; color: var(--ink2); padding: 8px 14px; border-radius: 999px; background: var(--glass); }
.vesa-home .home-stats { gap: 11px; margin-top: 26px; max-width: 540px; align-items: stretch; }
.vesa-home .home-stats .stat { flex: 1; padding: 14px 16px; background: var(--panel); border-radius: 20px; }
.vesa-home .home-stats .stat.big { flex: 1.4; padding: 16px 18px; }
.vesa-home .home-stats .stat .num { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 24px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.vesa-home .home-stats .stat.big .num { font-size: 32px; font-weight: 700; letter-spacing: -.02em; }
.vesa-home .home-stats .stat .lbl { font-size: 11px; color: var(--ink2); margin-top: 2px; }
.vesa-home .home-stats .stat.big .lbl { font-size: 12px; color: var(--ink); font-weight: 500; }

.vesa-home .homeside { width: 310px; flex-shrink: 0; display: flex; flex-direction: column; gap: 9px; }
.vesa-home .wob { padding: 11px 16px; background: var(--panel); border-radius: 20px; }
.vesa-home .wob .num { font-family: "JetBrains Mono", ui-monospace, monospace; color: var(--ink); }
.vesa-home .wob-lbl { font-size: 12px; color: var(--ink2); }
.vesa-home .bar { height: 7px; border-radius: 99px; background: rgba(127,127,127,.25); overflow: hidden; margin-top: 11px; }
.vesa-home .bar > span { display: block; height: 100%; background: var(--ok); }
.vesa-home .area-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 11px; }
.vesa-home .area-row .an { width: 78px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; }
.vesa-home .area-row .ab { flex: 1; height: 6px; border-radius: 99px; background: rgba(127,127,127,.22); overflow: hidden; }
.vesa-home .area-row .ab > span { display: block; height: 100%; background: rgba(120,200,140,.7); }
.vesa-home .area-row .ap { width: 32px; text-align: right; color: var(--ink); }

.vesa-home .home-section-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); margin: 36px 0 14px; }
.vesa-home .mode-grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 14px; }
.vesa-home .gmode {
  padding: 17px 18px 16px; background: var(--glass); border-radius: 18px; cursor: pointer; text-align: left;
  border: 0; color: var(--ink); font-family: inherit; display: flex; flex-direction: column; gap: 4px;
  transition: transform .15s ease-out;
}
.vesa-home .gmode:hover { transform: translateY(-3px); }
.vesa-home .gmode .gm-top { display: flex; align-items: center; justify-content: space-between; }
.vesa-home .gmode .gm-ic { width: 34px; height: 34px; border-radius: 11px; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; color: var(--ink); }
.vesa-home .gmode .gm-count { font-size: 11px; color: var(--ink2); }
.vesa-home .gmode .gm-title { font-size: 15.5px; font-weight: 600; margin-top: 8px; }
.vesa-home .gmode .gm-desc { font-size: 12.5px; color: var(--ink2); line-height: 1.45; }

/* painéis reaproveitados (busca, escolher prova, dados locais) viram vidro */
.vesa-home .mq-card {
  background: var(--panel) !important; border: 1px solid rgba(255,255,255,.12) !important;
  border-radius: 22px !important; color: var(--ink);
  -webkit-backdrop-filter: blur(40px) saturate(150%); backdrop-filter: blur(40px) saturate(150%);
  box-shadow: var(--d-shadow), inset 0 1.5px 0 var(--glass-top) !important; margin-top: 16px;
}
.vesa-home .mq-card h2, .vesa-home .mq-card h1 { color: var(--ink); }
.vesa-home .mq-card p, .vesa-home .mq-card .eyebrow, .vesa-home .mq-card label span { color: var(--ink2); }
.vesa-home .mq-input { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16); color: var(--ink); }

@media (prefers-reduced-motion: reduce) { .vesa-home .gmode { transition: none; } }
@media (max-width: 980px) {
  .vesa-home .homewrap { flex-direction: column; align-items: stretch; gap: 20px; min-height: auto; }
  .vesa-home .homeside { width: auto; }
}

/* ============================================================
   FASE 3 — FUNDAÇÃO: vídeo de fundo + casca (header flutuante de vidro).
   Igual ao protótipo: #bg(vídeo) z0 · #dim z1 · #app z10 (transparente).
   ============================================================ */
#bg { position: fixed; inset: 0; z-index: 0; background: radial-gradient(72% 82% at 62% 46%, rgba(43,95,190,.55), rgba(18,42,95,.30) 40%, rgba(7,8,12,0) 72%), radial-gradient(40% 44% at 56% 44%, rgba(46,150,150,.20), rgba(7,8,12,0) 62%), #07080c; }
#bg video { width: 100%; height: 100%; object-fit: cover; }
#dim { position: fixed; inset: 0; z-index: 1; background: rgba(8,8,12,.42); pointer-events: none; }
html[data-theme="light"] #bg { background: radial-gradient(62% 85% at 24% 12%, rgba(255,255,255,.62), rgba(255,255,255,0) 55%), linear-gradient(135deg, #d6e5fc 0%, #9ec2f2 42%, #6fa0e8 72%, #4f86df 100%); }
html[data-theme="light"] #dim { background: rgba(247,248,251,.18); }
@media (prefers-reduced-motion: reduce) { #bg video { display: none; } }

body { background: #0a0a0b; }
.mq-app { position: relative; z-index: 10; background: transparent !important; }

.app-frame.vesa-frame {
  --ink: #fff; --ink2: rgba(255,255,255,.80); --ink3: rgba(255,255,255,.72);
  --glass: rgba(255,255,255,.10); --glass-top: rgba(255,255,255,.5); --panel: rgba(18,20,26,.68);
  --edge: rgba(255,255,255,.5); --solid: #fff; --solid-ink: #0c0c0d; --ok: #5ec27a; --amber: #d9a441;
  --hl: rgba(255,214,82,.42);
  --d-shadow: 0 10px 34px rgba(0,0,0,.34);
  position: relative; display: block; background: transparent; min-height: 100vh;
  max-width: 1400px; margin: 0 auto; padding: 16px clamp(12px, 2vw, 26px) 20px; color: var(--ink);
}

/* header flutuante de vidro (.lg dá borda em gradiente + brilho + sombra) */
.vesa-header {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 22px; margin-bottom: 10px; border-radius: 20px;
  background: rgba(20,22,28,.45);
}
.vesa-header .vesa-logo {
  background: none; border: 0; cursor: pointer; padding: 0;
  font-family: "Poppins", system-ui, sans-serif; font-weight: 700; font-size: 27px;
  letter-spacing: -.02em; color: var(--ink); white-space: nowrap; margin-right: 6px;
}
.vesa-header .vesa-logo span { color: #c8d2ff; }
/* busca slim: lupa por padrão, expande ao focar (ou se já houver texto) */
.vesa-search { position: relative; display: flex; align-items: center; flex: 0 0 auto; min-width: 50px; max-width: 50px; overflow: hidden; transition: min-width .22s ease, max-width .22s ease; }
.vesa-search:focus-within,
.vesa-search:has(.mq-input:not(:placeholder-shown)) { min-width: 232px; max-width: 232px; }
.vesa-search-ic {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%); z-index: 2;
  display: flex; color: rgba(255,255,255,.6); pointer-events: none;
}
.vesa-search .mq-input {
  position: relative; z-index: 1; width: 100%; min-width: 0; padding: 9px 12px 9px 34px; cursor: pointer;
  background: rgba(255,255,255,.06) !important; border: 1px solid rgba(255,255,255,.14) !important; color: var(--ink);
  border-radius: 999px !important; box-shadow: none !important; transition: background .22s ease;
}
.vesa-search:focus-within .mq-input { box-shadow: none !important; border-color: rgba(255,255,255,.22) !important; }
.vesa-search .mq-input::placeholder { color: transparent; }
.vesa-search:focus-within .mq-input { cursor: text; background: rgba(255,255,255,.1); }
.vesa-search:focus-within .mq-input::placeholder { color: rgba(255,255,255,.4); }
.vesa-user { font-size: 13px; color: rgba(255,255,255,.72) !important; padding: 8px 14px; border-radius: 999px; white-space: nowrap; background: rgba(255,255,255,.06); }

/* ===== floating dock (substitui a nav) ===== */
.vesa-dock { display: flex; align-items: center; justify-content: center; gap: 7px; flex: 1; height: 50px; }
.vesa-dock .dock-item {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 42px; height: 42px; border-radius: 13px; border: 0; cursor: pointer;
  background: rgba(255,255,255,.07); color: rgba(255,255,255,.66) !important; transform-origin: center;
  transition: transform .16s cubic-bezier(.2,.8,.2,1), background .16s, color .16s;
}
.vesa-dock .dock-item:hover { color: #fff !important; background: rgba(255,255,255,.16); }
.vesa-dock .dock-item.on { background: rgba(255,255,255,.18); color: #fff !important; }
.vesa-dock .dock-item.dock-text { width: auto; padding: 0 15px; gap: 7px; font-family: "Poppins", system-ui, sans-serif; font-size: 14.5px; font-weight: 600; }
.vesa-dock .dock-item.dock-text .dock-ic { display: flex; }
.vesa-dock .dock-item .mq-icon { width: 19px; height: 19px; }
.vesa-dock .dock-item.dock-text .mq-icon { width: 18px; height: 18px; }
.vesa-dock .dock-sep { width: 1px; height: 24px; background: var(--edge); opacity: .5; flex-shrink: 0; }

/* tooltip do dock (vive no body, acima do ícone) */
.dock-tip {
  position: fixed; z-index: 90; transform: translate(-50%, 0);
  background: rgba(18,20,26,.94); color: #fff; font-size: 12px; white-space: nowrap;
  padding: 5px 11px; border-radius: 9px; opacity: 0; pointer-events: none;
  transition: opacity .14s; box-shadow: 0 8px 20px rgba(0,0,0,.34);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.dock-tip.on { opacity: 1; }

/* ===== overlay dos cards expansíveis ===== */
.dock-exp { position: fixed; inset: 0; z-index: 70; display: none; align-items: center; justify-content: center; padding: 20px; }
html[data-dock-open] .dock-exp { display: flex; }
.dock-exp__scrim { position: absolute; inset: 0; background: rgba(6,7,10,.55); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); }
.dock-exp__stage { position: relative; z-index: 2; width: min(460px, 94vw); }
.dock-card { display: none; position: relative; padding: 26px 26px 24px; border-radius: 24px; }
html[data-dock-open="estudo"]    .dock-card[data-dock-panel="estudo"],
html[data-dock-open="simulado"]  .dock-card[data-dock-panel="simulado"],
html[data-dock-open="aleatorio"] .dock-card[data-dock-panel="aleatorio"],
html[data-dock-open="filtros"]   .dock-card[data-dock-panel="filtros"],
html[data-dock-open="erros"]     .dock-card[data-dock-panel="erros"],
html[data-dock-open="anuladas"]  .dock-card[data-dock-panel="anuladas"],
html[data-dock-open="revisao"]   .dock-card[data-dock-panel="revisao"],
html[data-dock-open="prova"]     .dock-card[data-dock-panel="prova"],
html[data-dock-open="limpar"]    .dock-card[data-dock-panel="limpar"],
html[data-dock-open="mais"]      .dock-card[data-dock-panel="mais"] { display: block; animation: dockpop .24s cubic-bezier(.2,.9,.2,1); }
@keyframes dockpop { from { opacity: 0; transform: scale(.93); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .dock-card { animation: none !important; } }
.dock-card__close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; background: rgba(255,255,255,.1); color: rgba(255,255,255,.66); display: flex; align-items: center; justify-content: center; }
.dock-card__close:hover { color: #fff; background: rgba(255,255,255,.18); }
.dock-card__head { display: flex; align-items: center; gap: 14px; padding-right: 30px; }
.dock-card__ic { width: 52px; height: 52px; border-radius: 16px; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.dock-card__ic .mq-icon { width: 24px; height: 24px; }
.dock-card__kicker { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.45); margin: 0; }
.dock-card__title { font-size: 21px; font-weight: 600; margin: 2px 0 0; color: #fff; }
.dock-card__meta { font-size: 12px; color: rgba(255,255,255,.45); margin: 3px 0 0; }
.dock-card__desc { font-size: 14px; color: rgba(255,255,255,.66); line-height: 1.6; margin: 16px 0 0; }
.dock-card__notice { font-size: 13px; color: #8fe0b0; margin: 12px 0 0; }
.dock-card__actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.dock-card .source-select-field { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.dock-card .source-select-field > span { font-size: 12px; color: rgba(255,255,255,.66); }
.dock-card .source-select-field .mq-input { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16); color: #fff; border-radius: 11px; padding: 10px 12px; }
.dock-card__actions .danger { background: rgba(224,106,106,.92) !important; color: #fff !important; border-color: transparent !important; }

/* "Mais" — launcher de atalhos (sheet do mobile): coluna de pílulas de vidro */
.dock-card[data-dock-panel="mais"] .dock-card__actions { flex-direction: column; gap: 8px; }
.dock-launch {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 48px; box-sizing: border-box;
  padding: 12px 14px; border: 0; border-radius: 14px; cursor: pointer;
  background: rgba(255,255,255,.08); color: #fff;
  font: 500 14.5px "Poppins", system-ui, sans-serif; text-align: left;
  transition: background .15s, transform .15s;
}
.dock-launch:hover { background: rgba(255,255,255,.16); transform: translateY(-1px); }
.dock-launch svg { width: 18px; height: 18px; flex-shrink: 0; }
.theme-menu-toggle__icon {
  width: 18px; height: 18px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1;
}
html[data-theme="light"] .dock-launch { background: rgba(16,19,26,.06); color: #10131a; }
html[data-theme="light"] .dock-launch:hover { background: rgba(16,19,26,.11); }

/* ===== glare cards (estatísticas) — foil holográfico estilo Aceternity ===== */
.home-stats, .vesa-home .homeside { perspective: 1000px; }
.glare {
  position: relative; transform-style: preserve-3d;
  --m-x: 50%; --m-y: 50%; --bg-x: 50%; --bg-y: 50%; --r-x: 0deg; --r-y: 0deg; --foil-op: 0;
  transform: rotateY(var(--r-x)) rotateX(var(--r-y));
}
.glare__content { position: relative; z-index: 4; display: block; }
.glare__sheen {
  position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none;
  background-image: radial-gradient(farthest-corner circle at var(--m-x) var(--m-y), rgba(255,255,255,.85) 8%, rgba(255,255,255,.45) 22%, rgba(255,255,255,0) 72%);
  opacity: calc(var(--foil-op) * .7); mix-blend-mode: overlay;
}
.glare__holo {
  position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none;
  --angle: 133deg;
  background-image:
    repeating-linear-gradient(var(--angle), rgba(225,235,255,0) 0%, rgba(225,235,255,.5) 3.5%, rgba(150,185,245,.28) 5%, rgba(225,235,255,0) 9%, rgba(225,235,255,0) 13%),
    radial-gradient(farthest-corner circle at var(--m-x) var(--m-y), rgba(120,165,255,.32) 8%, rgba(10,14,30,.12) 75%);
  background-blend-mode: screen;
  background-size: 230% 230%, 320% 320%;
  background-position: var(--bg-x) var(--bg-y), var(--bg-x) var(--bg-y);
  mix-blend-mode: screen;
  opacity: calc(var(--foil-op) * .9);
}
/* variante sutil para cards de estatística: iridescência leve, sem foil forte */
.glare--soft { transform: rotateY(calc(var(--r-x) * .5)) rotateX(calc(var(--r-y) * .5)); }
.glare--soft .glare__holo {
  background-image: radial-gradient(circle at var(--m-x) var(--m-y), rgba(150,190,255,.55), rgba(200,150,255,.32) 32%, rgba(150,255,210,.18) 58%, transparent 78%);
  background-size: auto; background-position: center; background-blend-mode: normal;
  mix-blend-mode: screen; filter: none; opacity: calc(var(--foil-op) * .9);
}
.glare--soft .glare__sheen { opacity: calc(var(--foil-op) * .5); }
@media (prefers-reduced-motion: reduce) { .glare { transition: none; } }

/* ===== card de sequência (streak) ===== */
.streak-flame { display: inline-flex; color: var(--amber); }
.streak-flame .mq-icon { width: 20px; height: 20px; }

/* ===== card de atividade da semana (gráfico de barras) ===== */
.vesa-home .week-card { margin-top: 12px; padding: 14px 22px 12px; border-radius: 26px; }
.vesa-home .week-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.vesa-home .week-head .wob-lbl b { color: var(--ink); font-weight: 600; }
.vesa-home .week-chart { display: flex; align-items: flex-end; gap: 4px; }
.vesa-home .week-empty { margin: 4px 0 6px; line-height: 1.5; }
.vesa-home .week-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: default; }
.vesa-home .week-col:focus-visible { outline: none; }
.vesa-home .week-barwrap { width: 100%; height: 76px; display: flex; align-items: flex-end; justify-content: center; }
.vesa-home .week-bar { position: relative; width: 100%; max-width: 46px; min-height: 6px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, rgba(120,200,140,.92), rgba(94,194,122,.4)); transition: filter .16s, box-shadow .16s; }
.vesa-home .week-col:hover .week-bar, .vesa-home .week-col:focus-visible .week-bar { filter: brightness(1.2) saturate(1.1); box-shadow: 0 0 0 1.5px var(--edge), 0 6px 18px rgba(94,194,122,.4); }
.vesa-home .week-tip { position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -6px); background: rgba(18,20,26,.94); color: #fff; font-size: 11px; white-space: nowrap; padding: 4px 9px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .14s; box-shadow: 0 6px 16px rgba(0,0,0,.3); }
.vesa-home .week-tip b { font-weight: 700; }
.vesa-home .week-col:hover .week-tip, .vesa-home .week-col:focus-visible .week-tip { opacity: 1; }
.vesa-home .week-day { font-size: 11px; color: var(--ink2); }

/* ===== tela de QUESTÃO — navegador esq · questão centro (vidro) · comentário dir ===== */
/* cabe no viewport sem rolagem do navegador; o que estoura rola DENTRO do painel (scrollbar de vidro). */
.qscreen { display: flex; gap: 16px; align-items: stretch; height: calc(100dvh - 124px); }
.qscreen > * { min-height: 0; }
/* a tela de Questão ocupa o workspace inteiro (sem o padding grande do workspace) → cabe sem rolar */
/* telas de altura fixa (no-scroll) zeram o padding legado do workspace (32/60px) p/ caber sem rolar */
.vesa-frame .workspace:has(.qscreen),
.vesa-frame .workspace:has(.vesa-home),
.vesa-frame .workspace:has(.vesa-filters),
.vesa-frame .workspace:has(.vesa-catalog),
.vesa-frame .workspace:has(.vesa-errors),
.vesa-frame .workspace:has(.vesa-resume),
.vesa-frame .workspace:has(.vesa-sim),
.vesa-frame .workspace:has(.vesa-simres) { padding: 0; }
/* Home: cabe no viewport; se estourar (tela baixa, ou com o painel de Busca), rola DENTRO da Home — nunca a página */
.vesa-home { max-height: calc(100dvh - 122px); overflow: auto; padding-right: 2px; }
.vesa-home::-webkit-scrollbar { width: 8px; }
.vesa-home::-webkit-scrollbar-thumb { background: rgba(127,127,127,.32); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
.vesa-home { scrollbar-width: thin; scrollbar-color: rgba(127,127,127,.32) transparent; }

.qnav { width: 208px; flex-shrink: 0; padding: 16px; display: flex; flex-direction: column; overflow: hidden; background: var(--panel); border-radius: 26px; }
.qnav .qnav-title { font-size: 12.5px; color: var(--ink2); margin: 0 0 10px; }
.qnav .qnavgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; overflow: auto; flex: 1; min-height: 0; align-content: start; }
.qnav .question-map-btn { font: 600 12.5px/1 "Poppins", system-ui, sans-serif; aspect-ratio: 1; border: 0; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--ink2); background: var(--glass); cursor: pointer; padding: 0; }
.qnav .question-map-btn.current { outline: 1.5px solid var(--edge); color: var(--ink); }
.qnav .question-map-btn.answered { background: rgba(120,200,140,.3); color: var(--ink); }
.qnav .question-map-btn.wrong { background: rgba(225,110,110,.32); color: var(--ink); }
.qnav .question-map-btn.skipped { background: rgba(230,190,120,.3); color: var(--ink); }
.qnav .qnavlegend { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; font-size: 11px; color: var(--ink2); flex-shrink: 0; }
.qnav .qnavlegend span { display: flex; align-items: center; gap: 7px; }
.qnav .qsw { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.qnav .qsw.ok { background: rgba(120,200,140,.55); }
.qnav .qsw.no { background: rgba(225,110,110,.55); }
.qnav .qsw.sk { background: rgba(230,190,120,.55); }
.qnav .qsw.pend { background: rgba(127,127,127,.35); }

.qmain { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.qtopline { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-shrink: 0; }
.qtopline-meta { font-size: 13px; color: var(--ink2); }
.qtopline-prog { font-size: 13px; color: var(--ink2); padding: 7px 14px; background: var(--glass); }
.qtopline-prog b { color: var(--ink); font-weight: 600; }
.qwrap { position: relative; flex: 1; min-height: 0; display: flex; }
.qcanvas { position: absolute; inset: 0; z-index: 5; border-radius: 26px; pointer-events: none; touch-action: none; }
.qpanel { position: relative; z-index: 4; flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--panel); border-radius: 26px; }
.qpanel-scroll { flex: 1; min-height: 0; overflow: auto; padding: 22px 28px 8px; }
.qmeta { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--ink2); }
.qmeta-src { color: var(--ink3); white-space: nowrap; }
.qpanel .qstatement { font-size: 16.5px; line-height: 1.62; color: var(--ink); margin: 14px 0 0; }
.qpanel .qstatement mark.hl, .qpanel .qstatement .hl { background: var(--hl); color: inherit; border-radius: 3px; padding: .5px 1px; cursor: pointer; }
.qalts { margin-top: 18px; }
.qactions { flex-shrink: 0; padding: 12px 28px 16px; border-top: 1px solid rgba(127,127,127,.16); }
.qactions .button-row { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }

.qalts .alternative { display: flex; gap: 11px; align-items: flex-start; padding: 13px 16px; border-radius: 18px !important; border: 0 !important; box-shadow: none !important; background: var(--glass) !important; margin-bottom: 9px; transition: background .14s; }
.qalts .alternative:hover { background: var(--glass-top) !important; transform: none !important; box-shadow: none !important; }
.qalts .alternative .letter, .qalts .alternative .mq-opt-letter { width: 27px; height: 27px; border-radius: 50%; background: rgba(127,127,127,.22); display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600; flex-shrink: 0; color: var(--ink); }
.qalts .alternative .alternative-main { flex: 1; background: none !important; border: 0; text-align: left; color: var(--ink); font: inherit; font-size: 15px; line-height: 1.45; cursor: pointer; padding: 0; min-width: 0; }
.qalts .alternative.selected { outline: 2px solid var(--solid); background: rgba(127,127,127,.16); }
.qalts .alternative.selected .letter, .qalts .alternative.selected .mq-opt-letter { background: var(--solid); color: var(--solid-ink); }
.qalts .alternative.discarded .alternative-text { text-decoration: line-through; opacity: .45; }
.qalts .alternative.correct { outline: 2px solid var(--ok); background: rgba(94,194,122,.16); }
.qalts .alternative.wrong { outline: 2px solid #e06a6a; background: rgba(224,106,106,.14); }
.qalts .alternative .discard-btn { width: 24px; height: 24px; border-radius: 50%; border: 0; background: none; color: var(--ink3); cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.qalts .alternative .discard-btn:hover { color: var(--ink); background: rgba(127,127,127,.18); }

.qcomment { width: 322px; flex-shrink: 0; padding: 0; overflow: hidden; display: none; flex-direction: column; min-height: 0; color: var(--ink); background: var(--panel); border-radius: 26px; box-sizing: border-box; isolation: isolate; }
.qcomment.show { display: flex; }
.qcomment-scrim, .qcomment-mobilebar, .qcomment-reopen { display: none; }
.qcomment-scroll { position: relative; z-index: 1; flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 18px 20px; box-sizing: border-box; max-width: 100%; }
.qcomment-scroll > :last-child { margin-bottom: 0 !important; }
.qcomment .mq-callout, .qcomment .commentary, .qcomment .feedback-card { background: transparent; border: 0; box-shadow: none; padding: 0; margin: 0 0 12px; color: var(--ink2); width: 100%; max-width: 100%; box-sizing: border-box; }
.qcomment strong { color: var(--ink); }

.qpanel-scroll::-webkit-scrollbar, .qcomment-scroll::-webkit-scrollbar, .qnav .qnavgrid::-webkit-scrollbar { width: 8px; }
.qpanel-scroll::-webkit-scrollbar-thumb, .qcomment-scroll::-webkit-scrollbar-thumb, .qnav .qnavgrid::-webkit-scrollbar-thumb { background: rgba(127,127,127,.32); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
.qpanel-scroll, .qcomment-scroll, .qnav .qnavgrid { scrollbar-width: thin; scrollbar-color: rgba(127,127,127,.32) transparent; }

@media (max-width: 980px) {
  .qscreen { flex-direction: column; height: auto; }
  .qnav, .qcomment { width: auto; }
  .qnav .qnavgrid { grid-template-columns: repeat(10, 1fr); }
}

/* dock flutuante de ferramentas (lápis / marca-texto / borracha / limpar) — só na tela de Questão */
.qcanvas { pointer-events: none; }
html[data-tool="pencil"] .qcanvas, html[data-tool="eraser"] .qcanvas { pointer-events: auto; cursor: crosshair; }
.qtooldock { display: none; position: fixed; left: 50%; bottom: 168px; transform: translateX(-50%); z-index: 55; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 999px; background: rgba(20,22,28,.62); color: #fff; border: 1px solid rgba(255,255,255,.16); box-shadow: 0 10px 30px rgba(0,0,0,.34); -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%); }
html[data-view="question"] .qtooldock { display: flex; }
.qtooldock .qtd-grip { width: 16px; height: 40px; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.45); cursor: grab; touch-action: none; }
.qtooldock .qtd-grip:active { cursor: grabbing; }
.qtooldock .qtd-tool { width: 44px; height: 44px; border-radius: 50%; border: 0; background: none; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform .15s, background .15s; padding: 0; }
.qtooldock .qtd-tool:hover { transform: translateY(-3px); background: rgba(255,255,255,.14); }
.qtooldock .qtd-tool.on { background: #fff; color: #0c0c0d; }
.qtooldock .qtd-sep { width: 1px; height: 24px; background: rgba(255,255,255,.4); margin: 0 2px; }
.qtooldock svg { width: 21px; height: 21px; }
html[data-theme="light"] .qtooldock { background: rgba(255,255,255,.72); color: #10131a; border-color: rgba(16,19,26,.12); box-shadow: 0 10px 30px rgba(20,24,40,.16); }
html[data-theme="light"] .qtooldock .qtd-tool { color: #10131a; }
html[data-theme="light"] .qtooldock .qtd-tool:hover { background: rgba(16,19,26,.08); }
html[data-theme="light"] .qtooldock .qtd-tool.on { background: #10131a; color: #fff; }
html[data-theme="light"] .qtooldock .qtd-grip { color: rgba(16,19,26,.4); }
html[data-theme="light"] .qtooldock .qtd-sep { background: rgba(16,19,26,.18); }

/* ===== modo claro (tokens + ajustes do protótipo) ===== */
html[data-theme="light"] .app-frame.vesa-frame {
  --ink: #10131a; --ink2: rgba(16,19,26,.82); --ink3: rgba(16,19,26,.74);
  --glass: rgba(255,255,255,.42); --glass-top: rgba(255,255,255,.85); --panel: rgba(255,255,255,.74);
  --edge: rgba(255,255,255,.9); --solid: #10131a; --solid-ink: #fff; --hl: rgba(255,205,40,.5);
  --d-shadow: 0 10px 30px rgba(20,24,40,.16);
}
html[data-theme="light"] .vesa-home {
  --ink: #10131a; --ink2: rgba(16,19,26,.82); --ink3: rgba(16,19,26,.74);
  --glass: rgba(255,255,255,.42); --glass-top: rgba(255,255,255,.85); --panel: rgba(255,255,255,.74);
  --edge: rgba(255,255,255,.9); --solid: #10131a; --solid-ink: #fff; --hl: rgba(255,205,40,.5);
  --d-shadow: 0 10px 30px rgba(20,24,40,.16);
  text-shadow: 0 1px 2px rgba(255,255,255,.55);
}
/* vidro liquid-glass 3D no CLARO — sombra suave + realce superior + edge visível (estilo Apple) */
html[data-theme="light"] .lg,
html[data-theme="light"] .lgs {
  box-shadow: 0 14px 34px rgba(20,24,40,.14),
              inset 0 1.4px 0 rgba(255,255,255,.95),
              inset 0 -1px 1px rgba(20,24,40,.05),
              inset 0 0 0 1px rgba(20,24,40,.04);
}
html[data-theme="light"] .lg::before,
html[data-theme="light"] .lgs::before {
  background: linear-gradient(150deg, rgba(255,255,255,.95), rgba(255,255,255,.45) 30%, rgba(20,24,40,.07) 56%, rgba(255,255,255,.35) 80%, rgba(255,255,255,.95));
}
html[data-theme="light"] .vesa-header { background: rgba(255,255,255,.5); }
html[data-theme="light"] .vesa-dock .dock-item { background: rgba(16,19,26,.05); color: rgba(16,19,26,.7) !important; }
html[data-theme="light"] .vesa-dock .dock-item:hover { background: rgba(16,19,26,.1); color: #10131a !important; }
html[data-theme="light"] .vesa-dock .dock-item.on { background: rgba(16,19,26,.12); color: #10131a !important; }
html[data-theme="light"] .vesa-search .mq-input { background: rgba(16,19,26,.05) !important; border-color: rgba(16,19,26,.14); color: #10131a; }
html[data-theme="light"] .dock-card .source-select-field .mq-input { background: rgba(16,19,26,.05) !important; }
html[data-theme="light"] .vesa-search-ic { color: rgba(16,19,26,.5); }
html[data-theme="light"] .vesa-user { background: rgba(16,19,26,.05); color: rgba(16,19,26,.7) !important; }
html[data-theme="light"] .dock-tip { background: rgba(255,255,255,.96); color: #10131a; }
html[data-theme="light"] .dock-exp__scrim { background: rgba(214,221,236,.5); }
html[data-theme="light"] .dock-card { background: rgba(255,255,255,.88); }
html[data-theme="light"] .dock-card__close { background: rgba(16,19,26,.07); color: rgba(16,19,26,.6); }
html[data-theme="light"] .dock-card__close:hover { background: rgba(16,19,26,.13); color: #10131a; }
html[data-theme="light"] .dock-card__ic { background: rgba(16,19,26,.08); color: #10131a; }
html[data-theme="light"] .dock-card__kicker, html[data-theme="light"] .dock-card__meta { color: rgba(16,19,26,.5); }
html[data-theme="light"] .dock-card__title { color: #10131a; }
html[data-theme="light"] .dock-card__desc { color: rgba(16,19,26,.72); }
html[data-theme="light"] .dock-card .source-select-field > span { color: rgba(16,19,26,.66); }
html[data-theme="light"] .dock-card .source-select-field .mq-input { background: rgba(16,19,26,.05); border-color: rgba(16,19,26,.16); color: #10131a; }
html[data-theme="light"] .vesa-home .week-tip { background: rgba(255,255,255,.97); color: #10131a; box-shadow: 0 6px 16px rgba(20,24,40,.18); }
/* BUG fix (tema escuro): o <select class="mq-input"> e nativo e o popup de <option> ficava
   branco. color-scheme:dark sozinho NAO basta porque o background claro (rgba) do input vaza
   pro popup nativo; por isso forcamos tambem a cor dos <option>/<optgroup> no escuro. */
html[data-theme="dark"] select.mq-input { color-scheme: dark; }
html[data-theme="dark"] select.mq-input option,
html[data-theme="dark"] select.mq-input optgroup {
  background-color: #141a24;
  color: #e7ecf5;
}
/* toggle de tema (vidro, flutuante) — sobrescreve o estilo brutalista */
.theme-toggle {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 18px; line-height: 1;
  background: rgba(20,22,28,.6); color: #fff; border: 1px solid rgba(255,255,255,.18);
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 8px 22px rgba(0,0,0,.34); transition: transform .15s, background .15s;
}
.theme-toggle:hover { transform: translateY(-2px); background: rgba(30,33,40,.74); }
html[data-theme="light"] .theme-toggle { background: rgba(255,255,255,.74); color: #10131a; border-color: rgba(16,19,26,.14); box-shadow: 0 8px 22px rgba(20,24,40,.18); }
.vesa-frame .workspace { display: block; position: relative; }
.supplemental-alert {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 25;
  display: inline-flex; align-items: center; gap: 7px; max-width: min(720px, calc(100% - 28px));
  margin: 0; padding: 8px 12px; border-radius: 999px;
  font-size: 12.5px; line-height: 1.25; color: rgba(255,255,255,.82);
  background: rgba(24,26,34,.64); border: 1px solid rgba(255,255,255,.16);
  -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 10px 24px rgba(0,0,0,.26); pointer-events: none;
}
html[data-theme="light"] .supplemental-alert {
  color: rgba(16,19,26,.78); background: rgba(255,255,255,.78); border-color: rgba(16,19,26,.12);
  box-shadow: 0 10px 24px rgba(20,24,40,.14);
}
.vesa-frame .mobile-nav { display: none; }

/* B1: abaixo de 900px o dock some e a barra de abas vira a ÚNICA nav (sem redundância/clipping).
   Os destinos que só viviam no dock (Aleatório/Revisão/Anuladas/Escolher prova/Limpar) entram pelo "Mais". */
@media (max-width: 900px) {
  body > .theme-toggle { display: none !important; }
  .auth-logout-btn {
    min-height: 44px;
    padding: 0 14px;
    right: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  }
  .vesa-frame .vesa-dock { display: none; }
  .vesa-frame .vesa-search { margin-left: auto; }   /* empurra busca + usuário pra direita sem o dock */
  /* barra de abas (vidro) — fixa embaixo, ciente do tema */
  .vesa-frame .mobile-nav {
    display: flex; gap: 6px; flex-wrap: nowrap; justify-content: space-around;
    position: sticky; bottom: 10px; margin-top: 16px; padding: 7px 8px;
    border-radius: 20px; background: rgba(20,22,28,.62);
    -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%);
    box-shadow: 0 10px 30px rgba(0,0,0,.34);
  }
  /* itens: pílula de vidro (vence o brutalista) — corrige a "caixa preta" do ativo */
  .vesa-frame .mobile-nav .mq-nav-item {
    flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 3px;
    min-height: 48px; margin: 0 !important; padding: 7px 4px !important;
    border: 0 !important; border-radius: 14px !important; box-shadow: none !important;
    background: transparent !important; color: rgba(255,255,255,.66) !important;
    font-weight: 500 !important; transform: none !important; transition: background .15s, color .15s;
  }
  .vesa-frame .mobile-nav .mq-nav-item .mq-nav-icon { display: inline-flex !important; width: 20px; height: 20px; opacity: 1; color: inherit !important; }
  .vesa-frame .mobile-nav .mq-nav-item strong { display: block; font-size: 10.5px !important; line-height: 1.1; color: inherit !important; font-weight: 500 !important; }
  .vesa-frame .mobile-nav .mq-nav-item:hover { background: rgba(255,255,255,.10) !important; color: #fff !important; border-color: transparent !important; }
  .vesa-frame .mobile-nav .mq-nav-item.active,
  .vesa-frame .mobile-nav .mq-nav-item[data-active="true"] { background: rgba(255,255,255,.16) !important; color: #fff !important; box-shadow: none !important; }
  .vesa-frame .mobile-nav .mq-nav-item.active .mq-nav-icon,
  .vesa-frame .mobile-nav .mq-nav-item[data-active="true"] .mq-nav-icon { color: #fff !important; }
  .vesa-frame .mobile-nav .mq-nav-count {
    border: 0 !important; background: rgba(255,255,255,.22) !important; color: #fff !important;
    border-radius: 999px !important; font-size: 10px !important; padding: 1px 6px !important; font-weight: 600;
  }

  /* CLARO: barra e itens claros (sem o slab escuro do modo claro) */
  html[data-theme="light"] .vesa-frame .mobile-nav { background: rgba(255,255,255,.78); box-shadow: 0 10px 30px rgba(20,24,40,.16); }
  html[data-theme="light"] .vesa-frame .mobile-nav .mq-nav-item { color: rgba(16,19,26,.64) !important; }
  html[data-theme="light"] .vesa-frame .mobile-nav .mq-nav-item:hover { background: rgba(16,19,26,.07) !important; color: #10131a !important; }
  html[data-theme="light"] .vesa-frame .mobile-nav .mq-nav-item.active,
  html[data-theme="light"] .vesa-frame .mobile-nav .mq-nav-item[data-active="true"] { background: rgba(16,19,26,.11) !important; color: #10131a !important; }
  html[data-theme="light"] .vesa-frame .mobile-nav .mq-nav-item.active .mq-nav-icon,
  html[data-theme="light"] .vesa-frame .mobile-nav .mq-nav-item[data-active="true"] .mq-nav-icon { color: #10131a !important; }
  html[data-theme="light"] .vesa-frame .mobile-nav .mq-nav-count { background: rgba(16,19,26,.14) !important; color: #10131a !important; }
}

/* ============================================================
   FASE 4 — SIMULADO (setup + resultado) no design de vidro.
   Tokens herdados de .vesa-frame (claro/escuro automáticos). No-scroll:
   o setup é um card central; o resultado cabe no viewport e as listas
   rolam DENTRO dos painéis de vidro (scrollbar fina).
   ============================================================ */

/* (Botões de vidro do Simulado: agora cobertos pelo sistema único `.vesa-frame .mq-btn` da FASE 5.) */

/* ---- Setup: card central de vidro ---- */
.vesa-sim { min-height: calc(100dvh - 124px); display: flex; align-items: center; justify-content: center; }
.vesa-sim .sim-card { width: min(560px, 100%); padding: 30px 32px 26px; border-radius: 28px; background: var(--panel); }
.vesa-sim .sim-eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); margin: 0; }
.vesa-sim .sim-title { font-size: clamp(26px, 4vw, 34px); font-weight: 500; line-height: 1.06; letter-spacing: -.02em; color: var(--ink); margin: 8px 0 0; }
.vesa-sim .sim-title .it { font-family: "Source Serif 4", Georgia, serif; font-style: italic; font-weight: 400; color: var(--ink2); }
.vesa-sim .sim-sub { font-size: 14px; color: var(--ink2); line-height: 1.55; margin: 12px 0 0; }
.vesa-sim .sim-fields { display: flex; gap: 14px; margin-top: 22px; align-items: flex-end; }
.vesa-sim .sim-field { display: flex; flex-direction: column; gap: 6px; }
.vesa-sim .sim-field--source { flex: 1; min-width: 0; }
.vesa-sim .sim-field--count { width: 118px; flex-shrink: 0; }
.vesa-sim .sim-flabel { font-size: 12px; color: var(--ink2); }
.vesa-sim .source-select-field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.vesa-sim .source-select-field > span { font-size: 12px; color: var(--ink2); }
.vesa-sim .mq-input {
  background: rgba(127,127,127,.10) !important; border: 1px solid rgba(127,127,127,.30) !important;
  color: var(--ink) !important; border-radius: 12px !important; padding: 11px 13px !important;
  font: inherit !important; box-shadow: none !important; width: 100%;
}
.vesa-sim .sim-count { text-align: center; font-family: "JetBrains Mono", ui-monospace, monospace !important; font-size: 17px !important; }
.vesa-sim .sim-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.vesa-sim .sim-preset {
  font: 600 13px/1 "JetBrains Mono", ui-monospace, monospace; color: var(--ink);
  background: var(--glass); border: 1px solid var(--edge); border-radius: 999px;
  padding: 9px 15px; cursor: pointer; transition: transform .14s, background .14s;
}
.vesa-sim .sim-preset:hover { transform: translateY(-2px); background: var(--glass-top); }
.vesa-sim .sim-limit { font-size: 12.5px; color: var(--ink2); margin: 16px 0 0; line-height: 1.5; }
.vesa-sim .sim-limit b { color: var(--ink); font-weight: 600; }
.vesa-sim .sim-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }

/* ---- Resultado: placar + áreas + lista ---- */
.vesa-simres { height: calc(100dvh - 128px); display: flex; flex-direction: column; gap: 12px; }
.vesa-simres > * { min-height: 0; }
.vesa-simres .simres-top { display: flex; gap: 12px; align-items: stretch; flex-shrink: 0; }
.vesa-simres .simres-score { flex: 0 0 246px; padding: 18px 22px; border-radius: 26px; background: var(--panel); display: flex; flex-direction: column; align-items: flex-start; }
.vesa-simres .simres-eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); margin: 0; }
.vesa-simres .simres-pct { display: flex; align-items: baseline; gap: 1px; font-family: "JetBrains Mono", ui-monospace, monospace; font-weight: 700; line-height: 1; margin-top: 4px; }
.vesa-simres .simres-pct .mq-num { font-size: 52px; letter-spacing: -.03em; }
.vesa-simres .simres-pct-sign { font-size: 22px; color: var(--ink2); }
.vesa-simres .simres-pct.ok .mq-num { color: var(--ok); }
.vesa-simres .simres-pct.warn .mq-num { color: #e0863a; }
.vesa-simres .simres-badge { font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 999px; margin-top: 8px; }
.vesa-simres .simres-badge.ok { background: rgba(94,194,122,.20); color: var(--ok); }
.vesa-simres .simres-badge.warn { background: rgba(224,134,58,.20); color: #e0863a; }
.vesa-simres .simres-meta { font-size: 12.5px; color: var(--ink2); margin: 10px 0 0; }
.vesa-simres .simres-meta b { color: var(--ink); font-weight: 600; }
.vesa-simres .simres-stats { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.vesa-simres .simres-stat { padding: 16px 18px; border-radius: 20px; background: var(--panel); display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.vesa-simres .simres-stat strong { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 30px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.vesa-simres .simres-stat span { font-size: 12.5px; color: var(--ink2); }
.vesa-simres .simres-stat.ok strong { color: var(--ok); }
.vesa-simres .simres-stat.miss strong { color: #e06a6a; }
.vesa-simres .simres-stat.skip strong { color: var(--amber); }

.vesa-simres .simres-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 12px; }
.vesa-simres .simres-panel { padding: 16px 18px; border-radius: 26px; background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.vesa-simres .simres-h { font-size: 12.5px; color: var(--ink2); margin: 0 0 12px; flex-shrink: 0; }
.vesa-simres .simres-scroll { flex: 1; min-height: 0; overflow: auto; padding-right: 4px; }

/* desempenho por área */
.vesa-simres .perf-table { display: flex; flex-direction: column; gap: 10px; }
.vesa-simres .perf-head, .vesa-simres .perf-row { display: grid; grid-template-columns: 1fr 64px 50px 44px; gap: 9px; align-items: center; }
.vesa-simres .perf-head { font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink3); }
.vesa-simres .perf-head span:nth-child(3), .vesa-simres .perf-head span:nth-child(4) { text-align: right; }
.vesa-simres .perf-name { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vesa-simres .perf-bar { height: 7px; border-radius: 99px; background: rgba(127,127,127,.22); overflow: hidden; }
.vesa-simres .perf-bar > span { display: block; height: 100%; border-radius: 99px; }
.vesa-simres .perf-bar > span.ok { background: var(--ok); }
.vesa-simres .perf-bar > span.warn { background: #e0863a; }
.vesa-simres .perf-frac { font-size: 12.5px; color: var(--ink2); text-align: right; }
.vesa-simres .perf-pct { font-size: 13px; font-weight: 600; text-align: right; }
.vesa-simres .perf-pct.ok { color: var(--ok); }
.vesa-simres .perf-pct.warn { color: #e0863a; }
.vesa-simres .simres-empty { font-size: 13px; color: var(--ink2); margin: 0; }

/* lista questão a questão */
.vesa-simres .simres-rows { display: flex; flex-direction: column; gap: 8px; }
.vesa-simres .simres-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: var(--glass); border-left: 3px solid transparent; }
.vesa-simres .simres-row.ok { border-left-color: var(--ok); }
.vesa-simres .simres-row.miss { border-left-color: #e06a6a; }
.vesa-simres .simres-row.skip { border-left-color: var(--amber); }
.vesa-simres .simres-idx { width: 24px; flex-shrink: 0; font-size: 13px; color: var(--ink3); text-align: center; }
.vesa-simres .simres-rmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vesa-simres .simres-rmain strong { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vesa-simres .simres-rmain span { font-size: 12px; color: var(--ink2); }
.vesa-simres .simres-tag { width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.vesa-simres .simres-row.ok .simres-tag { background: rgba(94,194,122,.20); color: var(--ok); }
.vesa-simres .simres-row.miss .simres-tag { background: rgba(224,106,106,.20); color: #e06a6a; }
.vesa-simres .simres-row.skip .simres-tag { background: rgba(217,164,65,.22); color: var(--amber); }

.vesa-simres .simres-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-shrink: 0; flex-wrap: wrap; }
.vesa-simres .simres-note { font-size: 13px; color: var(--ink2); margin: 0; }
.vesa-simres .simres-note b { color: var(--ink); font-weight: 600; }
.vesa-simres .sim-actions { display: flex; flex-wrap: wrap; gap: 9px; }

/* scrollbar de vidro nas listas do resultado */
.vesa-simres .simres-scroll::-webkit-scrollbar { width: 8px; }
.vesa-simres .simres-scroll::-webkit-scrollbar-thumb { background: rgba(127,127,127,.32); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
.vesa-simres .simres-scroll { scrollbar-width: thin; scrollbar-color: rgba(127,127,127,.32) transparent; }

@media (prefers-reduced-motion: reduce) {
  .vesa-sim .mq-btn, .vesa-simres .mq-btn, .vesa-sim .sim-preset { transition: none; }
}
@media (max-width: 980px) {
  .vesa-sim { min-height: 0; padding: 8px 0 24px; }
  .vesa-simres { height: auto; }
  .vesa-simres .simres-top { flex-direction: column; }
  .vesa-simres .simres-score { flex-basis: auto; }
  .vesa-simres .simres-body { grid-template-columns: 1fr; }
  .vesa-simres .simres-scroll { overflow: visible; }
}

/* ============================================================
   FASE 5 — Liquid glass "a fundo" (pedido do Gustavo): botões de vidro
   em TODA a app (matam o brutalista) + material mais dimensional +
   painel de comentário legível nos 2 temas. Tokens do .vesa-frame.
   ============================================================ */

/* ---- Sistema ÚNICO de botões de vidro (vence o brutalista !important) ---- */
.vesa-frame .mq-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 14px "Poppins", system-ui, sans-serif !important;
  padding: 10px 17px !important; border-radius: 999px !important;
  border: 0 !important; cursor: pointer; text-transform: none !important;
  transition: transform .15s, background .15s, box-shadow .15s, filter .15s;
}
.vesa-frame .mq-btn .btn-icon { width: 16px; height: 16px; }
/* primário = pílula sólida (a CTA do protótipo) com realce de topo */
.vesa-frame .mq-btn--primary {
  background: var(--solid) !important; color: var(--solid-ink) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.35) !important;
}
.vesa-frame .mq-btn--primary:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 9px 24px rgba(0,0,0,.26), inset 0 1px 0 rgba(255,255,255,.4) !important; }
/* secundário = pílula de VIDRO (translúcida, rim claro + profundidade) */
.vesa-frame .mq-btn--secondary {
  background: var(--glass) !important; color: var(--ink) !important;
  -webkit-backdrop-filter: blur(14px) saturate(150%); backdrop-filter: blur(14px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), inset 0 0 0 1px rgba(255,255,255,.12), 0 4px 12px rgba(0,0,0,.16) !important;
}
.vesa-frame .mq-btn--secondary:hover { transform: translateY(-2px); background: var(--glass-top) !important; }
.vesa-frame .mq-btn--ghost { background: transparent !important; color: var(--ink2) !important; box-shadow: none !important; }
.vesa-frame .mq-btn--ghost:hover { background: var(--glass) !important; color: var(--ink) !important; }
.vesa-frame .mq-btn[disabled] { opacity: .4 !important; cursor: not-allowed; transform: none !important; filter: none !important; }
/* CLARO: rim do vidro mais nítido (o rim escuro some sobre fundo claro) */
html[data-theme="light"] .vesa-frame .mq-btn--secondary {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), inset 0 0 0 1px rgba(20,24,40,.06), 0 4px 12px rgba(20,24,40,.10) !important;
}
/* o .danger (limpar dados) mantém o vermelho */
.vesa-frame .mq-btn.danger, .vesa-frame .dock-card__actions .danger { background: rgba(224,106,106,.92) !important; color: #fff !important; box-shadow: 0 4px 12px rgba(224,106,106,.3) !important; }

/* ---- Material mais dimensional: gleam especular também nos painéis .lgs ---- */
/* sutil e ancorado no topo → não come o contraste do texto. (.glare tem efeito próprio → fora) */
.lgs:not(.glare)::after {
  content: ""; position: absolute; left: -6%; top: -50%; width: 56%; height: 96%; z-index: 0;
  pointer-events: none; border-radius: 50%; transform: rotate(-16deg);
  background: radial-gradient(closest-side, rgba(255,255,255,.08), transparent 72%);
}
html[data-theme="light"] .lgs:not(.glare)::after { background: radial-gradient(closest-side, rgba(255,255,255,.34), transparent 72%); }

/* ---- Painel de comentário: legível nos 2 temas (mata texto-fantasma + caixa-preta + título vertical) ---- */
/* cabeçalho: empilha — no painel estreito o flex-row espremia o título a ~36px → virava texto vertical */
.qcomment .legacy-commentary-head { flex-direction: column; align-items: flex-start; gap: 8px; }
.qcomment .legacy-commentary-head strong { color: var(--ink); min-width: 0; display: flex; align-items: center; gap: 7px; font-size: 13.5px; }
.qcomment .legacy-badge-row { justify-content: flex-start; }
.qcomment .legacy-disclaimer { color: var(--ink3) !important; border-top: 1px solid rgba(127,127,127,.18); font-size: 12px; }
.qcomment .commentary-legacy, .qcomment .commentary-ai { background: transparent !important; border: 0 !important; width: 100%; max-width: 100%; box-sizing: border-box; }
.qcomment .legacy-body { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
/* seções: cartão de vidro (não a caixa branca legada) + texto legível (era var(--color-text) ≈ branco no claro) */
.qcomment .legacy-section { background: var(--glass); border: 1px solid rgba(127,127,127,.16); border-radius: 16px; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; overflow: hidden; }
.qcomment .legacy-section-label { color: var(--ink); }
.qcomment .legacy-section p { color: var(--ink2); overflow-wrap: anywhere; }
/* análise por alternativa: linhas de vidro (não mais caixa preta, que era var(--color-card) escuro) */
.qcomment .legacy-alts { width: 100%; max-width: 100%; min-width: 0; overflow: hidden; }
.qcomment .legacy-alt-row { background: var(--glass) !important; border: 1px solid rgba(127,127,127,.14) !important; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
.qcomment .legacy-alt-row span { color: var(--ink2); min-width: 0; overflow-wrap: anywhere; }
.qcomment .legacy-alt-row strong { background: rgba(127,127,127,.20) !important; border: 0 !important; color: var(--ink) !important; }
/* comentário oficial simples também legível */
.qcomment .commentary p { color: var(--ink2); }

/* ============================================================
   FASE 6 — FILTROS (área/assunto + "o que mais cai") no vidro.
   2 colunas .lgs (especialidade | assuntos), no-scroll (listas rolam
   dentro), segmented control "o que mais cai" como elemento-assinatura.
   ============================================================ */
.vesa-filters { height: calc(100dvh - 124px); display: flex; flex-direction: column; gap: 14px; }
.vesa-filters > * { min-height: 0; }
.vesa-filters .fil-top { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; flex-shrink: 0; }
.vesa-filters .fil-head { flex: 1; min-width: 200px; }
.vesa-filters .fil-eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); margin: 0; }
.vesa-filters .fil-title { font-size: clamp(22px, 3.2vw, 30px); font-weight: 500; letter-spacing: -.02em; color: var(--ink); margin: 6px 0 0; }
.vesa-filters .fil-title .it { font-family: "Source Serif 4", Georgia, serif; font-style: italic; font-weight: 400; color: var(--ink2); }
.vesa-filters .fil-source { width: 280px; max-width: 42vw; }
.vesa-filters .fil-source .source-select-field { display: flex; flex-direction: column; gap: 5px; margin: 0; }
.vesa-filters .fil-source .source-select-field > span { font-size: 12px; color: var(--ink2); }
.vesa-filters .mq-input {
  background: rgba(127,127,127,.10) !important; border: 1px solid rgba(127,127,127,.30) !important;
  color: var(--ink) !important; border-radius: 12px !important; padding: 11px 13px !important;
  font: inherit !important; box-shadow: none !important; width: 100%;
}
.vesa-filters .fil-count { font-size: 13px; color: var(--ink2); padding: 9px 15px; background: var(--glass); align-self: center; white-space: nowrap; }
.vesa-filters .fil-count b { color: var(--ink); font-weight: 600; }

.vesa-filters .fil-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 14px; }
.vesa-filters .fil-areas, .vesa-filters .fil-right { padding: 16px 18px; border-radius: 26px; background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.vesa-filters .fil-coltitle { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); margin: 0 0 12px; flex-shrink: 0; }
.vesa-filters .fil-arealist { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.vesa-filters .fil-area { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border: 0; border-radius: 16px; cursor: pointer; background: var(--glass); color: var(--ink2); font: inherit; text-align: left; transition: background .14s, color .14s, transform .14s; }
.vesa-filters .fil-area:hover { background: var(--glass-top); color: var(--ink); transform: translateX(2px); }
.vesa-filters .fil-area.on { background: var(--solid); color: var(--solid-ink); }
.vesa-filters .fil-area-name { font-size: 14px; }
.vesa-filters .fil-area-count { font-size: 12.5px; opacity: .75; }

.vesa-filters .fil-right-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-shrink: 0; margin-bottom: 12px; }
.vesa-filters .fil-coltitle--area { margin: 0; color: var(--ink); font-size: 15px; letter-spacing: 0; text-transform: none; font-weight: 600; }
.vesa-filters .fil-coltitle-sub { font-size: 12px; color: var(--ink3); flex-shrink: 0; }
.vesa-filters .fil-subjlist { flex: 1; min-height: 0; overflow: auto; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; padding-right: 4px; }
.vesa-filters .fil-subj { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; background: var(--glass); color: var(--ink2); cursor: pointer; font-size: 13px; height: fit-content; transition: background .14s, color .14s; }
.vesa-filters .fil-subj input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.vesa-filters .fil-subj:hover { background: var(--glass-top); color: var(--ink); }
.vesa-filters .fil-subj.on { background: var(--solid); color: var(--solid-ink); }
.vesa-filters .fil-subj-count { font-size: 12px; opacity: .7; }
.vesa-filters .fil-subj-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--ink3); text-align: center; }
.vesa-filters .fil-subj-empty p { font-size: 13.5px; max-width: 240px; margin: 0; }
.vesa-filters .fil-empty { font-size: 13px; color: var(--ink3); }

.vesa-filters .fil-bottom { flex-shrink: 0; border-top: 1px solid rgba(127,127,127,.16); margin-top: 12px; padding-top: 14px; }
.vesa-filters .fil-seglabel { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); margin-bottom: 8px; }
.vesa-filters .fil-seg-group { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--glass); max-width: 100%; flex-wrap: wrap; }
.vesa-filters .fil-seg { position: relative; display: inline-flex; align-items: center; padding: 7px 14px; border-radius: 999px; cursor: pointer; font-size: 12.5px; color: var(--ink2); transition: background .14s, color .14s; }
.vesa-filters .fil-seg input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.vesa-filters .fil-seg:hover { color: var(--ink); }
.vesa-filters .fil-seg.on { background: var(--solid); color: var(--solid-ink); font-weight: 600; }
.vesa-filters .fil-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.vesa-filters .fil-total { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.vesa-filters .fil-total .mq-num { font-size: 26px; font-weight: 700; color: var(--ink); font-family: "JetBrains Mono", ui-monospace, monospace; letter-spacing: -.02em; }
.vesa-filters .fil-total-lbl { font-size: 12.5px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vesa-filters .fil-actions { display: flex; gap: 9px; flex-shrink: 0; }

.vesa-filters .fil-arealist::-webkit-scrollbar, .vesa-filters .fil-subjlist::-webkit-scrollbar { width: 8px; }
.vesa-filters .fil-arealist::-webkit-scrollbar-thumb, .vesa-filters .fil-subjlist::-webkit-scrollbar-thumb { background: rgba(127,127,127,.32); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
.vesa-filters .fil-arealist, .vesa-filters .fil-subjlist { scrollbar-width: thin; scrollbar-color: rgba(127,127,127,.32) transparent; }

@media (max-width: 980px) {
  .vesa-filters { height: auto; }
  .vesa-filters .fil-grid { grid-template-columns: 1fr; }
  .vesa-filters .fil-arealist { max-height: 240px; }
}

/* ============================================================
   FASE 7 — CATÁLOGO read-only no vidro: Revisão (.vesa-review) e
   Anuladas (.vesa-annulled) compartilham .vesa-catalog + os cards
   .rev-q (<details>). No-scroll: a lista rola dentro do painel .lgs.
   ============================================================ */
.vesa-catalog { height: calc(100dvh - 124px); display: flex; flex-direction: column; gap: 12px; }
.vesa-catalog > * { min-height: 0; }
.vesa-catalog .cat-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex-shrink: 0; }
.vesa-catalog .cat-head { flex: 1; min-width: 180px; }
.vesa-catalog .cat-eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); margin: 0; }
.vesa-catalog .cat-title { font-size: clamp(22px, 3.2vw, 30px); font-weight: 500; letter-spacing: -.02em; color: var(--ink); margin: 5px 0 0; }
.vesa-catalog .cat-statusfield { display: flex; flex-direction: column; gap: 4px; }
.vesa-catalog .cat-statusfield > span { font-size: 11px; color: var(--ink3); text-transform: uppercase; letter-spacing: .08em; }
.vesa-catalog .mq-input { background: rgba(127,127,127,.10) !important; border: 1px solid rgba(127,127,127,.30) !important; color: var(--ink) !important; border-radius: 12px !important; padding: 10px 12px !important; font: inherit !important; box-shadow: none !important; min-width: 210px; }
.vesa-catalog .cat-count { font-size: 13px; color: var(--ink2); padding: 8px 14px; background: var(--glass); white-space: nowrap; align-self: center; }
.vesa-catalog .cat-count b { color: var(--ink); font-weight: 600; }
.vesa-catalog .cat-metrics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; flex-shrink: 0; }
.vesa-catalog .cat-metrics .metric-card { background: var(--panel) !important; border: 0 !important; border-radius: 18px !important; box-shadow: none !important; padding: 12px 14px !important; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.vesa-catalog .cat-metrics .mq-stat-label { font-size: 11px; color: var(--ink2) !important; display: inline-flex; align-items: center; gap: 6px; }
.vesa-catalog .cat-metrics .mq-stat-value { font-size: 22px; font-weight: 700; color: var(--ink) !important; font-family: "JetBrains Mono", ui-monospace, monospace; letter-spacing: -.02em; }
.vesa-catalog .cat-note { font-size: 12.5px; color: var(--ink3); margin: 0; flex-shrink: 0; display: flex; align-items: center; gap: 6px; }
.vesa-catalog .cat-note--amber { color: var(--amber); }
.vesa-catalog .cat-list { flex: 1; min-height: 0; overflow: auto; background: var(--panel); border-radius: 26px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.vesa-catalog .cat-empty { font-size: 13px; color: var(--ink3); padding: 8px; margin: 0; }

/* card de questão read-only (<details>) */
.vesa-catalog .rev-q { background: var(--glass); border-radius: 16px; overflow: hidden; flex-shrink: 0; }
.vesa-catalog .rev-q-sum { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; }
.vesa-catalog .rev-q-sum::-webkit-details-marker { display: none; }
.vesa-catalog .rev-q-badge { font-size: 10.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.vesa-catalog .rev-q-badge.st-green { background: rgba(94,194,122,.20); color: var(--ok); }
.vesa-catalog .rev-q-badge.st-amber { background: rgba(217,164,65,.20); color: var(--amber); }
.vesa-catalog .rev-q-badge.st-red { background: rgba(224,106,106,.20); color: #e06a6a; }
.vesa-catalog .rev-q-badge.st-violet { background: rgba(150,130,230,.22); color: #9a8ae6; }
.vesa-catalog .rev-q-badge.st-info { background: rgba(127,127,127,.18); color: var(--ink2); }
.vesa-catalog .rev-q-src { font-size: 13px; color: var(--ink); white-space: nowrap; flex-shrink: 0; }
.vesa-catalog .rev-q-snip { font-size: 12.5px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.vesa-catalog .rev-q-chev { color: var(--ink3); flex-shrink: 0; display: inline-flex; transition: transform .18s; }
.vesa-catalog .rev-q[open] .rev-q-chev { transform: rotate(90deg); }
.vesa-catalog .rev-q-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.vesa-catalog .rev-q-warn { font-size: 12.5px; color: var(--amber); display: flex; align-items: center; gap: 6px; margin: 0; }
.vesa-catalog .rev-q-meta { font-size: 11.5px; color: var(--ink3); margin: 0; }
.vesa-catalog .rev-q-statement { font-size: 14px; line-height: 1.6; color: var(--ink); }
.vesa-catalog .rev-q-alts { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.vesa-catalog .rev-q-alts li { display: flex; gap: 9px; font-size: 13.5px; color: var(--ink2); }
.vesa-catalog .rev-q-alts li strong { color: var(--ink); flex-shrink: 0; }
.vesa-catalog .rev-q-gab { font-size: 13px; color: var(--ink2); margin: 4px 0 0; }
.vesa-catalog .rev-q-gab b { color: var(--ink); }
.vesa-catalog .rev-q-reason { font-size: 12px; color: var(--ink3); margin: 0; }

.vesa-catalog .cat-list::-webkit-scrollbar { width: 8px; }
.vesa-catalog .cat-list::-webkit-scrollbar-thumb { background: rgba(127,127,127,.32); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
.vesa-catalog .cat-list { scrollbar-width: thin; scrollbar-color: rgba(127,127,127,.32) transparent; }

@media (max-width: 980px) {
  .vesa-catalog { height: auto; }
  .vesa-catalog .cat-metrics { grid-template-columns: repeat(2, 1fr); }
  .vesa-catalog .cat-list { max-height: 60vh; }
}

/* ============================================================
   FASE 8 — CADERNO DE ERROS no vidro. Header + lista de rows de vidro
   (dot de severidade, área/assunto, Q/origem, contagem, ações).
   No-scroll: lista rola dentro do painel; rows com flex-shrink:0.
   ============================================================ */
.vesa-errors { height: calc(100dvh - 124px); display: flex; flex-direction: column; gap: 14px; }
.vesa-errors > * { min-height: 0; }
.vesa-errors .err-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; flex-shrink: 0; }
.vesa-errors .err-head { min-width: 200px; }
.vesa-errors .err-eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); margin: 0; }
.vesa-errors .err-title { font-size: clamp(22px, 3.2vw, 30px); font-weight: 500; letter-spacing: -.02em; color: var(--ink); margin: 5px 0 0; }
.vesa-errors .err-title .it { font-family: "Source Serif 4", Georgia, serif; font-style: italic; font-weight: 400; color: var(--ink2); }
.vesa-errors .err-actions-top { display: flex; gap: 9px; flex-wrap: wrap; }
.vesa-errors .err-list { flex: 1; min-height: 0; overflow: auto; background: var(--panel); border-radius: 26px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.vesa-errors .err-row { flex-shrink: 0; display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 16px; background: var(--glass); }
.vesa-errors .err-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.vesa-errors .err-dot.sev-high { background: #e06a6a; }
.vesa-errors .err-dot.sev-medium { background: var(--amber); }
.vesa-errors .err-dot.sev-low { background: var(--ok); }
.vesa-errors .err-tax { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.vesa-errors .err-tax strong { font-size: 14px; color: var(--ink); }
.vesa-errors .err-tax span { font-size: 12px; color: var(--ink2); }
.vesa-errors .err-src { width: 156px; flex-shrink: 0; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.vesa-errors .err-src strong { font-size: 13px; color: var(--ink); }
.vesa-errors .err-src span { font-size: 11.5px; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vesa-errors .err-count { width: 78px; flex-shrink: 0; font-size: 12.5px; color: var(--ink2); }
.vesa-errors .err-count b { color: var(--ink); }
.vesa-errors .err-actions { display: flex; gap: 8px; flex-shrink: 0; }
.vesa-errors .err-actions .mq-btn { padding: 7px 13px !important; font-size: 12.5px !important; }
.vesa-errors .err-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--ink3); text-align: center; }
.vesa-errors .err-empty p { font-size: 13.5px; max-width: 260px; margin: 0; }
.vesa-errors .err-list::-webkit-scrollbar { width: 8px; }
.vesa-errors .err-list::-webkit-scrollbar-thumb { background: rgba(127,127,127,.32); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
.vesa-errors .err-list { scrollbar-width: thin; scrollbar-color: rgba(127,127,127,.32) transparent; }
@media (max-width: 980px) {
  .vesa-errors { height: auto; }
  .vesa-errors .err-row { flex-wrap: wrap; }
  .vesa-errors .err-src, .vesa-errors .err-count { width: auto; }
  .vesa-errors .err-actions { width: 100%; }
  .vesa-errors .err-list { max-height: 64vh; }
}

/* ============================================================
   FASE 9 — Retomar-sessão (card central) + Busca (painel na Home).
   ============================================================ */
.vesa-resume { min-height: calc(100dvh - 124px); display: flex; align-items: center; justify-content: center; }
.vesa-resume .resume-card { width: min(560px, 100%); padding: 30px 32px 26px; border-radius: 28px; background: var(--panel); }
.vesa-resume .resume-eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); margin: 0; }
.vesa-resume .resume-title { font-size: clamp(24px, 4vw, 32px); font-weight: 500; line-height: 1.06; letter-spacing: -.02em; color: var(--ink); margin: 8px 0 0; }
.vesa-resume .resume-title .it { font-family: "Source Serif 4", Georgia, serif; font-style: italic; font-weight: 400; color: var(--ink2); }
.vesa-resume .resume-sub { font-size: 14px; color: var(--ink2); margin: 10px 0 0; }
.vesa-resume .resume-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px; }
.vesa-resume .resume-metrics .metric-card { background: var(--glass) !important; border: 0 !important; box-shadow: none !important; border-radius: 14px !important; padding: 12px 13px !important; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.vesa-resume .resume-metrics .mq-stat-label { font-size: 11px; color: var(--ink2) !important; display: inline-flex; align-items: center; gap: 5px; }
.vesa-resume .resume-metrics .mq-stat-value { font-size: 17px; font-weight: 700; color: var(--ink) !important; font-family: "JetBrains Mono", ui-monospace, monospace; }
.vesa-resume .resume-metrics .mq-stat-sub { font-size: 10.5px; color: var(--ink3) !important; }
.vesa-resume .resume-bar { height: 8px; border-radius: 99px; background: rgba(127,127,127,.22); overflow: hidden; margin-top: 16px; }
.vesa-resume .resume-bar > span { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.vesa-resume .resume-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.vesa-resume .resume-note { font-size: 12px; color: var(--ink3); margin: 16px 0 0; line-height: 1.5; }

/* Busca: painel de vidro dentro da Home */
.vesa-home .vh-search { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-top: 12px; padding: 16px 20px; border-radius: 20px; background: var(--panel); }
.vesa-home .vh-search-info { flex: 1; min-width: 200px; }
.vesa-home .vh-search-eyebrow { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink3); margin: 0; }
.vesa-home .vh-search-title { font-size: 16px; font-weight: 600; color: var(--ink); margin: 4px 0 0; }
.vesa-home .vh-search-title b { color: var(--ink); font-family: "JetBrains Mono", ui-monospace, monospace; }
.vesa-home .vh-search-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.vesa-home .vh-search-list li { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.vesa-home .vh-search-list li strong { font-size: 12.5px; color: var(--ink); }
.vesa-home .vh-search-list li span { font-size: 12px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vesa-home .vh-search-actions { display: flex; gap: 9px; flex-shrink: 0; }

@media (max-width: 980px) { .vesa-resume { min-height: 0; padding: 12px 0 24px; } .vesa-resume .resume-metrics { grid-template-columns: 1fr; } }

/* ============================================================
   FASE D — Acessibilidade (WCAG): foco de teclado visível + reduce-motion.
   ============================================================ */
/* Foco de teclado visível (2.4.7 / 1.4.11): anel azul consistente, só no teclado (:focus-visible). */
.vesa-frame :focus-visible,
.qtooldock :focus-visible,
.theme-toggle:focus-visible {
  outline: 2.5px solid #4c8dff !important;
  outline-offset: 2px !important;
}
/* tira o anel "always-on" do mouse/legado, mantendo só o do teclado */
.vesa-frame :focus:not(:focus-visible),
.qtooldock :focus:not(:focus-visible),
.theme-toggle:focus:not(:focus-visible) { outline: none; }

/* Respeitar prefers-reduced-motion em toda a app (vídeo já some no #bg) */
@media (prefers-reduced-motion: reduce) {
  .vesa-frame *, .vesa-home *, .qtooldock *, .theme-toggle, .dock-tip {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  .vesa-frame *:hover, .vesa-home *:hover { transform: none !important; }
}

/* ============================================================
   FASE D — App-shell mobile (<=900px): header + barra de abas FIXOS;
   só o .workspace rola por dentro. A página nunca rola (regra de ouro nº7).
   Decisão do Gustavo (2026-06-16): app-shell. Bloco no fim = vence a cascata.
   ============================================================ */
@media (max-width: 980px) {
  /* o frame vira a "casca": coluna da altura da tela, sem rolar a página */
  .app-frame.vesa-frame {
    display: flex; flex-direction: column;
    height: 100dvh; min-height: 0; max-width: none;
    margin: 0; padding: 10px 12px 0; overflow: hidden;
  }
  .vesa-frame .vesa-header { flex: 0 0 auto; margin-bottom: 8px; }
  /* o conteúdo é o ÚNICO scroller (scrollbar fina de vidro) */
  .vesa-frame .workspace {
    flex: 1 1 auto; min-height: 0;
    overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
    padding: 0 2px 6px;
    scrollbar-width: thin; scrollbar-color: rgba(127,127,127,.32) transparent;
  }
  .vesa-frame .workspace::-webkit-scrollbar { width: 7px; }
  .vesa-frame .workspace::-webkit-scrollbar-thumb { background: rgba(127,127,127,.32); border-radius: 7px; border: 2px solid transparent; background-clip: content-box; }
  /* barra de abas: rodapé fixo do shell (não mais sticky dentro do scroll) */
  .vesa-frame .mobile-nav {
    position: static; flex: 0 0 auto; bottom: auto;
    margin: 6px 0 calc(env(safe-area-inset-bottom, 0px) + 6px);
  }
  .vesa-frame .mobile-nav .mq-nav-item strong { white-space: nowrap; font-size: 10px !important; letter-spacing: -.01em; }
  /* telas de coluna/lista relaxam a altura fixa → quem rola é o .workspace */
  .vesa-frame .qscreen,
  .vesa-frame .vesa-home,
  .vesa-frame .vesa-simres,
  .vesa-frame .vesa-filters,
  .vesa-frame .vesa-catalog,
  .vesa-frame .vesa-errors {
    height: auto; min-height: 0; max-height: none; overflow: visible;
  }
  /* cards centrados (setup do simulado e retomar): preenchem o workspace e centram; se estourar, o workspace rola */
  .vesa-frame .vesa-sim,
  .vesa-frame .vesa-resume {
    height: auto; min-height: 100%; max-height: none; overflow: visible;
  }
  /* listas/painéis internos: sem cap de altura no mobile (um scroll só, o do workspace) */
  .vesa-frame .vesa-filters .fil-arealist,
  .vesa-frame .vesa-catalog .cat-list,
  .vesa-frame .vesa-errors .err-list,
  .vesa-frame .qnav,
  .vesa-frame .qnav .qnavgrid,
  .vesa-frame .qpanel-scroll,
  .vesa-frame .qcomment {
    max-height: none; overflow: visible;
  }
  /* alvo de toque (D3): botões >=44px no mobile (eram ~38px) */
  .vesa-frame .mq-btn { min-height: 44px; }
  /* botões flutuantes sobem pra não cobrir a barra de abas */
  html[data-view="question"] .qtooldock { bottom: 84px; }
}

/* ============================================================
   FASE D — Questão no mobile: navegador colapsável (sheet) + comentário em bottom-sheet.
   Decisão do Gustavo (2026-06-16): refinar a UX da Questão no celular.
   ============================================================ */
.qnav-toggle, .qcomment-handle { display: none; }
@media (max-width: 900px) {
  /* toggle do navegador — pílula no topo da questão (alvo >=44px) */
  .qnav-toggle {
    display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
    min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer;
    background: var(--glass); color: var(--ink);
    font: 600 13px "Poppins", system-ui, sans-serif;
  }
  .qnav-toggle .qnav-toggle-ic { display: flex; }
  /* navegador some por padrão e abre como sheet sobre a tela */
  .vesa-frame .qscreen .qnav { display: none; }
  html[data-qnav-open] .vesa-frame .qscreen .qnav {
    display: flex; position: fixed; left: 12px; right: 12px; top: 78px; z-index: 80;
    width: auto; max-height: 68vh; overflow: auto; margin: 0;
  }
  .qnav-scrim { display: none; }
  html[data-qnav-open] .qnav-scrim {
    display: block; position: fixed; inset: 0; z-index: 79;
    background: rgba(6,7,10,.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  }
  .qcomment-scrim {
    display: block; position: fixed; inset: 0; z-index: 81;
    background: rgba(6,7,10,.24);
  }
  html[data-qcomment-closed] .qcomment-scrim { display: none; }
  .qcomment-reopen {
    display: none; align-items: center; gap: 7px; flex-shrink: 0;
    min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; cursor: pointer;
    background: var(--glass); color: var(--ink);
    font: 600 13px "Poppins", system-ui, sans-serif;
  }
  html[data-qcomment-closed] .qcomment-reopen { display: inline-flex; }
  html[data-qcomment-closed] .vesa-frame .qcomment.show { display: none; }
  /* comentário vira bottom-sheet flutuante (acima da barra de abas); recolhe na alça */
  .vesa-frame .qcomment.show {
    position: fixed; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 80px); z-index: 82;
    width: auto; height: min(70dvh, calc(100dvh - 130px - env(safe-area-inset-bottom, 0px))); max-height: calc(100dvh - 130px - env(safe-area-inset-bottom, 0px));
    display: flex; flex-direction: column;
    overflow: hidden; overscroll-behavior: contain; margin: 0;
    border-radius: 22px; box-shadow: 0 14px 36px rgba(0,0,0,.42);
    padding: 0;
    contain: layout paint;
    clip-path: inset(0 round 22px);
  }
  html[data-qcomment-collapsed] .vesa-frame .qcomment.show { height: 48px; overflow: hidden; }
  html[data-qcomment-collapsed] .vesa-frame .qcomment-scroll { display: none; }
  .qcomment-mobilebar {
    display: grid; grid-template-columns: 48px 1fr 48px; align-items: center;
    flex: 0 0 48px; min-height: 48px;
    background: color-mix(in srgb, var(--panel) 92%, transparent);
    position: relative; z-index: 2;
    -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
    touch-action: none;
    -webkit-user-select: none; user-select: none;
  }
  .qcomment-close {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; padding: 0; border: 0; background: transparent;
    color: var(--ink); cursor: pointer;
  }
  .qcomment-close svg { width: 20px; height: 20px; }
  .qcomment-mobilebar-spacer { width: 48px; height: 48px; }
  .qcomment-handle {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 48px; min-height: 48px; margin: 0;
    border: 0; background: transparent; cursor: pointer;
    position: relative; z-index: 2;
    touch-action: none;
    -webkit-user-select: none; user-select: none;
  }
  .vesa-frame .qcomment.show .qcomment-scroll {
    flex: 1 1 auto; min-height: 0; max-height: none;
    overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
    padding: 0 20px 18px;
  }
  .qcomment-handle-bar { width: 42px; height: 4px; border-radius: 999px; background: var(--ink3); }
}

/* ============================================================
   FASE D2 — mobile narrow polish (2026-06-18).
   Corrige iPhone 360–414px: login sem scroll da página, header mais
   compacto, metadados quebráveis, comentário sem dock por cima.
   ============================================================ */
@media (max-width: 480px) {
  .auth-screen.chisei-login {
    height: 100dvh;
    min-height: 100dvh;
    overflow-y: auto;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    padding: calc(env(safe-area-inset-top, 0px) + 18px) 0 calc(env(safe-area-inset-bottom, 0px) + 18px);
    box-sizing: border-box;
  }
  .chisei-login .login-visual {
    padding: 18px 24px 8px;
    min-height: 0;
  }
  .chisei-login .login-brand {
    font-size: clamp(42px, 13vw, 56px);
    margin-bottom: 6px;
  }
  .chisei-login .login-headline {
    font-size: clamp(34px, 10vw, 44px);
    margin-top: 16px;
  }
  .chisei-login .login-tag {
    font-size: 14px;
    line-height: 1.45;
    margin-top: 12px;
  }
  .chisei-login .login-chips {
    justify-content: center;
    gap: 7px;
    margin-top: 16px;
  }
  .chisei-login .login-chips span {
    padding: 6px 11px;
    font-size: 11.5px;
  }
  .chisei-login .login-stat {
    margin-top: 18px;
    padding: 12px 16px;
  }
  .login-stat-num { font-size: 26px; }
  .chisei-login .login-form-panel {
    width: min(420px, calc(100vw - 24px));
    margin: 14px auto 0;
    padding: 30px 24px 24px;
    border-radius: 28px;
  }

  .app-frame.vesa-frame {
    padding: calc(env(safe-area-inset-top, 0px) + 8px) 10px 0;
  }
  .vesa-frame .vesa-header {
    min-height: 58px;
    gap: 8px;
    padding: 9px 62px 9px 14px;
    border-radius: 28px;
  }
  .vesa-header .vesa-logo {
    font-size: clamp(31px, 9.4vw, 38px);
    margin-right: 0;
  }
  .vesa-frame .vesa-user {
    display: none;
  }
  .vesa-frame .vesa-search {
    margin-left: auto;
    min-width: 46px;
    max-width: 46px;
  }
  .vesa-frame .vesa-search:focus-within,
  .vesa-frame .vesa-search:has(.mq-input:not(:placeholder-shown)) {
    min-width: min(168px, calc(100vw - 188px));
    max-width: min(168px, calc(100vw - 188px));
  }
  .qtopline {
    align-items: flex-start;
    gap: 8px;
  }
  .qtopline-meta {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .qtopline-prog {
    padding: 7px 11px;
    white-space: nowrap;
  }
  .qpanel-scroll {
    padding: 18px 18px 8px;
  }
  .qactions {
    padding: 10px 18px 14px;
  }
  .qmeta {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
  .qmeta-tax,
  .qmeta-src {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .qmeta-src {
    line-height: 1.35;
  }
  html[data-view="question"]:has(.qcomment.show) .qtooldock {
    display: none;
  }

  .vesa-catalog .cat-top {
    gap: 10px;
  }
  .vesa-catalog .cat-statusfield,
  .vesa-catalog .mq-input {
    width: 100%;
    min-width: 0;
  }
  .vesa-catalog .cat-count {
    align-self: flex-start;
  }
  .vesa-catalog .cat-metrics {
    gap: 8px;
  }
  .vesa-catalog .cat-metrics .metric-card {
    min-width: 0;
    padding: 11px 12px !important;
  }
  .vesa-catalog .cat-metrics .mq-stat-label {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .vesa-catalog .rev-q-sum {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
  }
  .vesa-catalog .rev-q-src {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .vesa-catalog .rev-q-snip {
    flex: 1 0 100%;
    order: 4;
  }
  .vesa-catalog .rev-q-chev {
    width: 22px;
    justify-content: flex-end;
    margin-left: auto;
  }

  .vesa-filters .fil-top {
    gap: 12px;
  }
  .vesa-filters .fil-source,
  .vesa-filters .fil-source .field,
  .vesa-filters .fil-source .mq-input {
    width: 100%;
    min-width: 0;
  }
  .vesa-filters .fil-count {
    align-self: flex-start;
  }
  .vesa-filters .fil-right-head,
  .vesa-filters .fil-footer,
  .vesa-filters .fil-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .vesa-filters .fil-actions .mq-btn {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .vesa-header .vesa-logo {
    font-size: clamp(29px, 9.2vw, 34px);
  }
  .vesa-frame .vesa-search:focus-within,
  .vesa-frame .vesa-search:has(.mq-input:not(:placeholder-shown)) {
    min-width: min(148px, calc(100vw - 174px));
    max-width: min(148px, calc(100vw - 174px));
  }
  .vesa-frame .mobile-nav {
    gap: 4px;
    padding-inline: 6px;
  }
  .vesa-frame .mobile-nav .mq-nav-item {
    padding-inline: 2px !important;
  }
  .vesa-frame .mobile-nav .mq-nav-item strong {
    font-size: 9.5px !important;
  }
}
