/* Base: reset, tipografia e estrutura da página */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--text);
  font: var(--fw-regular) var(--fs-14) / var(--lh-ui) var(--font-ui);
  font-feature-settings: 'tnum' 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-doc);
  font-weight: var(--fw-semi);
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
}
h1 { font-size: var(--fs-28); }
h2 { font-size: var(--fs-22); }
h3 { font-size: var(--fs-18); }
h4 { font-size: var(--fs-16); }
p { margin: 0; }
p + p { margin-top: var(--s-3); }
a { color: var(--info); }
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
svg { display: block; flex: none; }
:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
::selection {
  background: var(--brass-200);
  color: var(--ink-950);
}

/* Rolagem fina e discreta */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

/* Estrutura */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--aside);
  gap: var(--s-8);
  align-items: start;
  padding-top: var(--s-8);
  padding-bottom: var(--s-16);
}
.layout-wide { grid-template-columns: minmax(0, 1fr); }
.main-col { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: var(--s-6); }
.stack-sm { display: flex; flex-direction: column; gap: var(--s-3); }
.row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); font-size: var(--fs-13); }
.num { font-variant-numeric: tabular-nums; }
.tone-ok { color: var(--ok); }
.tone-bad { color: var(--bad); }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --gutter: var(--s-4); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .layout { padding-top: var(--s-5); gap: var(--s-6); }
}
