/* ==========================================================================
   NF-e Lab — estilos
   Sem dependências externas. Tema claro/escuro, layout responsivo e foco
   visível em todos os controles.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */

:root {
  color-scheme: light;

  --bg: #f5f2ea;
  --bg-deep: #eeeae0;
  --surface: #fffdf8;
  --surface-2: #f0ece2;
  --surface-3: #e8e2d5;
  --text: #16211c;
  --text-soft: #38463f;
  --muted: #5c6861;
  --line: #ddd6c7;
  --line-strong: #c7bfad;

  --brand: #0d5c4a;
  --brand-strong: #084537;
  --brand-soft: #e2f1eb;
  --brand-softer: #edf7f2;
  --on-brand: #ffffff;

  --accent: #bd5f25;
  --accent-strong: #9a4a18;
  --accent-soft: #fbe9d9;

  --warning: #8a5300;
  --warning-strong: #6d4100;
  --warning-bg: #fff2d7;
  --warning-line: #e9c98b;

  --danger: #a32a2a;
  --danger-strong: #861f1f;
  --danger-bg: #fdeaea;
  --danger-line: #e8b7b7;
  --on-danger: #ffffff;

  --success: #1c6b4c;
  --success-bg: #e4f4eb;
  --success-line: #b8dfca;

  --focus: #1f7a62;
  --focus-ring: rgba(13, 92, 74, 0.2);
  --shadow-sm: 0 1px 2px rgba(25, 34, 29, 0.06);
  --shadow-md: 0 12px 30px -18px rgba(25, 34, 29, 0.28);
  --shadow-lg: 0 34px 70px -36px rgba(25, 34, 29, 0.4);

  --hero-bg: linear-gradient(180deg, #f8f6f0 0%, var(--bg) 100%);
  --hero-glow: rgba(13, 92, 74, 0.1);
  --header-bg: rgba(245, 242, 234, 0.84);
  --code-bg: #0c1713;
  --code-bg-soft: #111f1a;
  --code-text: #d7e6de;
  --code-line: #7b978b;
  --code-tag: #7dd3b0;
  --code-attr: #f2c879;
  --code-value: #eab49c;
  --code-punct: #7f9b8f;

  --toast-bg: #102a22;
  --toast-text: #edf7f2;
  --toast-line: rgba(255, 255, 255, 0.16);
  --footer-bg: #0b2821;
  --footer-text: #d9e8e1;
  --footer-muted: #9eb6ac;
  --footer-line: rgba(255, 255, 255, 0.14);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;

  --wrap: 1180px;
  --header-h: 70px;
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua",
    Palatino, Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg: #0c1411;
    --bg-deep: #0a110e;
    --surface: #111d18;
    --surface-2: #16251f;
    --surface-3: #1d2f27;
    --text: #e9f0ec;
    --text-soft: #c8d5ce;
    --muted: #9fb0a7;
    --line: #293a32;
    --line-strong: #3a4e44;

    --brand: #63d2af;
    --brand-strong: #86e4c5;
    --brand-soft: #16362c;
    --brand-softer: #112a22;
    --on-brand: #062019;

    --accent: #f0a36a;
    --accent-strong: #f6bb8e;
    --accent-soft: #3a2718;

    --warning: #f2c879;
    --warning-strong: #ffd995;
    --warning-bg: #382b12;
    --warning-line: #6b5524;

    --danger: #f08b8b;
    --danger-strong: #ffaaaa;
    --danger-bg: #3b1c1c;
    --danger-line: #6e3434;
    --on-danger: #2a0909;

    --success: #77d9aa;
    --success-bg: #133327;
    --success-line: #2b5f48;

    --focus: #86e4c5;
    --focus-ring: rgba(99, 210, 175, 0.25);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 16px 36px -22px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 38px 80px -38px rgba(0, 0, 0, 0.8);

    --hero-bg: linear-gradient(180deg, #0e1814 0%, var(--bg) 100%);
    --hero-glow: rgba(99, 210, 175, 0.08);
    --header-bg: rgba(12, 20, 17, 0.84);

    --toast-bg: #e9f4ee;
    --toast-text: #0b2119;
    --toast-line: rgba(10, 30, 22, 0.16);
    --footer-bg: #081611;
    --footer-text: #d9e8e1;
    --footer-muted: #8fa89d;
    --footer-line: rgba(255, 255, 255, 0.12);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0c1411;
  --bg-deep: #0a110e;
  --surface: #111d18;
  --surface-2: #16251f;
  --surface-3: #1d2f27;
  --text: #e9f0ec;
  --text-soft: #c8d5ce;
  --muted: #9fb0a7;
  --line: #293a32;
  --line-strong: #3a4e44;

  --brand: #63d2af;
  --brand-strong: #86e4c5;
  --brand-soft: #16362c;
  --brand-softer: #112a22;
  --on-brand: #062019;

  --accent: #f0a36a;
  --accent-strong: #f6bb8e;
  --accent-soft: #3a2718;

  --warning: #f2c879;
  --warning-strong: #ffd995;
  --warning-bg: #382b12;
  --warning-line: #6b5524;

  --danger: #f08b8b;
  --danger-strong: #ffaaaa;
  --danger-bg: #3b1c1c;
  --danger-line: #6e3434;
  --on-danger: #2a0909;

  --success: #77d9aa;
  --success-bg: #133327;
  --success-line: #2b5f48;

  --focus: #86e4c5;
  --focus-ring: rgba(99, 210, 175, 0.25);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 16px 36px -22px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 38px 80px -38px rgba(0, 0, 0, 0.8);

  --hero-bg: linear-gradient(180deg, #0e1814 0%, var(--bg) 100%);
  --hero-glow: rgba(99, 210, 175, 0.08);
  --header-bg: rgba(12, 20, 17, 0.84);

  --toast-bg: #e9f4ee;
  --toast-text: #0b2119;
  --toast-line: rgba(10, 30, 22, 0.16);
  --footer-bg: #081611;
  --footer-text: #d9e8e1;
  --footer-muted: #8fa89d;
  --footer-line: rgba(255, 255, 255, 0.12);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(120, 110, 90, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 110, 90, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, black, transparent 70%);
}

::selection {
  background: var(--brand);
  color: var(--on-brand);
}

img,
svg {
  max-width: 100%;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
}

button {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--brand-strong);
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.wrap {
  width: min(100% - 48px, var(--wrap));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.16s ease;
}

.skip-link:focus {
  transform: translateY(0);
  color: var(--bg);
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.muted {
  color: var(--muted);
}

code,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.1em 0.4em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Cabeçalho
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  flex: 0 0 auto;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--brand), var(--brand-strong));
  color: var(--on-brand);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), var(--shadow-sm);
}

.brand-name {
  font-size: 1.02rem;
  font-weight: 550;
  letter-spacing: -0.02em;
}

.brand-name strong {
  font-weight: 800;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}

.main-nav a {
  position: relative;
  padding: 6px 0;
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.main-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.18s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--brand);
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after {
  transform: scaleX(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.icon-btn:active {
  transform: translateY(1px);
}

.theme-toggle .icon-sun {
  display: none;
}

.theme-toggle .icon-moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: block;
  }

  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: none;
  }
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

/* --------------------------------------------------------------------------
   Botões
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease,
    color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.btn-primary {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.16) inset, var(--shadow-sm);
}

.btn-primary:hover {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
  color: var(--on-brand);
}

.btn-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  border-color: var(--brand);
  background: var(--brand-softer);
  color: var(--brand-strong);
}

.btn-ghost {
  border-color: transparent;
  color: var(--text-soft);
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-danger {
  border-color: var(--danger);
  background: var(--danger);
  color: var(--on-danger);
}

.btn-danger:hover {
  border-color: var(--danger-strong);
  background: var(--danger-strong);
  color: var(--on-danger);
}

.btn-small {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 0.8rem;
}

.btn-lg {
  min-height: 50px;
  padding: 0 22px;
  border-radius: 12px;
  font-size: 0.98rem;
}

.btn-lg .icon {
  width: 21px;
  height: 21px;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 78px 0 68px;
  background: var(--hero-bg);
}

.hero::before {
  content: "";
  position: absolute;
  top: -220px;
  right: -160px;
  width: 720px;
  height: 720px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--hero-glow), transparent 66%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: -180px;
  left: -180px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 68%);
  opacity: 0.55;
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
  align-items: center;
  gap: 56px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  padding: 6px 12px 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.hero h1 {
  max-width: 13ch;
  font-size: clamp(2.65rem, 6vw, 4.55rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.hero h1 em {
  position: relative;
  color: var(--brand);
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.hero h1 em::after {
  content: "";
  position: absolute;
  right: 0.04em;
  bottom: 0.04em;
  left: 0.04em;
  height: 0.12em;
  border-radius: 99px;
  background: var(--accent);
  opacity: 0.35;
  transform: rotate(-1deg);
}

.lede {
  max-width: 56ch;
  margin-top: 24px;
  color: var(--text-soft);
  font-size: clamp(1.02rem, 1.4vw, 1.14rem);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 28px;
  list-style: none;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.trust-list li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.trust-list .icon {
  width: 16px;
  height: 16px;
  color: var(--brand);
}

/* Cartão ilustrativo do hero */

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 430px;
  padding: 28px 10px;
}

.hero-visual::before {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  border: 1px solid var(--line);
  border-radius: 50%;
  opacity: 0.75;
}

.hero-visual::after {
  content: "";
  position: absolute;
  width: 470px;
  height: 470px;
  border: 1px dashed var(--line-strong);
  border-radius: 50%;
  opacity: 0.4;
}

.doc-card {
  position: relative;
  z-index: 2;
  width: min(100%, 390px);
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  background:
    radial-gradient(120% 90% at 15% 0%, rgba(99, 210, 175, 0.13), transparent 55%),
    linear-gradient(155deg, #103a30 0%, #0a211a 72%);
  color: #eaf5ef;
  box-shadow:
    0 46px 90px -36px rgba(4, 24, 18, 0.72),
    0 2px 0 rgba(255, 255, 255, 0.08) inset;
  transform: rotate(-1.4deg);
}

.doc-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.doc-badge {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 28px;
  padding: 0 9px;
  border-radius: 7px;
  background: #e9f7f1;
  color: #0b2a21;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.05em;
}

.doc-meta {
  color: #a8c6ba;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.doc-test {
  margin-left: auto;
  padding: 3px 7px;
  border: 1px solid rgba(240, 163, 106, 0.55);
  border-radius: 5px;
  color: #f3b98c;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.doc-key {
  margin: 16px 0;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.18);
}

.doc-key span {
  display: block;
  margin-bottom: 4px;
  color: #8fb3a6;
  font-size: 0.59rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.doc-key code {
  display: block;
  overflow-wrap: anywhere;
  color: #c9f2e1;
  font-size: 0.72rem;
  line-height: 1.5;
  letter-spacing: 0.04em;
}

.doc-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px 16px;
  margin-bottom: 16px;
}

.doc-fields span {
  display: block;
  margin-bottom: 2px;
  color: #8fb3a6;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.doc-fields strong {
  display: block;
  overflow: hidden;
  color: #eef8f3;
  font-size: 0.78rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-code {
  padding: 12px 13px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.28);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  line-height: 1.75;
  color: #a9c6ba;
}

.doc-line {
  display: block;
  white-space: nowrap;
}

.doc-tag {
  color: #7dd3b0;
}

.doc-attr {
  color: #f2c879;
}

.doc-val {
  color: #e8b39b;
}

.doc-stamp {
  position: absolute;
  right: -17px;
  bottom: 32px;
  padding: 8px 10px;
  border: 2px solid rgba(240, 163, 106, 0.68);
  border-radius: 5px;
  background: rgba(16, 42, 34, 0.82);
  color: #f3b98c;
  font-size: 0.55rem;
  font-weight: 850;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-align: center;
  transform: rotate(8deg);
}

.float-chip {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 650;
  box-shadow: var(--shadow-md);
}

.float-chip strong {
  font-weight: 800;
}

.chip-total {
  bottom: 42px;
  left: -16px;
  transform: rotate(2deg);
}

.chip-total span {
  color: var(--muted);
  font-weight: 600;
}

.chip-check {
  top: 30px;
  right: -12px;
  color: var(--brand-strong);
  transform: rotate(-2deg);
}

.chip-check .icon {
  width: 17px;
  height: 17px;
  color: var(--brand);
}

/* --------------------------------------------------------------------------
   Seções
   -------------------------------------------------------------------------- */

.section {
  padding: 88px 0;
}

.section-alt {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-deep);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 36px;
}

.section-kicker {
  margin-bottom: 10px;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section h2 {
  max-width: 20ch;
  font-size: clamp(1.85rem, 3.4vw, 2.65rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.section-sub {
  max-width: 62ch;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.98rem;
}

.shortcut-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.shortcut-hint span {
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   Gerador
   -------------------------------------------------------------------------- */

.generator-section {
  padding-top: 72px;
}

.generator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(360px, 0.72fr);
  align-items: start;
  gap: 24px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.form-panel {
  min-width: 0;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.tabs {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.tab .icon {
  width: 17px;
  height: 17px;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  line-height: 1.4;
  white-space: nowrap;
}

.badge .icon {
  width: 13px;
  height: 13px;
}

.badge-soft {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--muted);
  letter-spacing: 0;
}

.badge-warning {
  border-color: var(--warning-line);
  background: var(--warning-bg);
  color: var(--warning-strong);
  letter-spacing: 0;
}

.badge-stale {
  border-color: var(--warning-line);
  background: var(--warning-bg);
  color: var(--warning-strong);
  letter-spacing: 0;
}

.tab-panel {
  padding: 26px 24px 28px;
}

.tab-panel:focus-visible {
  outline-offset: -4px;
}

/* Formulários */

.form-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.form-intro h3 {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.form-intro p {
  max-width: 54ch;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.87rem;
}

.intro-actions {
  flex: 0 0 auto;
}

.req {
  color: var(--accent);
  font-weight: 900;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}

.span-2 {
  grid-column: span 2;
}

.field {
  min-width: 0;
}

.field > label,
.field > legend,
.field-check > label {
  display: block;
  margin-bottom: 7px;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
}

.field > legend {
  padding: 0;
}

.field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.field select,
.field textarea {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease;
}

.field select {
  cursor: pointer;
}

.field textarea {
  min-height: 108px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted);
  opacity: 0.72;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--muted);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  background: var(--surface-2);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.72;
}

.field input.is-invalid,
.field select.is-invalid,
.field textarea.is-invalid {
  border-color: var(--danger);
  background: var(--danger-bg);
  box-shadow: 0 0 0 3px var(--danger-bg);
}

.field.is-invalid > label,
.field.is-invalid > legend {
  color: var(--danger);
}

.hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.field-check {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.field-check > .check-row {
  min-height: 46px;
  align-items: center;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-soft);
  font-size: 0.86rem;
  line-height: 1.5;
  cursor: pointer;
}

.check-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.check-row code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-soft);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease,
    box-shadow 0.15s ease;
}

.choice:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.choice:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-softer);
  box-shadow: 0 0 0 1px var(--brand) inset;
}

.choice:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.choice input[type="radio"] {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 3px 0 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.choice span {
  display: block;
  min-width: 0;
}

.choice strong {
  display: block;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.35;
}

.choice small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 46px;
}

.range-row input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.range-row output {
  flex: 0 0 auto;
  min-width: 64px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
}

.form-status,
.draft-status {
  min-height: 1.3em;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.78rem;
}

.form-actions-sticky {
  position: sticky;
  bottom: 0;
  z-index: 10;
  margin: 32px -24px -28px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.form-actions-sticky .draft-status {
  flex-basis: 100%;
  margin-top: 0;
}

/* Seções internas do formulário */

.form-section {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.form-section:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.form-section-head {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 20px;
}

.form-section-head > div {
  flex: 1;
  min-width: 0;
}

.section-number {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  margin-top: 1px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--brand);
  font-size: 0.68rem;
  font-weight: 850;
}

.form-section-head h3 {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.form-section-head p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
}

.form-section-head .badge {
  margin-left: auto;
  margin-top: 4px;
}

.tax-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.tax-hint {
  margin-top: 8px;
}

/* Itens */

.items-container {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.items-container.is-invalid {
  padding: 10px;
  border: 1px solid var(--danger);
  border-radius: 14px;
  background: var(--danger-bg);
}

.item-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
}

.item-head h4 {
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.item-total {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.72rem;
}

.item-total strong {
  margin-left: 4px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
}

.item-remove {
  width: 34px;
  height: 34px;
  color: var(--muted);
}

.item-remove:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.item-card .grid-2 {
  gap: 12px 14px;
}

.item-card .field > label {
  font-size: 0.75rem;
}

.item-card .field input,
.item-card .field select {
  min-height: 40px;
  padding: 7px 10px;
  font-size: 0.84rem;
}

.add-item {
  width: 100%;
  margin-top: 12px;
  border-style: dashed;
  color: var(--muted);
}

.add-item:hover {
  border-color: var(--brand);
  background: var(--brand-softer);
  color: var(--brand-strong);
}

.items-summary {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

/* Resumo de totais */

.totals-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 22px;
  padding: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}

.totals-summary > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
}

.totals-summary dt {
  color: var(--muted);
  font-size: 0.76rem;
}

.totals-summary dd {
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.totals-summary .total-line {
  grid-column: span 2;
  background: var(--brand-softer);
}

.totals-summary .total-line dt {
  color: var(--brand-strong);
  font-weight: 750;
}

.totals-summary .total-line dd {
  color: var(--brand-strong);
  font-size: 1rem;
  font-weight: 850;
}

/* Erros */

.error-summary {
  margin-bottom: 22px;
  padding: 14px 16px;
  border: 1px solid var(--danger-line);
  border-radius: 12px;
  background: var(--danger-bg);
  color: var(--danger-strong);
}

.error-summary:focus-visible {
  outline-color: var(--danger);
}

.error-summary-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}

.error-summary-head .icon {
  width: 19px;
  height: 19px;
  color: var(--danger);
}

.error-summary-head h3 {
  font-size: 0.9rem;
  font-weight: 800;
}

.error-summary ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.error-summary li {
  margin: 0;
}

.error-link {
  display: inline;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--danger-strong);
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.error-link:hover {
  color: var(--danger);
}

/* --------------------------------------------------------------------------
   Prévia
   -------------------------------------------------------------------------- */

.preview-panel {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  min-width: 0;
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow: auto;
  scrollbar-width: thin;
}

.preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 20px 17px;
  border-bottom: 1px solid var(--line);
}

.preview-head .section-kicker {
  margin-bottom: 5px;
}

.preview-head h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.preview-head h2:focus {
  outline: none;
}

.preview-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.preview-empty {
  display: grid;
  justify-items: center;
  padding: 54px 28px 58px;
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  margin-bottom: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 22px;
  background: var(--surface-2);
  color: var(--muted);
}

.empty-icon svg {
  width: 48px;
  height: 48px;
}

.preview-empty p {
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 650;
}

.preview-empty .muted {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
}

.preview-empty .btn {
  margin-top: 20px;
}

.preview-meta {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.stat-grid > div {
  min-width: 0;
  padding: 9px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
}

.stat-grid dt {
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat-grid dd {
  margin-top: 2px;
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.key-box {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
}

.key-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.key-label > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.key-label .icon {
  width: 14px;
  height: 14px;
}

.key-label .icon-btn {
  width: 28px;
  height: 28px;
  margin: -4px -4px -4px 0;
}

.key-label .icon-btn .icon {
  width: 15px;
  height: 15px;
}

.key-box > code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.5;
  letter-spacing: 0.03em;
}

.checks {
  padding: 16px 20px 18px;
  border-bottom: 1px solid var(--line);
}

.checks-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.checks-head h3 {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-pill.is-ok {
  border-color: var(--success-line);
  background: var(--success-bg);
  color: var(--success);
}

.status-pill.is-warn {
  border-color: var(--warning-line);
  background: var(--warning-bg);
  color: var(--warning-strong);
}

.check-list {
  display: grid;
  gap: 6px;
  margin: 0;
  list-style: none;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: var(--text-soft);
  font-size: 0.76rem;
  line-height: 1.45;
}

.check-item .icon {
  width: 15px;
  height: 15px;
  margin-top: 2px;
}

.check-item.is-pass .icon {
  color: var(--success);
}

.check-item.is-info .icon {
  color: var(--brand);
}

.check-item.is-warn {
  color: var(--warning-strong);
}

.check-item.is-warn .icon {
  color: var(--warning);
}

/* Código */

.code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
}

.code-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.code-label .icon {
  width: 15px;
  height: 15px;
}

.code-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.code-actions .btn {
  min-height: 31px;
  padding: 0 9px;
  font-size: 0.72rem;
}

.code-actions .icon {
  width: 14px;
  height: 14px;
}

.code-wrap {
  display: flex;
  max-height: 470px;
  overflow: auto;
  background: var(--code-bg);
  scrollbar-color: #355348 var(--code-bg);
  scrollbar-width: thin;
}

.line-numbers {
  position: sticky;
  left: 0;
  z-index: 1;
  flex: 0 0 auto;
  padding: 14px 10px 14px 13px;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  background: var(--code-bg);
  color: var(--code-line);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.7;
  text-align: right;
  user-select: none;
}

.line-numbers span {
  display: block;
  min-height: 1.7em;
}

.xml-code {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 14px 16px;
  overflow: visible;
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.7;
  tab-size: 2;
  white-space: pre;
}

.xml-code code {
  font: inherit;
}

.code-line {
  display: block;
  min-height: 1.7em;
}

.tok-punct {
  color: var(--code-punct);
}

.tok-tag {
  color: var(--code-tag);
}

.tok-attr {
  color: var(--code-attr);
}

.tok-value {
  color: var(--code-value);
}

.code-wrap.is-wrapped .line-numbers {
  display: none;
}

.code-wrap.is-wrapped .xml-code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.preview-foot {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 13px 20px 17px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.preview-foot .icon {
  width: 15px;
  height: 15px;
  margin-top: 1px;
  color: var(--brand);
}

/* --------------------------------------------------------------------------
   Validador
   -------------------------------------------------------------------------- */

.validator-section {
  padding-top: 72px;
}

.validator-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.validator-note .icon {
  width: 15px;
  height: 15px;
  color: var(--brand);
}

.validator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  align-items: start;
  gap: 24px;
}

.validator-input {
  min-width: 0;
  overflow: hidden;
}

.validator-head-copy h3 {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.validator-head-copy p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
}

.validator-body {
  padding: 22px 24px 24px;
}

.drop-zone {
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 26px 20px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--surface-2);
  text-align: center;
  transition: border-color 0.16s ease, background-color 0.16s ease,
    box-shadow 0.16s ease;
}

.drop-zone.is-dragover {
  border-color: var(--brand);
  background: var(--brand-softer);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--brand);
}

.drop-icon .icon {
  width: 24px;
  height: 24px;
}

.drop-copy {
  display: grid;
  justify-items: center;
  gap: 5px;
}

.drop-copy strong {
  font-size: 0.92rem;
  font-weight: 750;
}

.drop-copy span {
  color: var(--muted);
  font-size: 0.72rem;
}

.drop-hint {
  max-width: 100%;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

.validator-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.validator-divider::before,
.validator-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

#xml-input {
  min-height: 250px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  tab-size: 2;
  white-space: pre;
  overflow-x: auto;
}

.validator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.form-status[data-type="error"] {
  color: var(--danger-strong);
}

.form-status[data-type="success"] {
  color: var(--success);
}

.form-status[data-type="warn"] {
  color: var(--warning-strong);
}

.validator-result {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  min-width: 0;
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow: auto;
  scrollbar-width: thin;
}

.validator-result .preview-head h2:focus {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.status-pill.is-error {
  border-color: var(--danger-line);
  background: var(--danger-bg);
  color: var(--danger-strong);
}

.validator-empty {
  display: grid;
  justify-items: center;
  padding: 54px 28px 58px;
  text-align: center;
}

.validator-empty h3 {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.validator-empty p {
  max-width: 34ch;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.validator-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.validator-summary > div {
  min-width: 0;
  padding: 11px 20px;
  background: var(--surface);
}

.validator-summary > div.is-wide {
  grid-column: 1 / -1;
}

.validator-summary dt {
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.validator-summary dd {
  margin-top: 3px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.validator-summary dd.validator-key {
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.validator-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.count {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.count b {
  font-size: 0.82rem;
  font-weight: 850;
}

.count-error {
  border-color: var(--danger-line);
  background: var(--danger-bg);
  color: var(--danger-strong);
}

.count-warning {
  border-color: var(--warning-line);
  background: var(--warning-bg);
  color: var(--warning-strong);
}

.count-check {
  border-color: var(--success-line);
  background: var(--success-bg);
  color: var(--success);
}

.validator-block {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.validator-block h3 {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.issue-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.issue {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
}

.issue-error {
  border-color: var(--danger-line);
  background: var(--danger-bg);
}

.issue-warning {
  border-color: var(--warning-line);
  background: var(--warning-bg);
}

.issue-kind {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--danger-strong);
  font-size: 0.6rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.issue-warning .issue-kind {
  color: var(--warning-strong);
}

.issue-body {
  min-width: 0;
}

.issue-body p {
  color: var(--text-soft);
  font-size: 0.76rem;
  line-height: 1.45;
}

.issue-body code {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.65rem;
  overflow-wrap: anywhere;
}

.validator-none {
  color: var(--muted);
  font-size: 0.76rem;
}

.validator-report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px 8px;
}

.validator-foot {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 8px 20px 18px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

.validator-foot .icon {
  width: 15px;
  height: 15px;
  margin-top: 1px;
  color: var(--brand);
}

/* --------------------------------------------------------------------------
   Como funciona
   -------------------------------------------------------------------------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 24px 22px 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.steps li::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  opacity: 0.7;
}

.step-number {
  position: absolute;
  top: 12px;
  right: 16px;
  color: var(--line-strong);
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1;
}

.step-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--brand-softer);
  color: var(--brand);
}

.step-icon .icon {
  width: 22px;
  height: 22px;
}

.steps h3 {
  margin-bottom: 6px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.steps p {
  color: var(--muted);
  font-size: 0.85rem;
}

.steps code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-soft);
}

/* --------------------------------------------------------------------------
   Entenda o XML
   -------------------------------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: 56px;
}

.split-copy > p {
  max-width: 58ch;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.96rem;
}

.key-explainer {
  margin-top: 30px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.key-explainer h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.96rem;
  font-weight: 800;
}

.key-explainer h3 .icon {
  width: 18px;
  height: 18px;
  color: var(--brand);
}

.key-explainer > p {
  color: var(--muted);
  font-size: 0.82rem;
}

.key-parts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.key-parts > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.key-parts b {
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.key-parts code {
  color: var(--brand-strong);
  font-size: 0.68rem;
  font-weight: 700;
}

.field-map {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.field-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: baseline;
  gap: 16px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}

.field-row:first-child {
  border-top: 0;
}

.field-row > code {
  justify-self: start;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--brand-strong);
  font-size: 0.7rem;
  font-weight: 700;
}

.field-row strong {
  display: block;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 750;
}

.field-row span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.field-row-warning {
  background: var(--warning-bg);
}

.field-row-warning > code {
  border-color: var(--warning-line);
  background: transparent;
  color: var(--warning-strong);
}

.field-row-warning strong {
  color: var(--warning-strong);
}

.field-row-warning span {
  color: var(--warning);
}

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */

.faq-wrap {
  max-width: 980px;
}

.faq {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.faq details {
  border-top: 1px solid var(--line);
}

.faq details:first-child {
  border-top: 0;
}

.faq summary {
  position: relative;
  padding: 18px 52px 18px 20px;
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.45;
  cursor: pointer;
  list-style: none;
  transition: background-color 0.15s ease;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary:hover {
  background: var(--surface-2);
}

.faq summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 20px;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--brand);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-50%);
}

.faq details[open] summary::after {
  content: "−";
}

.faq details[open] summary {
  background: var(--brand-softer);
}

.faq details p {
  padding: 0 56px 20px 20px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

.faq details p code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-soft);
}

/* --------------------------------------------------------------------------
   Anúncios
   -------------------------------------------------------------------------- */

.site-body {
  display: block;
}

.ad-rail,
.ad-footer {
  display: none;
}

.ad-slot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.ad-label {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ad-slot .adsbygoogle {
  display: block;
  width: 100%;
}

body.has-ads .ad-footer.has-ad {
  display: block;
  padding-top: 0;
  padding-bottom: 8px;
}

body.has-ads .ad-footer .ad-slot {
  min-height: 90px;
  margin-bottom: 24px;
}

@media (min-width: 1024px) {
  body.has-side-ads .site-body {
    display: grid;
    align-items: start;
    gap: 20px;
    width: min(100% - 32px, 1440px);
    margin: 0 auto;
  }

  body.has-ad-left.has-ad-right .site-body {
    grid-template-columns: 140px minmax(0, 1fr) 140px;
  }

  body.has-ad-left:not(.has-ad-right) .site-body {
    grid-template-columns: 140px minmax(0, 1fr);
  }

  body.has-ad-right:not(.has-ad-left) .site-body {
    grid-template-columns: minmax(0, 1fr) 140px;
  }

  body.has-ad-left .site-body > main {
    grid-column: 2;
    min-width: 0;
  }

  body.has-ad-right:not(.has-ad-left) .site-body > main {
    grid-column: 1;
  }

  body.has-ads .ad-rail.has-ad {
    display: block;
    position: sticky;
    top: calc(var(--header-h) + 20px);
    padding-top: 24px;
    min-width: 0;
  }

  body.has-ad-left .ad-rail-left {
    grid-column: 1;
  }

  body.has-ad-right .ad-rail-right {
    grid-column: 3;
  }

  body.has-ad-right:not(.has-ad-left) .ad-rail-right {
    grid-column: 2;
  }

  body.has-ads .ad-rail.has-ad .ad-slot {
    min-height: 600px;
  }
}

@media (min-width: 1280px) {
  body.has-ad-left.has-ad-right .site-body {
    grid-template-columns: 160px minmax(0, 1fr) 160px;
    gap: 24px;
  }

  body.has-ad-left:not(.has-ad-right) .site-body {
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 24px;
  }

  body.has-ad-right:not(.has-ad-left) .site-body {
    grid-template-columns: minmax(0, 1fr) 160px;
    gap: 24px;
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  body.has-side-ads .hero-grid,
  body.has-side-ads .steps,
  body.has-side-ads .split {
    grid-template-columns: minmax(0, 1fr);
  }

  body.has-side-ads .hero-visual {
    min-height: 390px;
    margin-top: 8px;
  }

  body.has-side-ads .split {
    gap: 36px;
  }
}

@media (min-width: 1920px) {
  body.has-ad-left.has-ad-right .site-body {
    grid-template-columns: 300px minmax(0, 1fr) 300px;
    gap: 28px;
    width: min(100% - 48px, 1840px);
  }

  body.has-ad-left:not(.has-ad-right) .site-body {
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 28px;
    width: min(100% - 48px, 1840px);
  }

  body.has-ad-right:not(.has-ad-left) .site-body {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 28px;
    width: min(100% - 48px, 1840px);
  }
}

@media (max-width: 1023px) {
  body.has-side-ads .ad-rail {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Rodapé
   -------------------------------------------------------------------------- */

.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.7fr) minmax(0, 1fr);
  gap: 48px;
  padding-top: 54px;
  padding-bottom: 42px;
}

.site-footer .brand {
  color: var(--footer-text);
}

.site-footer .brand:hover {
  color: #ffffff;
}

.site-footer .brand-mark {
  background: linear-gradient(145deg, #2b8b70, #155744);
  color: #ffffff;
}

.footer-brand p {
  max-width: 42ch;
  margin-top: 14px;
  color: var(--footer-muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.footer-warning {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: #f0c38f !important;
  font-size: 0.78rem !important;
}

.footer-warning .icon {
  width: 15px;
  height: 15px;
  margin-top: 2px;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
}

.footer-nav h2 {
  margin-bottom: 4px;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer-nav a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--footer-muted);
  font-size: 0.82rem;
  text-decoration: none;
}

.footer-nav a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-nav .icon {
  width: 13px;
  height: 13px;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding-top: 18px;
  padding-bottom: 24px;
  border-top: 1px solid var(--footer-line);
  color: var(--footer-muted);
  font-size: 0.74rem;
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 11px 12px 11px 14px;
  border: 1px solid var(--toast-line);
  border-radius: 12px;
  background: var(--toast-bg);
  color: var(--toast-text);
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: 0 22px 50px -20px rgba(0, 0, 0, 0.55);
  animation: toast-in 0.2s ease both;
}

.toast > .icon {
  width: 18px;
  height: 18px;
  color: #7dd3b0;
}

.toast[data-type="error"] > .icon {
  color: #ffb0a0;
}

.toast[data-type="info"] > .icon {
  color: #f2c879;
}

.toast .icon-btn {
  width: 28px;
  height: 28px;
  margin-left: 3px;
  color: inherit;
  opacity: 0.72;
}

.toast .icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  opacity: 1;
}

.toast .icon-btn .icon {
  width: 15px;
  height: 15px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --------------------------------------------------------------------------
   Dialog
   -------------------------------------------------------------------------- */

.dialog {
  width: min(440px, calc(100% - 32px));
  max-width: 440px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.dialog::backdrop {
  background: rgba(4, 13, 9, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.dialog[open] {
  animation: dialog-in 0.18s ease both;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dialog-body {
  padding: 26px;
}

.dialog-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  border: 1px solid var(--danger-line);
  border-radius: 12px;
  background: var(--danger-bg);
  color: var(--danger);
}

.dialog-icon .icon {
  width: 22px;
  height: 22px;
}

.dialog h2 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.dialog p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 24px;
}

/* --------------------------------------------------------------------------
   Noscript
   -------------------------------------------------------------------------- */

.noscript {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 200;
  padding: 14px 16px;
  border: 1px solid var(--warning-line);
  border-radius: 10px;
  background: var(--warning-bg);
  color: var(--warning-strong);
  font-size: 0.86rem;
  box-shadow: var(--shadow-md);
}

/* --------------------------------------------------------------------------
   Responsivo
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .preview-head {
    display: block;
  }

  .preview-badges {
    justify-content: flex-start;
    margin-top: 9px;
  }
}

@media (max-width: 1080px) {
  .hero-grid {
    gap: 34px;
  }

  .generator-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .validator-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .preview-panel,
  .validator-result {
    position: static;
    max-height: none;
  }

  .code-wrap {
    max-height: 520px;
  }

  .split {
    gap: 36px;
  }
}

@media (max-width: 900px) {
  .main-nav {
    display: none;
  }

  .header-actions {
    margin-left: auto;
  }

  .hero {
    padding-top: 56px;
    padding-bottom: 58px;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero h1 {
    max-width: 15ch;
  }

  .hero-visual {
    min-height: 390px;
    margin-top: 8px;
  }

  .steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .split {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 36px;
  }

  .footer-brand {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  .wrap {
    width: min(100% - 32px, var(--wrap));
  }

  .section {
    padding: 64px 0;
  }

  .section-head {
    display: block;
    margin-bottom: 26px;
  }

  .shortcut-hint {
    display: none;
  }

  .validator-note {
    margin-top: 12px;
    white-space: normal;
  }

  .validator-body {
    padding: 20px 18px 22px;
  }

  .validator-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .validator-summary > div.is-wide {
    grid-column: auto;
  }

  .validator-actions .btn,
  .validator-report-actions .btn {
    flex: 1 1 auto;
  }

  .grid-2,
  .choice-grid,
  .tax-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .span-2 {
    grid-column: auto;
  }

  .tab-panel {
    padding: 22px 18px 24px;
  }

  .form-actions-sticky {
    margin-right: -18px;
    margin-left: -18px;
    padding-right: 18px;
    padding-left: 18px;
  }

  .form-intro {
    display: block;
  }

  .intro-actions {
    margin-top: 12px;
  }

  .form-section-head {
    flex-wrap: wrap;
  }

  .form-section-head .badge {
    margin-left: 43px;
    margin-top: 0;
  }

  .item-card .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .item-card .span-2 {
    grid-column: auto;
  }

  .totals-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .totals-summary .total-line {
    grid-column: auto;
  }

  .stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .code-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .code-actions {
    justify-content: flex-start;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
    padding-top: 42px;
  }

  .footer-brand {
    grid-column: auto;
  }

  .footer-bottom {
    display: block;
  }

  .footer-bottom p + p {
    margin-top: 6px;
  }

  .toast {
    right: 16px;
    bottom: 16px;
    left: 16px;
    max-width: none;
  }
}

@media (max-width: 520px) {
  .header-cta {
    display: none;
  }

  .drop-zone {
    padding: 20px 14px;
  }

  #xml-input {
    min-height: 220px;
  }

  .hero {
    padding-top: 42px;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 12vw, 3rem);
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .trust-list {
    display: grid;
    gap: 7px;
  }

  .hero-visual {
    min-height: 340px;
    padding-inline: 0;
  }

  .hero-visual::before,
  .hero-visual::after {
    display: none;
  }

  .doc-card {
    transform: none;
  }

  .doc-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .float-chip {
    display: none;
  }

  .doc-stamp {
    right: -8px;
    bottom: 18px;
  }

  .panel-head {
    flex-wrap: wrap;
  }

  .tabs {
    width: 100%;
  }

  .tab {
    flex: 1;
    justify-content: center;
  }

  .panel-head > .badge {
    margin-left: auto;
  }

  .stat-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .preview-head {
    display: block;
  }

  .preview-badges {
    justify-content: flex-start;
    margin-top: 9px;
  }

  .code-actions .btn {
    flex: 1 1 auto;
    white-space: nowrap;
  }

  .field-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  .faq summary {
    padding-right: 48px;
    font-size: 0.89rem;
  }

  .faq details p {
    padding-right: 20px;
  }

  .dialog-body {
    padding: 22px;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }

  .dialog-actions .btn {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   Movimento reduzido e impressão
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  body {
    background: #ffffff;
    color: #000000;
  }

  body::before,
  .site-header,
  .hero,
  .form-panel,
  .section-alt,
  .site-footer,
  .toast,
  .dialog,
  .skip-link,
  .preview-badges,
  .code-actions {
    display: none !important;
  }

  .section,
  .generator-section {
    padding: 0;
  }

  .generator-layout {
    display: block;
  }

  .preview-panel {
    position: static;
    max-height: none;
    overflow: visible;
    border: 0;
    box-shadow: none;
  }

  .code-wrap {
    max-height: none;
    overflow: visible;
    border: 1px solid #cccccc;
    background: #ffffff;
    color: #000000;
  }

  .line-numbers {
    display: none;
  }

  .xml-code {
    color: #000000;
    white-space: pre-wrap;
  }

  .tok-punct,
  .tok-tag,
  .tok-attr,
  .tok-value {
    color: #000000;
  }
}

/* -------------------------------------------------------------------- */
/* Páginas internas (privacidade, guia)                                  */
/* -------------------------------------------------------------------- */

.doc-page {
  padding: 64px 0 88px;
}

.doc-page .wrap {
  max-width: 780px;
}

.doc-page h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.doc-lead {
  margin-bottom: 36px;
  color: var(--muted);
  font-size: 1.05rem;
}

.doc-page h2 {
  margin: 40px 0 12px;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.doc-page p,
.doc-page li {
  color: var(--text-soft);
}

.doc-page p {
  margin-bottom: 14px;
}

.doc-page ul,
.doc-page ol {
  margin: 0 0 14px 1.2em;
}

.doc-page li {
  margin-bottom: 6px;
}

.doc-page a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.doc-page code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--brand-soft);
  font-size: 0.9em;
}

.doc-note {
  margin: 20px 0;
  padding: 14px 16px;
  border: 1px solid var(--warning-line);
  border-radius: 12px;
  background: var(--warning-bg);
  color: var(--warning-strong);
}

.doc-note p {
  margin: 0;
  color: inherit;
}

.doc-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-link-button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.footer-link-button[hidden] {
  display: none;
}

/* Aviso de cookies dos anúncios */

.consent-banner {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 880px;
  margin: 0 auto;
  padding: 16px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.consent-copy p {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.consent-copy a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.consent-actions {
  display: flex;
  flex: none;
  gap: 8px;
}

@media (max-width: 640px) {
  .consent-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .consent-actions .btn {
    flex: 1;
  }
}

.hint.hint-error {
  color: var(--danger);
}
