/* 314 Evolução — experiência de tablet e modo escuro.
   Preferência exclusivamente local ao navegador (não armazena dados clínicos).
   A identidade bordô permanece na marca; o bordô claro é usado em textos sobre
   superfícies escuras para manter contraste.
*/

/* Comum aos dois temas: economia de espaço sem reduzir áreas de toque. */
.workspace-header-actions{display:flex;align-items:center;justify-content:flex-end;gap:13px;flex-wrap:wrap}
.workspace-header-actions .account{gap:9px}
.theme-toggle{
  background:transparent;color:#FFF5DA;border-color:rgba(255,245,218,.55);
  border-radius:10px;padding:9px 12px;min-height:44px;font-size:13px;
  white-space:nowrap
}
.theme-toggle:hover{background:rgba(255,245,218,.1)}
.fiche-compact-bar{display:flex;align-items:center;gap:13px;flex-wrap:wrap;margin:2px 0 11px}
.fiche-compact-bar .back{margin:0;flex-shrink:0;min-height:44px}
.fiche-compact-identity{min-width:0;flex:1}
.fiche-compact-identity .eyebrow{display:block;font-size:11px;letter-spacing:.08em;margin-bottom:2px}
.fiche-compact-identity h2{
  font:clamp(28px,3.6vw,36px)/1 'Bebas Neue',sans-serif;
  color:var(--wine);margin:0;overflow-wrap:anywhere
}
/* Mais conteúdo visível ao abrir a ficha, especialmente em modo paisagem. */
body.fiche-mode .workspace-header{padding-block:10px}
body.fiche-mode .workspace-header .brand strong{font-size:39px}
body.fiche-mode .workspace-main{margin-top:9px;padding-bottom:18px}
body.fiche-mode #workspaceContent>.fiche-section{margin-top:10px}
body.fiche-mode #workspaceContent>.fiche-section .fiche-section-heading{
  margin-bottom:13px;padding-bottom:10px
}
body.fiche-mode #workspaceContent>.fiche-section .fiche-section-heading h3{margin:2px 0 4px}
body.fiche-mode #workspaceContent>.fiche-section .fiche-section-heading p{margin:0}
@media(max-width:700px){
  .workspace-header-actions{gap:8px}
  .theme-toggle{padding-inline:9px}
  .fiche-compact-identity h2{font-size:30px}
  body.fiche-mode .workspace-main{margin-top:9px}
}
@media(orientation:landscape) and (max-height:920px){
  body.fiche-mode .demo-banner{padding-block:5px;font-size:10px}
  body.fiche-mode .workspace-header{padding-block:7px}
  body.fiche-mode .workspace-main{margin-top:8px}
  body.fiche-mode .fiche-section{padding-block:16px}
}

/* Dark: preto acinzentado próximo do OLED off, com cartão ligeiramente mais
   claro para facilitar contraste. Economia real depende da tecnologia da tela. */
html[data-theme="dark"]{
  color-scheme:dark;
  --wine:#f0aaaa;
  --cream:#fff5da;
  --sky:#95d7e9;
  --ink:#f2ece7;
  --muted:#c7bcb5;
  --line:#4b4547;
  --paper:#1b1d20;
  --bg:#101113;
  --warn:#f5ca8c;
  --panel2:#242528;
  --panel3:#2b2526;
}
html[data-theme="dark"] body{background:var(--bg);color:var(--ink)}
html[data-theme="dark"] .workspace-header{background:#530c13}
html[data-theme="dark"] .demo-banner{
  background:#14252c;color:#d5f0f5;border-color:#325664
}
html[data-theme="dark"] .theme-toggle{background:#32171c;color:#fff5da;border-color:#b47777}
html[data-theme="dark"] .theme-toggle:hover{background:#482027}
html[data-theme="dark"] .workspace-header .account button{
  background:transparent;border-color:#aa7877;color:#fff5da
}
html[data-theme="dark"] .workspace-header .account button:hover{
  background:rgba(255,245,218,.12)
}
html[data-theme="dark"] button:not(.primary):not(.theme-toggle){
  color:#f2d4cf;background:#2b262a;border-color:#625051
}
html[data-theme="dark"] button:not(.primary):not(.theme-toggle):hover{
  background:#3a3035;border-color:#cb8b87
}
html[data-theme="dark"] button.primary,
html[data-theme="dark"] nav button.selected{
  background:#781b26;color:#fff5da;border-color:#ab5660
}
html[data-theme="dark"] nav button.selected:hover,
html[data-theme="dark"] button.primary:hover{background:#902832}
html[data-theme="dark"] .panel,
html[data-theme="dark"] .class-card,
html[data-theme="dark"] .fiche-box,
html[data-theme="dark"] .fiche-triage,
html[data-theme="dark"] .fiche-initial,
html[data-theme="dark"] .fiche-clinical,
html[data-theme="dark"] .observation-panel,
html[data-theme="dark"] .goal-manager,
html[data-theme="dark"] .report-version-list,
html[data-theme="dark"] .offline-export-panel{
  background:var(--paper);border-color:var(--line);
  box-shadow:0 4px 14px rgba(0,0,0,.18)
}
html[data-theme="dark"] .fiche-tools-section{background:#18191b}
html[data-theme="dark"] .fiche-section-heading{border-color:var(--line)}
html[data-theme="dark"] .fiche-box p{color:var(--muted)}
html[data-theme="dark"] .fiche-grid{
  color:var(--ink)
}
html[data-theme="dark"] .class-student,
html[data-theme="dark"] .directory-entry,
html[data-theme="dark"] .report-version-button,
html[data-theme="dark"] .goal-creation,
html[data-theme="dark"] .goal-list-item,
html[data-theme="dark"] .obs-compose,
html[data-theme="dark"] .clinical-note-compose,
html[data-theme="dark"] .clinical-review,
html[data-theme="dark"] .initial-answers,
html[data-theme="dark"] .goal-assessment-editor,
html[data-theme="dark"] .goal-settings,
html[data-theme="dark"] .resolve-box,
html[data-theme="dark"] .report-editor,
html[data-theme="dark"] .report-entry-card,
html[data-theme="dark"] .offline-info,
html[data-theme="dark"] .offline-consent{
  background:var(--panel2);color:var(--ink);border-color:var(--line)
}
html[data-theme="dark"] .report-entry-card{background:var(--paper)}
html[data-theme="dark"] .class-student:hover,
html[data-theme="dark"] .directory-entry:hover,
html[data-theme="dark"] .report-version-button:hover{background:#3a3033}
html[data-theme="dark"] .report-version-button.is-selected{
  background:#45252a;border-color:#c9898b
}
html[data-theme="dark"] .work-input,
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] textarea,
html[data-theme="dark"] select{
  background:#151619;color:#f2ece7;border-color:#716364;
  caret-color:#f7d8d8
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{color:#b2a49d}
html[data-theme="dark"] input:focus-visible,
html[data-theme="dark"] textarea:focus-visible,
html[data-theme="dark"] select:focus-visible{outline:3px solid #95d7e9;outline-offset:1px}
html[data-theme="dark"] .pill,
html[data-theme="dark"] .pill.neutral,
html[data-theme="dark"] .incomplete,
html[data-theme="dark"] .report-tag{
  background:#393031;color:#eed8cc
}
html[data-theme="dark"] .pill.sky{background:#1f424f;color:#d3f3ff}
html[data-theme="dark"] .pill.warn{background:#55401f;color:#ffe1a8}
html[data-theme="dark"] .pill.good{background:#254a38;color:#c3f4cf}
html[data-theme="dark"] .work-notice,
html[data-theme="dark"] .attention,
html[data-theme="dark"] .triage-alert,
html[data-theme="dark"] .current-caution,
html[data-theme="dark"] .caution-summary,
html[data-theme="dark"] .obs-care-note,
html[data-theme="dark"] .offline-warning{
  background:#38291f;border-color:#88613e;color:#f6dcb8
}
html[data-theme="dark"] .current-caution>p,
html[data-theme="dark"] .observation-snippet p{color:var(--ink)}
html[data-theme="dark"] .triage-new-link,
html[data-theme="dark"] .initial-link-box,
html[data-theme="dark"] .goal-method-warning{
  background:#193641;border-color:#487988;color:#d4eff5
}
html[data-theme="dark"] .goal-change{background:#214432;color:#cbefd7}
html[data-theme="dark"] .empty{background:#212123;border-color:var(--line);color:var(--muted)}
html[data-theme="dark"] .outline{
  background:transparent;color:var(--ink);border-color:var(--line)
}
html[data-theme="dark"] .obs-item-head strong,
html[data-theme="dark"] .initial-answer strong,
html[data-theme="dark"] .observation-snippet strong,
html[data-theme="dark"] .goal-teaser strong,
html[data-theme="dark"] .goal-line strong,
html[data-theme="dark"] .directory-entry strong,
html[data-theme="dark"] .class-hour,
html[data-theme="dark"] .date-heading strong{
  color:var(--wine)
}
html[data-theme="dark"] .initial-answer,
html[data-theme="dark"] .observation-snippet,
html[data-theme="dark"] .goal-assessment-history{border-color:var(--line)}
html[data-theme="dark"] .report-selection-toolbar,
html[data-theme="dark"] .report-editable-section{
  background:#252529;border-color:#625658;color:var(--ink)
}
html[data-theme="dark"] .report-selection-count{color:var(--muted)}
html[data-theme="dark"] .report-section-heading>button,
html[data-theme="dark"] .report-item-toolbar>button{
  background:#3b2d31;color:#f6dbd7;border-color:#826b6d
}
html[data-theme="dark"] .report-page>.work-notice{background:#38291f}
html[data-theme="dark"] .report-editor h3,
html[data-theme="dark"] .report-version-list h3{color:var(--wine)}
html[data-theme="dark"] .offline-warning h3{color:#ffdbb7}
html[data-theme="dark"] .offline-info h3{color:var(--wine)}
html[data-theme="dark"] .report-screen-heading button{color:var(--ink)}

/* O documento A4 da prévia deve permanecer branco: é a representação fiel
   do PDF/JPEG e não deve sofrer alterações devido ao tema de consulta. */
html[data-theme="dark"] .report-paper{
  background:#ffffff;color:#292724;border-color:#d6c7b5
}
html[data-theme="dark"] .report-paper .report-goal h4{color:#4b2929}
html[data-theme="dark"] .report-paper .report-item-toolbar>button{
  background:#fffdf9;color:#674640;border-color:#d9c8bd
}
html[data-theme="dark"] .report-paper .report-editable-section{
  background:#fff;border-color:#d8caba
}
html[data-theme="dark"] .report-paper .report-section-heading h3{color:#620000}
html[data-theme="dark"] .report-paper .report-preview-hidden-section{
  background:#f0f0ef;border-color:#b5b5b4
}
@media print{
  /* Qualquer impressão mantém a folha clara; o exportador E4.2 usa canvas. */
  html[data-theme="dark"] .report-paper{
    background:#fff!important;color:#292724!important
  }
}