/* ============================================================
   d1or Panel — camada "pro": shell, dashboard, módulos e formulário.
   Carregado por último. Usa só variáveis do tema, então funciona
   igual no escuro e no claro (theme.css redefine as variáveis).
   ============================================================ */

:root {
  --hover: color-mix(in srgb, var(--txt) 5%, transparent);
  --accent-soft: color-mix(in srgb, var(--violet-hi) 14%, transparent);
  --accent-line: color-mix(in srgb, var(--violet-hi) 42%, var(--line));
  --r-lg: 14px;
  --r-md: 10px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --meter-on: var(--violet-hi);
  --accent-solid: #0f766e;
  --accent-solid-hi: #13867c;
}

/* sem brilho nem grade de fundo; sem gradiente nem elevação nos botões */
body::before, body::after { content: none; }
.status::before { box-shadow: none; }
.btn:hover { transform: none; }
.btn:not(.btn-primary):not(.btn-danger):hover { background: var(--hover); border-color: var(--line-strong); }
.btn-primary { background: var(--accent-solid); border-color: transparent; color: #fff; box-shadow: none; }
.btn-primary:hover { background: var(--accent-solid-hi); box-shadow: none; }

body { font-feature-settings: 'tnum' 1, 'cv11' 1; }

/* ---------- superfícies base: grafite liso, sem o brilho roxo antigo ---------- */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--txt) 4%, transparent);
}
.table-wrap { background: var(--surface); border-radius: var(--r-lg); }
.input, input[type=text], input[type=email], input[type=password], input[type=number], input:not([type]), select, textarea {
  background: var(--bg);
  border-radius: var(--r-md);
}
.input:focus, input:focus, select:focus, textarea:focus {
  border-color: var(--violet-hi);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--bg);
}
.btn { border-radius: var(--r-md); }
.icon-btn { border-radius: var(--r-md); }

.eyebrow { letter-spacing: 0.14em; font-size: 10.5px; }
.page-head h1 { letter-spacing: -0.025em; }

/* ---------- barra superior (desktop) ---------- */
@media (min-width: 981px) {
  .d-side {
    height: 64px; gap: 32px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(14px);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
  }
  .d-menu { align-items: center; gap: 2px; }
  .d-menu button {
    height: 36px; padding: 0 14px; border: 0; border-radius: 8px;
    color: var(--muted); font-weight: 500; font-size: 13.5px;
    transition: background 0.15s, color 0.15s;
  }
  .d-menu button:hover { background: var(--hover); color: var(--txt); }
  .d-menu button.active { background: var(--surface-2); color: var(--txt); border: 0; box-shadow: inset 0 0 0 1px var(--line); }
  .d-side-foot { gap: 10px; }
  .d-user { padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); gap: 8px; }
  .d-user i { width: 28px; height: 28px; font-size: 11px; background: var(--accent-soft); border: 0; color: var(--violet-hi); }
  .d-user span b { font-size: 12.5px; font-weight: 600; }
  .d-menu-out { height: 34px; border-radius: 8px; font-size: 13px; }
  .content { max-width: 1240px; padding-top: 36px; }
  .result-toolbar { top: 76px; }
}

/* ---------- tags e chips ---------- */
.dx-tag {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 52px; padding: 4px 9px; border-radius: 6px;
  font: 500 11.5px/1 var(--mono); letter-spacing: 0.02em;
  color: var(--violet-hi); background: var(--accent-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dx-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; color: var(--txt-dim);
  border: 1px solid var(--line-strong); background: var(--surface-2);
}
.dx-chip.paid { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.dx-chip.admin { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }

/* ============================================================
   DASHBOARD
   ============================================================ */
.dx-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 20px; }
.dx-head h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.dx-date { margin-top: 4px; font-size: 13.5px; color: var(--muted); }
.dx-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dx-actions .btn { height: 36px; font-size: 13px; }

.upgrade-card, .plan-card { margin-bottom: 20px; padding: 16px 20px; border-radius: var(--radius); }
.upgrade-card { background: var(--surface-2); border-color: var(--line-strong); }
.upgrade-card h3, .plan-card h3 { font-size: 15px; }

/* faixa de cota: o dado principal da tela */
.dx-band { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.dx-band-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px 0; }
.dx-band-head h2 { font-size: 14px; font-weight: 600; }
.dx-band-main { display: grid; grid-template-columns: minmax(190px, auto) minmax(0, 1fr); gap: 20px 48px; align-items: end; padding: 14px 20px 20px; }
.dx-remain b { display: block; font-size: 56px; line-height: 1; font-weight: 500; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.dx-remain span { display: block; margin-top: 8px; font-size: 13.5px; color: var(--muted); }
.dx-band[data-tone="low"] .dx-remain b { color: var(--warn); }
.dx-band[data-tone="out"] .dx-remain b { color: var(--bad); }
.dx-meter { display: flex; gap: 3px; height: 12px; }
.dx-meter.segs i { flex: 1; min-width: 0; border-radius: 2px; background: var(--surface-3); }
.dx-meter.segs i.on { background: var(--meter-on); }
.dx-meter.segs.low i.on { background: var(--warn); }
.dx-meter.bar { display: block; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.dx-meter.bar i { display: block; height: 100%; background: var(--meter-on); }
.dx-meter.bar.low i { background: var(--warn); }
.dx-meter.full i { flex: 1; border-radius: 2px; background: var(--meter-on); opacity: 0.35; }
.dx-meter-cap { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 20px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.dx-links { display: flex; align-items: center; gap: 16px; }
.dx-band .ledger { border: 0; border-top: 1px solid var(--line); border-radius: 0; }

.dx-link { background: none; border: 0; padding: 0; color: var(--violet-hi); font: 500 12.5px var(--font); text-decoration: none; cursor: pointer; }
.dx-link:hover { text-decoration: underline; text-underline-offset: 3px; color: var(--violet-hi); }

.dx-main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; margin: 16px 0 32px; align-items: start; }
.dx-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.dx-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.dx-panel-head h2 { font-size: 14px; font-weight: 600; }

/* atividade recente */
.dx-row {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  width: 100%; padding: 11px 18px; border: 0; border-bottom: 1px solid var(--line);
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background 0.12s;
}
.dx-row:last-child { border-bottom: 0; }
.dx-row:hover { background: var(--hover); }
.dx-row:focus-visible, .dx-cat:focus-visible { outline: 2px solid var(--violet-hi); outline-offset: -2px; }
.dx-row .dx-tag { justify-content: flex-start; min-width: 0; padding: 0; background: none; color: var(--muted); }
.dx-row-main { min-width: 0; }
.dx-row-main strong { display: block; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-row-main small { display: block; margin-top: 1px; font: 12px var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-row-time { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dx-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 44px 24px; }
.dx-empty strong { font-size: 15px; }
.dx-empty p { color: var(--muted); font-size: 13.5px; max-width: 34ch; margin-bottom: 10px; }

/* módulos por categoria: lista, não tiles */
.dx-cats { display: flex; flex-direction: column; }
.dx-cat {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%;
  padding: 10px 18px; border: 0; border-bottom: 1px solid var(--line); background: none;
  color: inherit; font: 500 13.5px var(--font); text-align: left; cursor: pointer; transition: background 0.12s;
}
.dx-cat:last-child { border-bottom: 0; }
.dx-cat:hover { background: var(--hover); }
.dx-cat em { font-style: normal; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* quadro de números compartilhado (dashboard e administração): células separadas por fio, sem cartões soltos */
.ledger { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ledger.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ledger > div { min-width: 0; padding: 14px 20px; background: var(--surface); }
.ledger small { display: block; font-size: 12.5px; color: var(--muted); }
.ledger strong { display: block; margin-top: 3px; font-size: 22px; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger strong.bad { color: var(--bad); }
.ledger em { display: block; margin-top: 2px; font-style: normal; font-size: 12px; color: var(--muted); }
@media (max-width: 1100px) { .ledger { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ledger.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ledger.cols-3 > div { padding: 12px 14px; } .ledger.cols-3 small { font-size: 12px; white-space: nowrap; } .ledger.cols-3 strong { font-size: 17px; } }

/* ============================================================
   MÓDULOS
   ============================================================ */
.mx-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.mx-head h1 { font-size: clamp(24px, 2.6vw, 30px); font-weight: 650; letter-spacing: -0.03em; margin: 8px 0 6px; }
.mx-head p.sub { color: var(--muted); font-size: 14px; }

.mx-search { position: relative; display: block; width: min(340px, 100%); }
.mx-search > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.mx-search .input { height: 42px; padding: 0 40px 0 38px; font-size: 14px; }
.mx-search kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  min-width: 22px; padding: 2px 6px; text-align: center; border-radius: 5px;
  font: 500 11px var(--mono); color: var(--muted); border: 1px solid var(--line-strong); background: var(--surface-2);
}

.mx-tabs {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 14px; margin-bottom: 8px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.mx-tabs::-webkit-scrollbar { display: none; }
.mx-tab {
  display: inline-flex; align-items: center; gap: 8px; flex: none; height: 34px; padding: 0 13px;
  border-radius: 99px; border: 1px solid var(--line); background: var(--surface);
  color: var(--txt-dim); font: 500 13px var(--font); cursor: pointer; transition: 0.15s;
}
.mx-tab em { font-style: normal; font: 500 11px var(--mono); color: var(--muted); }
.mx-tab:hover { border-color: var(--line-strong); color: var(--txt); }
.mx-tab.active { background: var(--violet-hi); border-color: var(--violet-hi); color: #042f2a; }
.mx-tab.active em { color: color-mix(in srgb, #042f2a 70%, transparent); }
html[data-theme="light"] .mx-tab.active { background: #0f766e; border-color: #0f766e; color: #fff; }
html[data-theme="light"] .mx-tab.active em { color: rgba(255, 255, 255, 0.75); }

.mod-group { margin-bottom: 34px; }
.mx-ghead { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.mx-ghead h2 { font-size: 14px; font-weight: 600; letter-spacing: 0.01em; }
.mx-ghead span { font: 500 11.5px var(--mono); color: var(--muted); }
.mx-ghead::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.mx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.mx-card {
  position: relative; display: flex; flex-direction: column; gap: 14px; min-height: 176px;
  padding: 18px; text-align: left; cursor: pointer; font: inherit; color: inherit;
  border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--txt) 4%, transparent);
  transition: border-color 0.18s, transform 0.18s var(--ease), background 0.18s, box-shadow 0.18s;
}
.mx-card:hover {
  transform: translateY(-3px); border-color: var(--accent-line); background: var(--surface-2);
  box-shadow: 0 18px 34px -22px color-mix(in srgb, var(--violet-hi) 55%, transparent);
}
.mx-card:focus-visible { outline: 2px solid var(--violet-hi); outline-offset: 2px; }
.mx-card-top { display: flex; justify-content: space-between; align-items: center; }
.mx-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--violet-hi); }
.mx-ic svg { width: 18px; height: 18px; }
.mx-card-body strong { display: block; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.mx-card-body small { display: block; margin-top: 5px; font-size: 13px; line-height: 1.5; color: var(--txt-dim); }
.mx-card-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto;
  padding-top: 12px; border-top: 1px dashed var(--line);
}
.mx-params { display: flex; gap: 6px; min-width: 0; flex: 1; }
.mx-params span {
  padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 500; white-space: nowrap;
  color: var(--txt-dim); background: var(--surface-3); border: 1px solid var(--line);
  overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.mx-params span.more { flex: none; font-family: var(--mono); color: var(--muted); }
.mx-go { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 12px; color: var(--muted); }
.mx-go svg { width: 15px; height: 15px; color: var(--violet-hi); transition: transform 0.18s var(--ease); }
.mx-card:hover .mx-go svg { transform: translateX(4px); }

.mod-group.hidden, .mx-card.hidden { display: none !important; }

/* ============================================================
   FORMULÁRIO DO MÓDULO
   ============================================================ */
.fx-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; font-size: 13px; color: var(--muted); }
.fx-crumbs button { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--txt-dim); font: 500 13px var(--font); cursor: pointer; padding: 0; }
.fx-crumbs button:hover { color: var(--violet-hi); }
.fx-crumbs button svg { width: 15px; height: 15px; }
.fx-crumbs i { font-style: normal; opacity: 0.5; }
.fx-crumbs b { font-weight: 500; color: var(--txt); }

.fx-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.fx-layout > .upgrade-card { grid-column: 1 / -1; margin: 0 !important; }
.fx-info { position: sticky; top: 88px; padding: 24px; }
.fx-info .mx-ic { width: 46px; height: 46px; border-radius: 12px; margin-bottom: 18px; }
.fx-info .mx-ic svg { width: 22px; height: 22px; }
.fx-info h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.025em; margin: 8px 0 8px; }
.fx-info > p:not(.eyebrow) { color: var(--txt-dim); font-size: 14px; line-height: 1.55; }
.fx-meta { margin-top: 22px; border-top: 1px solid var(--line); }
.fx-meta div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.fx-meta dt { color: var(--muted); }
.fx-meta dd { font: 500 13px var(--mono); text-align: right; }

.fx-layout .consult-box { padding: 26px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-lg); box-shadow: inset 0 1px 0 color-mix(in srgb, var(--txt) 4%, transparent); }
.fx-form h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.fx-form > p { margin: 4px 0 22px; color: var(--muted); font-size: 13.5px; }
.fx-form .consult-form { max-width: none; margin: 0; gap: 20px; }
.fx-form .consult-params { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.fx-form .field > span { font-size: 12.5px; font-weight: 600; color: var(--txt-dim); }
.fx-form .consult-param { height: 46px; font-family: var(--mono); font-size: 14.5px; }
.fx-form .btn-primary { align-self: flex-start; height: 46px; padding: 0 28px; }
.fx-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--txt-dim); line-height: 1.5; }
.fx-note svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--violet-hi); }

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 1100px) {
  .dx-main { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .fx-layout { grid-template-columns: 1fr; }
  .fx-info { position: static; }
}
@media (max-width: 720px) {
  .dx-head { margin-bottom: 20px; }
  .dx-actions { width: 100%; }
  .dx-actions .btn { flex: 1; }
  .dx-band-head { padding: 14px 16px 0; }
  .dx-band-main { grid-template-columns: 1fr; gap: 16px; padding: 12px 16px 18px; }
  .dx-remain b { font-size: 44px; }
  .dx-row { grid-template-columns: 54px minmax(0, 1fr); padding: 12px 16px; gap: 12px; }
  .dx-row-time { grid-column: 2; margin-top: -6px; }
  .mx-grid { grid-template-columns: 1fr; }
  .mx-card { min-height: 0; }
  .mx-search { width: 100%; }
  .mx-search kbd { display: none; }
  .fx-layout .consult-box { padding: 20px; }
  .fx-form .btn-primary { align-self: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .mx-card, .dx-cat, .dx-row, .au-row, .au-toggle svg { transition: none; }
  .mx-card:hover { transform: none; }
}

/* ---------- mobile: cards de módulo compactos (ícone + nome + seta) ---------- */
@media (max-width: 720px) {
  .mx-card { display: grid; grid-template-columns: 38px minmax(0, 1fr) 18px; align-items: center; gap: 12px; padding: 14px; }
  .mx-card:hover { transform: none; }
  .mx-card-top { display: contents; }
  .mx-card .dx-tag { display: none; }
  .mx-card-body small { margin-top: 2px; font-size: 12.5px; }
  .mx-card-foot { display: block; margin: 0; padding: 0; border: 0; }
  .mx-params { display: none; }
  .mx-grid { gap: 10px; }
  .dx-row .dx-tag { font-size: 10.5px; min-width: 0; width: 100%; padding: 4px 6px; }
  .dx-row { grid-template-columns: 62px minmax(0, 1fr); }
}

/* ============================================================
   CONTA (perfil)
   ============================================================ */
.pf-hero {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; padding: 22px 24px;
  border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--txt) 4%, transparent);
}
.pf-avatar {
  display: grid; place-items: center; flex: none; width: 64px; height: 64px; border-radius: 18px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--violet-hi) 28%, transparent), var(--accent-soft));
  border: 1px solid var(--accent-line); color: var(--violet-hi); font: 600 22px var(--mono); letter-spacing: -0.02em;
}
.pf-id { min-width: 0; flex: 1; }
.pf-id h2 { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-id p { margin-top: 2px; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-facts { display: flex; gap: 0; }
.pf-facts > div { padding: 0 22px; border-left: 1px solid var(--line); }
.pf-facts > div:first-child { border-left: 0; }
.pf-facts > div:last-child { padding-right: 0; }
.pf-facts dt { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
.pf-facts dd { font-size: 13.5px; min-height: 24px; display: flex; align-items: center; }
.pf-facts dd.mono { font-family: var(--mono); font-weight: 500; }

.pf-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 28px; align-items: start; }
.pf-nav { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 2px; }
.pf-nav button {
  display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 12px; border: 0; border-radius: 8px;
  background: none; color: var(--muted); font: 500 13.5px var(--font); text-align: left; cursor: pointer; transition: 0.15s;
}
.pf-nav button svg { width: 16px; height: 16px; flex: none; }
.pf-nav button:hover { background: var(--hover); color: var(--txt); }
.pf-nav button.active { background: var(--surface-2); color: var(--txt); box-shadow: inset 0 0 0 1px var(--line); }
.pf-nav button.active svg { color: var(--violet-hi); }

.pf-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pf-card {
  scroll-margin-top: 88px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); overflow: hidden;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--txt) 4%, transparent);
}
.pf-card-head { padding: 20px 24px 0; }
.pf-card-head h2, .pf-session h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.pf-card-head p, .pf-session p { margin-top: 4px; color: var(--muted); font-size: 13.5px; line-height: 1.55; max-width: 62ch; }
.pf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; padding: 20px 24px 6px; }
.pf-grid .field { margin-bottom: 16px; }
.pf-span { grid-column: 1 / -1; }
.pf-span .field { max-width: calc(50% - 9px); }
.pf-grid .field label { font-size: 12.5px; font-weight: 600; color: var(--txt-dim); }
.pf-grid .input { height: 44px; }
.pf-grid .input:disabled { opacity: 0.7; cursor: not-allowed; background: var(--surface-2); }
.pf-grid .pin-input { font-family: var(--mono); letter-spacing: 0.3em; }
.pf-foot { display: flex; justify-content: flex-end; padding: 14px 24px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--txt) 2.5%, transparent); }
.pf-foot .btn { height: 40px; }

.pf-pass { position: relative; }
.pf-pass .input { padding-right: 44px; }
.pf-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: grid; place-items: center;
  width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer;
}
.pf-eye:hover { color: var(--txt); background: var(--hover); }
.pf-eye svg { width: 17px; height: 17px; }

.pf-session { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 20px 24px; }
.pf-session .btn { flex: none; }

@media (max-width: 980px) {
  .pf-layout { grid-template-columns: 1fr; gap: 16px; }
  .pf-nav { position: static; flex-direction: row; overflow-x: auto; gap: 8px; padding-bottom: 4px; scrollbar-width: none; }
  .pf-nav::-webkit-scrollbar { display: none; }
  .pf-nav button { flex: none; height: 34px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); }
  .pf-card { scroll-margin-top: 76px; }
}
@media (max-width: 720px) {
  .pf-hero { padding: 18px; gap: 14px; }
  .pf-avatar { width: 52px; height: 52px; border-radius: 14px; font-size: 18px; }
  .pf-facts { width: 100%; padding-top: 14px; border-top: 1px solid var(--line); }
  .pf-facts > div { padding: 0 16px; }
  .pf-facts > div:first-child { padding-left: 0; }
  .pf-grid { grid-template-columns: 1fr; padding: 18px 18px 4px; }
  .pf-span .field { max-width: none; }
  .pf-card-head { padding: 18px 18px 0; }
  .pf-foot { padding: 12px 18px; }
  .pf-foot .btn { width: 100%; }
  .pf-session { padding: 18px; }
  .pf-session .btn { width: 100%; }
}

/* Conta: botão de sair discreto (o .btn-danger global é sólido, feito para diálogos de confirmação) */
.pf-session .btn-danger {
  background: color-mix(in srgb, var(--bad) 8%, transparent); color: var(--bad);
  border: 1px solid color-mix(in srgb, var(--bad) 38%, transparent); box-shadow: none;
}
.pf-session .btn-danger:hover { background: color-mix(in srgb, var(--bad) 16%, transparent); border-color: color-mix(in srgb, var(--bad) 60%, transparent); }
.pf-grid .pin-input { text-align: left; }

/* ============================================================
   RESULTADO: resumo (só o essencial) + "Todos os dados"
   ============================================================ */
.result-viewer.is-searching .rs { display: none; }

.rs { display: flex; flex-direction: column; gap: 14px; }
.rs-hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 22px 24px; }
.rs-hero-main { flex: 1; min-width: 220px; }
.rs-hero h2 { margin: 8px 0 4px; font-size: clamp(20px, 2.4vw, 26px); font-weight: 650; letter-spacing: -0.025em; overflow-wrap: anywhere; }
.rs-sub { color: var(--txt-dim); font-size: 14px; }
.rs-hero .btn { height: 38px; }

/* placa (estilo Mercosul) */
.rs-plate {
  position: relative; display: grid; place-items: center; min-width: 168px; padding: 18px 18px 8px;
  border-radius: 8px; border: 2px solid #1b1b1b; background: #f5f5f0; color: #141414; overflow: hidden;
}
.rs-plate i { position: absolute; top: 0; left: 0; right: 0; height: 9px; background: #1d4ed8; }
.rs-plate b { font: 700 26px/1 var(--mono); letter-spacing: 0.14em; padding-left: 0.14em; }

/* alertas */
.rs-alerts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; }
.rs-alert {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: var(--r-md);
  border: 1px solid; background: transparent;
}
.rs-alert-ic { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 8px; }
.rs-alert-ic svg { width: 17px; height: 17px; }
.rs-alert strong { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.rs-alert p {
  margin-top: 3px; font-size: 12.5px; line-height: 1.45; color: var(--txt-dim);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rs-alert.danger { border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: color-mix(in srgb, var(--bad) 9%, transparent); }
.rs-alert.danger .rs-alert-ic { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.rs-alert.warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 9%, transparent); }
.rs-alert.warn .rs-alert-ic { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.rs-alert.ok { border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: color-mix(in srgb, var(--ok) 8%, transparent); align-items: center; }
.rs-alert.ok .rs-alert-ic { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }

/* grupos de campos */
.rs-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 14px; align-items: start; }
.rs-group { border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); overflow: hidden; box-shadow: inset 0 1px 0 color-mix(in srgb, var(--txt) 4%, transparent); }
.rs-group h3 { padding: 14px 18px; font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.rs-field {
  display: flex; justify-content: space-between; align-items: baseline; gap: 18px; width: 100%;
  padding: 11px 18px; border: 0; border-top: 1px solid var(--line); background: none; color: inherit;
  font: inherit; text-align: left; cursor: pointer; transition: background 0.12s;
}
.rs-field:hover { background: var(--hover); }
.rs-field:focus-visible { outline: 2px solid var(--violet-hi); outline-offset: -2px; }
.rs-field span { flex: none; font-size: 12.5px; color: var(--muted); }
.rs-field strong { min-width: 0; font: 600 13.5px/1.4 var(--mono); text-align: right; overflow-wrap: anywhere; }

.rs-lists { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rs-lists > span { font-size: 12.5px; color: var(--muted); margin-right: 2px; }
.rs-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface); color: var(--txt-dim); font: 500 12.5px var(--font); cursor: pointer; transition: 0.15s;
}
.rs-chip em { font: 500 11px var(--mono); font-style: normal; color: var(--violet-hi); }
.rs-chip:hover { border-color: var(--accent-line); color: var(--txt); }

/* dados completos recolhidos */
.rs-all { border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.rs-all > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px;
  list-style: none; cursor: pointer; font-size: 14.5px; font-weight: 600; transition: background 0.12s;
}
.rs-all > summary::-webkit-details-marker { display: none; }
.rs-all > summary:hover { background: var(--hover); }
.rs-all > summary em { margin-left: auto; font: 500 12px var(--mono); font-style: normal; color: var(--muted); }
.rs-all > summary::after {
  content: ''; flex: none; width: 8px; height: 8px; margin-left: 4px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px); transition: transform 0.2s var(--ease);
}
.rs-all[open] > summary { border-bottom: 1px solid var(--line); }
.rs-all[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.rs-all-body { display: flex; flex-direction: column; gap: 14px; padding: 14px; background: var(--bg); }

@media (max-width: 720px) {
  .rs-hero { padding: 18px; }
  .rs-hero .btn { width: 100%; }
  .rs-plate { width: 100%; }
  .rs-groups { grid-template-columns: 1fr; }
  .rs-alerts { grid-template-columns: 1fr; }
  .rs-field { padding: 11px 16px; }
  .rs-all-body { padding: 10px; }
}

/* um único grupo (ex.: CPF): campos em duas colunas */
.rs-groups.single { grid-template-columns: 1fr; }
.rs-groups.single .rs-group { display: grid; grid-template-columns: 1fr 1fr; }
.rs-groups.single .rs-group h3 { grid-column: 1 / -1; }
.rs-groups.single .rs-field:nth-child(odd) { border-left: 1px solid var(--line); }
@media (max-width: 720px) {
  .rs-groups.single .rs-group { display: block; }
  .rs-groups.single .rs-field:nth-child(odd) { border-left: 0; }
  /* barra de busca mais enxuta no celular */
  .result-toolbar-title { display: none; }
}

/* ============================================================
   MOBILE: tela estável (sem arrastar/deslocar para os lados)
   Não muda o visual; só impede as causas comuns de a página
   "mexer" ou sair do limite da tela no celular.
   ============================================================ */

/* 1) Sem "elástico" lateral e sem inflar o texto ao girar o aparelho. */
html { overscroll-behavior-x: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overscroll-behavior-x: none; }

/* 2) Sem zoom de duplo toque nos controles (o zoom desloca a página). */
a, button, input, select, textarea, label, summary, [role="button"] { touch-action: manipulation; }

/* 3) Rolagens horizontais internas (abas, tabelas) não "passam" o gesto para a página. */
.table-wrap, .mx-tabs, .pf-nav { overscroll-behavior-x: contain; }

/* 4) O toast nascia 28px fora da borda direita (translateX). Agora sobe de baixo, sempre dentro da tela. */
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }
.toast-root > div { max-width: 100%; overflow-wrap: anywhere; }

/* 5) Altura estável: 100vh no celular inclui a barra do navegador e a tela "pula" ao rolar. */
@supports (height: 100dvh) {
  .d-shell, .d-auth, .docs-shell { min-height: 100dvh; }
}

/* 6) Texto comprido sem quebra (e-mail, token, URL) nunca alarga a coluna. */
.data-field, .data-value, .data-label, .record-card, .rs-field strong, .rs-hero h2, .dx-row-main, .pf-id { min-width: 0; }
.data-value, .record-title { overflow-wrap: anywhere; }

@media (max-width: 980px) {
  /* A coluna única era "1fr" (= minmax(auto, 1fr)): um conteúdo largo a esticava além da tela. */
  .d-shell { grid-template-columns: minmax(0, 1fr); }
  #app, .d-shell, .d-main, .content { min-width: 0; max-width: 100%; }
  .content > * { min-width: 0; max-width: 100%; }
  img, svg, video, canvas { max-width: 100%; }

  /* iPhone dá zoom automático ao tocar em campo com fonte < 16px e deixa a tela deslocada. */
  input, select, textarea, .input { font-size: 16px !important; }
}
