/* ── Reset ─────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Base ──────────────────────────────────────────────────── */
html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font-family: var(--font);
  cursor: pointer;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar         { width: 5px; height: 5px; }
::-webkit-scrollbar-track   { background: var(--surface); }
::-webkit-scrollbar-thumb   { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

/* ── Seleção de texto ───────────────────────────────────────── */
::selection {
  background: var(--primary-dim);
  color: var(--text);
}

/* ── Utilitários ─────────────────────────────────────────────  */
.hidden   { display: none !important; }
.muted    { color: var(--muted); font-size: 12px; }
.sep      { height: 1px; background: var(--border); margin: 14px 0; }
.sr-only  {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Spinner ─────────────────────────────────────────────────  */
.spin {
  display: inline-block;
  width: 13px; height: 13px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Banner leve (Modo Leve do device.js) */
#banner-leve {
  font-family: var(--font);
  font-size: 12px;
  background: var(--warning-bg);
  color: var(--warning-text);
  padding: 6px 14px;
  text-align: center;
  border-bottom: 1px solid var(--warning);
  flex-shrink: 0;
}

/* ── Print ───────────────────────────────────────────────────  */
@media print {
  #sidebar, header, .preview-bar, #prev-nav-bar { display: none; }
  #preview-outer { background: none; padding: 0; }
  .page { box-shadow: none; margin: 0; }
}
