/* HOSPIQ Academy · Segurança do Paciente (NSP)
   Complementos ao sistema visual do HOSPIQ (styles.css + interface-design.css +
   quality-learning.css + learning-controls.css). Mesma paleta: petróleo, papel, lima. */

.nsp-app .toast { grid-template-columns: 1fr; font-size: 13px; line-height: 1.5; }
.nsp-loading, .nsp-error { max-width: 760px; padding: 48px 0; }
.nsp-loading p { color: #536862; }
.nsp-error h1 { color: #183e37; }

/* Troca de formação */
.nsp-switcher { position: relative; }
.nsp-course-menu { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); display: grid; gap: 4px; padding: 6px; background: #fffefa; border: 1px solid #d4dccf; border-radius: 10px; box-shadow: 0 12px 30px #10303022; }
.nsp-course-menu a { display: block; padding: 10px 12px; border-radius: 8px; color: #1d4a41; text-decoration: none; }
.nsp-course-menu a:hover, .nsp-course-menu a:focus-visible { background: #eef2e6; }
.nsp-course-menu a[aria-current] { background: #e7efd8; }
.nsp-course-menu strong { display: block; font-size: 12px; }
.nsp-course-menu small { display: block; font-size: 11px; color: #5c6f66; margin-top: 2px; }
.support-card a { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: #164b48; text-decoration: none; font-weight: 700; }
.profile-card { cursor: default; }

/* Página inicial */
.nsp-highlights { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 40px; }
.nsp-highlights > div { padding: 18px 20px; background: #fffefa; border: 1px solid #d6dfcf; border-radius: 12px; box-shadow: var(--hq-shadow); }
.nsp-highlights strong { display: block; font-size: 28px; line-height: 1.1; letter-spacing: -.03em; color: #174d46; font-weight: 720; }
.nsp-highlights span { display: block; margin-top: 6px; font-size: 12.5px; line-height: 1.45; color: #536862; }
.nsp-docs-portal { margin-top: 36px; }
.nsp-docs-portal .lab-portal__art { background: #123d40; }
.nsp-docs-portal .lab-portal__photo { object-position: center; opacity: 1; }
.nsp-home .learning-module ol li[hidden], .nsp-home .learning-module[hidden] { display: none !important; }
@media (max-width: 900px) { .nsp-highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Página da aula */
.nsp-lesson.ql-page { max-width: none; }
.nsp-lesson .learning-heading h1 { font-size: clamp(28px, 3vw, 42px); }
.nsp-lesson .qdc-section > h2, .nsp-lesson .ql-video-section > h2 { font-size: 1.3rem; margin: 0 0 14px; }
.nsp-parts-title { margin: 36px 0 6px; }
.nsp-basis { display: flex; align-items: center; gap: 8px; margin-top: 12px !important; color: #3f6157; font-size: .82rem; }
.nsp-basis svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; }
.nsp-key-idea { margin-top: 22px; padding: 18px 22px; border-radius: 10px; background: #174d46; color: #f3f6ea; }
.nsp-key-idea span { display: block; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 750; color: #d5eaa1; }
.nsp-key-idea p { margin: 6px 0 0 !important; font-size: 1.05rem; line-height: 1.55 !important; color: #fffefa; font-weight: 600; }
.nsp-table-scroll { overflow-x: auto; border: 1px solid #d7e0cf; border-radius: 10px; }
.nsp-table { width: 100%; border-collapse: collapse; min-width: 560px; font-size: .9rem; }
.nsp-table th, .nsp-table td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid #e1e7da; line-height: 1.55; }
.nsp-table thead th { background: #174d46; color: #fffefa; font-size: .78rem; letter-spacing: .03em; }
.nsp-table tbody th { color: #1d4a41; background: #f3f5ec; width: 24%; }
.nsp-table tbody tr:last-child > * { border-bottom: 0; }
.nsp-case-setting { font-style: italic; color: #445c55; }
.nsp-step { display: inline-grid; place-items: center; min-width: 28px; height: 24px; margin-right: 6px; padding: 0 5px; border-radius: 5px; background: #e7efd8; color: #2f5d3d; font-size: .75rem; vertical-align: 2px; }
.nsp-takeaway { margin-top: 26px; }
.nsp-terms { display: grid; gap: 0; margin: 8px 0 18px; }
.nsp-terms > div { display: grid; grid-template-columns: minmax(150px, 1fr) 3fr; gap: 18px; padding: 13px 0; border-top: 1px solid #e0e7d8; }
.nsp-terms dt { font-weight: 700; color: #1d4a41; }
.nsp-terms dd { margin: 0; line-height: 1.65; }
.nsp-terms dd a { font-size: .85rem; white-space: nowrap; }
.nsp-terms > div[hidden] { display: none; }
.ql-question p.is-correct { background: #e9f3dc; border-left: 4px solid #5d8a3a; }
.ql-question p.is-wrong { background: #fbefe2; border-left: 4px solid #b8742f; }
.nsp-quiz-score { font-weight: 650; color: #2f5d3d; min-height: 1.5em; }
.nsp-references { padding-left: 20px; }
.nsp-references li { margin: 9px 0; }
.nsp-references a { display: inline-flex; gap: 6px; align-items: baseline; }
.nsp-references svg { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; }
.nsp-footnote { font-size: .82rem; color: #586c63; margin: -10px 0 30px; }
.nsp-lesson .learning-continue button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.nsp-lesson .ql-downloads { display: flex; flex-wrap: wrap; gap: 10px; }
.nsp-lesson .ql-downloads .button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* Composições didáticas adicionais (cenas 2–10 do player) */
.nsp-qdt .qdt-eyebrow span:last-child { color: #6b5a2c; }
.nsp-qdt .qdt-flow > li.is-focus, .nsp-qdt .qdt-checklist > li.is-focus, .nsp-qdt .qdt-evidence > li.is-focus { background: #e5f1b4; }
.nsp-hierarchy { display: grid; gap: .9cqw; }
.nsp-hierarchy > li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr); gap: 2cqw; align-items: center; margin-left: calc(var(--level) * 3.2cqw); padding: 1.3cqw 1.8cqw; border-radius: 4px; background: #e4ede0; border-left: 6px solid #07535b; }
.nsp-hierarchy > li[data-level="0"] { background: #07535b; color: #fffefa; border-left-color: #c8f24f; }
.nsp-hierarchy > li[data-level="0"] strong { color: #e8f6bf; }
.nsp-hierarchy > li[data-level="1"] { background: #d4e6dc; }
.nsp-hierarchy > li[data-level="2"] { background: #edf2e2; border-left-color: #7a9961; }
.nsp-hierarchy > li[data-level="3"] { background: #f4ecda; border-left-color: #b98a3c; }
.nsp-hierarchy > li[data-level="4"] { background: #f5e6dc; border-left-color: #b8653a; }
.nsp-hierarchy strong { color: #07535b; line-height: 1.25; }
.nsp-hierarchy p { margin: 0; font-size: .92em; }
.nsp-matrix-wrap { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 3cqw; align-items: center; }
.nsp-matrix-wrap.is-alone { grid-template-columns: minmax(0, 1fr); }
.nsp-matrix { display: grid; grid-template-columns: minmax(0, 1.25fr) repeat(var(--cols), minmax(0, 1fr)); gap: .5cqw; font-size: .82em; }
.nsp-matrix > div { display: grid; place-items: center; text-align: center; min-height: 5.2cqw; padding: .6cqw; line-height: 1.2; }
.nsp-matrix__corner { font-size: .78em; color: #4b625e; place-items: end start !important; text-align: left !important; }
.nsp-matrix__col, .nsp-matrix__row { font-weight: 750; color: #07535b; background: #e9eee2; }
.nsp-matrix__row { justify-items: start !important; text-align: left !important; }
.nsp-matrix__cell { font-weight: 700; color: #1d3a35; border: 2px solid transparent; }
.nsp-matrix__cell.is-baixo { background: #d9ead6; }
.nsp-matrix__cell.is-moderado { background: #f2e6b3; }
.nsp-matrix__cell.is-alto { background: #f0c9a1; }
.nsp-matrix__cell.is-extremo { background: #e5a296; }
.nsp-matrix__cell.is-focus { border-color: #07535b; box-shadow: 0 0 0 3px #c8f24f inset; transform: scale(1.04); }
.nsp-matrix__notes > div { padding: 1.2cqw 0; border-top: 1px solid #b7c9be; }
.nsp-matrix__notes dt { color: #07535b; }
.nsp-matrix__notes dd { margin: .3cqw 0 0; }
.nsp-definition { display: grid; gap: 2.4cqw; }
.nsp-definition__main { padding: 2.4cqw 2.8cqw; background: #fffef8; border: 1px solid #becbbb; border-top: 5px solid #07535b; box-shadow: 0 8px 20px #17382e0a; }
.nsp-definition__main dt { color: #07535b; font-size: .9em; letter-spacing: .02em; }
.nsp-definition__main dd { margin: 1cqw 0 0; font-size: 1.22em; line-height: 1.35; font-weight: 600; color: #153b3d; }
.nsp-definition__more { display: grid; grid-template-columns: repeat(var(--qdt-count), minmax(0, 1fr)); gap: 1.6cqw; }
.nsp-definition__more > div { padding: 1.5cqw; background: #e6f0e9; border-left: 3px solid #07535b; }
.nsp-definition__more > div:nth-child(2) { background: #f4ebd9; border-left-color: #8a592b; }
.nsp-definition__more dt { color: #07535b; font-size: .88em; margin-bottom: .4cqw; }
.nsp-definition__more dd { margin: 0; font-size: .92em; }
.nsp-quote { display: grid; gap: 0; border-left: 4px solid #07535b; background: #fffef8; box-shadow: 0 8px 20px #17382e0a; }
.nsp-quote > div { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 3fr); gap: 2cqw; align-items: baseline; padding: 1.3cqw 2cqw; }
.nsp-quote > div + div { border-top: 1px solid #d4ddd0; }
.nsp-quote > div.is-focus { background: #e5f1b4; }
.nsp-quote dt { color: #07535b; font-size: .85em; white-space: nowrap; }
.nsp-quote dd { margin: 0; }
@container (max-width: 520px) {
  .nsp-hierarchy > li, .nsp-quote > div { grid-template-columns: 1fr; gap: 4px; margin-left: 0; }
  .nsp-matrix-wrap { grid-template-columns: 1fr; }
  .nsp-definition__more { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nsp-hierarchy > li { grid-template-columns: 1fr; gap: 4px; margin-left: 0; padding: 10px 12px; }
  .nsp-quote > div { grid-template-columns: 1fr; gap: 2px; padding: 10px 12px; }
  .nsp-quote dt { white-space: normal; }
  .nsp-matrix-wrap { grid-template-columns: 1fr; gap: 14px; }
  .nsp-matrix > div { min-height: 34px; font-size: 12px; }
  .nsp-definition__more { grid-template-columns: 1fr; }
  .nsp-definition__main { padding: 14px 16px; }
  .nsp-terms > div { grid-template-columns: 1fr; gap: 4px; }
}

/* Documentos, glossário, biblioteca e anotações */
.nsp-documents .ql-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 22px; }
.nsp-documents .ql-card[hidden] { display: none; }
.nsp-letters { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0; }
.nsp-letters a { display: grid; place-items: center; min-width: 38px; height: 38px; border: 1px solid #d3ddc8; border-radius: 8px; background: #fffefa; font-weight: 700; text-decoration: none; }
.nsp-letter h2 { margin: 28px 0 4px; color: #174d46; }
.nsp-letter[hidden] { display: none; }
.nsp-terms--full > div { padding: 15px 0; }
.nsp-library-list { list-style: none; padding: 0; margin: 10px 0 0; }
.nsp-library-item { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 13px 0; border-top: 1px solid #e0e7d8; margin: 0 !important; }
.nsp-library-item strong { display: block; color: #1d4a41; font-size: .95rem; line-height: 1.45; }
.nsp-library-item small { display: block; margin-top: 3px; color: #5d7067; font-size: .8rem; }
.nsp-library-links { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: flex-end; font-size: .85rem; font-weight: 650; }
.nsp-note-form label { display: grid; gap: 6px; margin-bottom: 14px; }
.nsp-note-form label > span { font-weight: 650; font-size: .9rem; color: #2a4d43; }
.nsp-note-form select, .nsp-note-form textarea { border: 1px solid #c0ceba; border-radius: 8px; background: #fffefa; padding: 10px 12px; min-height: 46px; }
.nsp-note header { font-size: .82rem; color: #5d7067; }
.nsp-note p { margin: 8px 0 !important; }
.nsp-note-actions { display: flex; gap: 14px; }
.nsp-note-actions .text-link { background: none; border: 0; padding: 6px 0; color: #0b6861; font-weight: 650; cursor: pointer; min-height: 40px; }
.nsp-file-button { cursor: pointer; }
.nsp-empty { color: #5d7067; }
.nsp-about-modules { padding-left: 20px; }
.nsp-about-modules li { margin: 12px 0; }
.nsp-about-modules span { display: block; color: #4f655c; }
@media (max-width: 640px) {
  .nsp-library-item { flex-direction: column; align-items: flex-start; gap: 8px; }
  .nsp-library-links { justify-content: flex-start; }
}

/* Impressão: a aula em texto ocupa a página; o player não é impresso. */
@media print {
  .sidebar, .topbar, .learning-section-nav, .qdc-section, .learning-module-nav, .learning-continue, .nsp-footnote, .toast-region { display: none !important; }
  .main-shell { margin: 0 !important; }
  .learning-workspace { display: block !important; }
}
