@media screen {
  .pc-comandos-dialog { box-sizing: border-box; width: min(1000px, 94vw); max-height: 90vh; padding: 0; border: 3px solid #111; border-radius: 12px; background: #fff; color: #111; overflow-y: auto; }
  .pc-comandos-dialog::backdrop { background: rgb(0 0 0 / 65%); }
  .pc-comandos-fixo { position: sticky; top: 0; z-index: 1; padding-bottom: 8px; background: #fff; }
  .pc-comandos-cabecalho { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; border-bottom: 3px solid #111; background: #fff; }
  .pc-comandos-cabecalho h2 { margin: 0; }
  .pc-comandos-fechar { flex: none; width: 44px; height: 44px; border: 2px solid #111; background: #ffc400; color: #111; box-shadow: 3px 3px 0 #111; font: 900 2rem/1 system-ui, sans-serif; cursor: pointer; }
  .pc-comandos-fechar:hover { background: #ffda55; }
  .pc-comandos-dialog fieldset { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 24px 0; padding: 8px; border: 2px solid #111; background: #f3f6ff; box-shadow: 4px 4px 0 #111; }
  .pc-comandos-dialog legend { padding: 3px 10px; border: 2px solid #111; background: #2268ef; color: #fff; font-weight: 800; }
  .pc-comandos-dialog label { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border: 2px solid #111; background: #fff; color: #111; font-weight: 700; cursor: pointer; }
  .pc-comandos-dialog label:has(input:checked) { background: #ffc400; box-shadow: 3px 3px 0 #111; }
  .pc-comandos-dialog input { width: 18px; height: 18px; accent-color: #1758c8; }
  .pc-comandos-conteudo { padding: 0 24px 24px; }
  .pc-comandos-conteudo section { margin-top: 16px; padding: 0; border: 2px solid #111; }
  .pc-comandos-conteudo summary { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 12px 16px; background: #f3f6ff; cursor: pointer; list-style: none; }
  .pc-comandos-conteudo summary::-webkit-details-marker { display: none; }
  .pc-comandos-conteudo summary::after { content: '+'; margin-left: auto; font-size: 1.5rem; font-weight: 800; }
  .pc-comandos-conteudo details[open] > summary::after { content: '−'; }
  .pc-comandos-modulo { flex: none; font-size: .8rem; font-weight: 800; }
  .pc-comandos-modulo-titulo { font-weight: 800; overflow-wrap: break-word; }
  .pc-comandos-conteudo details > :not(summary) { margin-left: 16px; margin-right: 16px; }
  .pc-comandos-estado, .pc-comandos-erro { margin: 16px 24px 24px; font-weight: 700; }
  .pc-comandos-erro button { min-height: 44px; padding: 8px 14px; border: 2px solid currentColor; background: #ffc400; color: #111; font-weight: 800; cursor: pointer; }
  .pc-comandos-erro a { color: inherit; }
  html[data-pc-theme="dark"] .pc-comandos-erro button { background: #49c5fe; }
  .pc-comandos-dialog .pc-comandos-estado[hidden], .pc-comandos-dialog .pc-comandos-erro[hidden] { display: none; }
  .pc-comandos-conteudo, .pc-comandos-conteudo section, .pc-comandos-conteudo .command-grid,
  .pc-comandos-conteudo .command-card, .pc-comandos-conteudo .section-title h2 { min-width: 0; max-width: 100%; box-sizing: border-box; }
  .pc-comandos-conteudo .section-title h2, .pc-comandos-conteudo h3,
  .pc-comandos-conteudo p, .pc-comandos-conteudo .command-name,
  .pc-comandos-conteudo .command-note { overflow-wrap: anywhere; }
  .pc-comandos-conteudo .footer-box { overflow-wrap: normal; }
  .pc-comandos-conteudo pre { max-width: 100%; box-sizing: border-box; overflow-x: auto; }
  .pc-comandos-dialog :focus-visible { outline: 3px solid #2268cf; outline-offset: 3px; }
  .pc-comandos-dialog [hidden] { display: none !important; }
  html[data-pc-theme="dark"] .pc-comandos-dialog, html[data-pc-theme="dark"] .pc-comandos-cabecalho, html[data-pc-theme="dark"] .pc-comandos-fixo { background: #242a3a; color: #fff; border-color: #fff; }
  html[data-pc-theme="dark"] .pc-comandos-fechar { background: #49c5fe; color: #111; }
  html[data-pc-theme="dark"] .pc-comandos-fechar:hover { background: #8adfff; }
  html[data-pc-theme="dark"] .pc-comandos-dialog fieldset { background: #172132; border-color: #fff; box-shadow: 4px 4px 0 #000; }
  html[data-pc-theme="dark"] .pc-comandos-dialog legend { background: #49c5fe; color: #111; }
  html[data-pc-theme="dark"] .pc-comandos-dialog label { background: #344055; color: #fff; border-color: #fff; }
  html[data-pc-theme="dark"] .pc-comandos-dialog label:has(input:checked) { background: #49c5fe; color: #111; border-color: #111; }
  html[data-pc-theme="dark"] .pc-comandos-dialog :focus-visible { outline-color: #49c5fe; }
  html[data-pc-theme="dark"] .pc-comandos-conteudo section { border-color: #fff; }
  html[data-pc-theme="dark"] .pc-comandos-conteudo summary { background: #344055; color: #fff; }
  /* Evitar que a margem automática use a largura expandida da página. */
  @media (max-width: 1099px) {
    .pc-comandos-dialog { left: 0; right: auto; max-width: 94vw; margin-left: 3vw; margin-right: 0; }
  }
  @media (max-width: 600px) {
    .pc-comandos-cabecalho { padding: 12px 16px; }
    .pc-comandos-conteudo summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
    .pc-comandos-conteudo summary::after { grid-column: 2; grid-row: 1 / 3; }
    .pc-comandos-modulo, .pc-comandos-modulo-titulo { grid-column: 1; min-width: 0; }
    .pc-comandos-dialog fieldset { flex-direction: column; gap: 4px; margin: 4px 16px 0; padding: 4px 8px; }
    .pc-comandos-dialog label { padding: 4px 10px; }
    .pc-comandos-conteudo { padding: 0 16px 16px; }
    .pc-comandos-conteudo .section-title { gap: 8px; }
    .pc-comandos-conteudo .section-title .num { flex: none; font-size: 42px; }
    .pc-comandos-conteudo .section-title h2 { font-size: clamp(21px, 6vw, 32px); }
    .pc-comandos-conteudo .command-card { transform: none; }
    .pc-comandos-conteudo .footer-box { transform: none; padding: 16px 8px; font-size: 18px; }
  }
  /* O caderno usa zoom de 80% no desktop; manter 44 px visíveis nos controles. */
  @media (min-width: 1100px) {
    .pc-comandos-fechar { width: 56px; height: 56px; }
    .pc-comandos-dialog label { min-height: 56px; }
  }
}
@media print { .pc-comandos-dialog { display: none !important; } }
