/* --- saúde (v2: medições SMART) ---------------------------------------------- */
.panel-head .spacer {
  flex: 1;
}
/* v5.17.0 (P06): os números (desgaste, horas, temperatura, a última medição) sem partir */
.disk-table td:nth-child(n + 4),
.battery-table td:nth-child(n + 3),
.battery-history td {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.disk-table td small,
.battery-table td small,
.battery-history td small,
.smart-history td small,
.import-item small {
  display: block;
  color: var(--muted);
  font-family: var(--sans);
  font-size: var(--fs-1);
  line-height: 1.35;
}
.disk-table td b,
.battery-table td b {
  font-family: var(--sans);
}
.disk-row.clickable,
.battery-row.clickable {
  cursor: pointer;
}
.disk-row.clickable:hover td,
.disk-row.clickable:focus-visible td,
.battery-row.clickable:hover td,
.battery-row.clickable:focus-visible td {
  background: var(--surface-2);
}
.disk-state .pill {
  margin-bottom: 3px;
}
.disk-row.h-critico td:first-child,
.battery-row.h-critico td:first-child,
.smart-history tr.h-critico td:first-child,
.battery-history tr.h-critico td:first-child {
  box-shadow: inset 3px 0 0 var(--bad);
}
.disk-row.h-atencao td:first-child,
.battery-row.h-atencao td:first-child,
.smart-history tr.h-atencao td:first-child,
.battery-history tr.h-atencao td:first-child {
  box-shadow: inset 3px 0 0 var(--warn);
}
/* --- baterias (v5.23.0): a barra da saúde, com a cor do estado e a marca dos 80 % ------- */
.bat-health {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
}
.bat-bar {
  position: relative;
  display: flex;
  width: 88px;
  height: 8px;
  border-radius: var(--r-pill);
  overflow: hidden;
  background: var(--surface-3);
}
.bat-bar .bat-fill {
  flex: 0 1 0;
  background: currentColor;
}
.bat-bar .bat-rest {
  flex: 0 1 0;
}
/* o limite de Atenção (ATTENTION_PCT em backend/baterias.py) */
.bat-bar::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 80%;
  width: 2px;
  background: var(--ink);
}
.bat-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
}
.bat-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: var(--s-4) var(--s-5);
  border-left: 1px solid var(--line);
}
.bat-stats > div:first-child {
  border-left: 0;
}
/* v5.26.0: na ficha, seis números em duas linhas de três */
.bat-stats.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.bat-stats.three > div:nth-child(3n + 1) {
  border-left: 0;
}
.bat-stats.three > div:nth-child(n + 4) {
  border-top: 1px solid var(--line);
}
.bat-stats dt {
  color: var(--muted);
  font-size: var(--fs-1);
}
.bat-stats dd {
  margin: 0;
  font-size: var(--fs-5);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.bat-stats dd small {
  display: block;
  color: var(--muted);
  font-size: var(--fs-1);
  font-weight: 400;
}
.bat-reason {
  margin: 0 0 var(--s-4);
  font-weight: 650;
}
/* v5.26.0: a explicação do aviso de queda, por baixo da razão */
.bat-reason + .bat-note {
  margin-top: calc(-1 * var(--s-3));
}
.bat-note {
  margin: 0 0 var(--s-4);
  color: var(--muted);
  font-size: var(--fs-2);
}
/* v5.26.0: a razão (o aviso de queda) parte em várias linhas */
.battery-history .disk-state small {
  white-space: normal;
}
.battery-history .row-actions {
  white-space: nowrap;
  text-align: right;
}
/* v5.24.0: a reinstalação do Windows entre as medições (como a mudança de firmware nos discos) */
.battery-history tr.event-row td {
  padding: var(--s-2) var(--s-3);
  background: var(--accent-soft);
  color: var(--ink);
  font: var(--fs-1) var(--sans);
  white-space: normal;
}
/* v5.24.0: importar o relatório da bateria: as notas (o que vai ser criado e os avisos) e os
   períodos que já têm medição (ficam os que existem) */
.bat-import-preview {
  margin-top: var(--s-4);
}
.import-note {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  margin: 0 0 var(--s-3);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--surface-2);
  color: var(--ink);
}
.import-note .ico {
  flex: none;
  margin-top: 2px;
}
.import-note.warn {
  border-color: var(--warn);
}
.import-note.warn .ico {
  color: var(--warn);
}
.battery-import tr.is-existing td {
  color: var(--muted);
}
.smart-history td {
  vertical-align: top;
}
.smart-history .disk-state {
  min-width: 230px;
}
.smart-history td code {
  white-space: nowrap;
}
.smart-history .delta {
  display: inline;
  margin-left: var(--s-2);
  font-family: var(--mono);
}
.smart-history .row-actions {
  white-space: nowrap;
  text-align: right;
}
/* --- tendências SMART (v3.4.0): gráficos por cima do histórico de um disco ------- */
.trends {
  margin: var(--s-5) 0 var(--s-5);
}
.trends > h3,
.history-title {
  margin-bottom: var(--s-3);
  color: var(--muted);
  font-size: var(--fs-1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.trend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
}
.trend-card {
  min-width: 0;
  padding: var(--s-4) var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--surface-2);
}
.trend-card.wide {
  grid-column: 1 / -1;
}
.trend-card h4 {
  margin: 0 0 var(--s-3);
  font-size: var(--fs-2);
  font-weight: 400;
  line-height: 1.45;
}
.trend-card h4 b {
  margin-right: var(--s-3);
  font-weight: 650;
}
.trend-card h4 span {
  color: var(--muted);
}
.trend-chart {
  position: relative;
  width: 100%;
  min-height: 40px;
  touch-action: pan-y;
}
.trend-chart svg {
  display: block;
  overflow: visible;
}
.tc-grid {
  stroke: var(--line);
  stroke-width: 1;
}
.tc-label {
  fill: var(--faint);
  stroke: none;
  font: var(--fs-1) var(--mono);
}
.tc-ref {
  stroke-width: 1.2;
  stroke-dasharray: 2 3;
}
/* Rótulos por cima das linhas: contorno da cor do fundo, para se lerem sobre elas. */
.trend-chart .tc-ref-label,
.trend-chart .tc-marker-label {
  stroke: var(--surface-2);
  stroke-width: 4px;
  stroke-linejoin: round;
  paint-order: stroke;
}
.tc-ref-label.t-warn,
.tc-ref-label.t-bad {
  fill: currentColor;
}
.tc-marker-label {
  fill: var(--ink);
  font-weight: 650;
}
.tc-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
}
.tc-line.dashed {
  stroke-dasharray: 6 4;
}
.tc-area {
  fill: var(--accent-soft);
}
/* v6.23.0: o gráfico da latência dos Serviços (a faixa entre o mínimo e o máximo, as falhas soltas por
   baixo do eixo e os buracos sem medições). */
.trend-chart .tc-band {
  fill: var(--accent-soft);
  stroke: none;
}
.tc-strike {
  stroke-width: 2;
}
.tc-gap {
  fill: var(--line);
  opacity: 0.6;
}
/* v6.25.0 (PLANO-SERVICOS-INTERFACE.md (tag v6.32.0), fase 1.4): os incidentes como zonas por trás da linha, as falhas
   soltas como pontos acima do eixo e os picos marcados no topo; a linha vertical segue o dedo. */
.tc-zone {
  opacity: 0.18;
}
.tc-zone.z-bad {
  fill: var(--bad);
}
.tc-zone.z-warn {
  fill: var(--warn);
}
.tc-zone.z-off {
  fill: var(--off);
}
.tc-solta {
  stroke: var(--surface);
  stroke-width: 1;
}
.tc-peak {
  stroke: none;
}
.trend-chart.follow svg {
  touch-action: pan-y;
}
.tc-dot {
  stroke-width: 1.5;
}
.tc-marker {
  fill: var(--surface-2);
  stroke-width: 2;
}
.tc-guide {
  stroke: var(--line-2);
  stroke-width: 1;
  pointer-events: none;
}
.t-accent {
  color: var(--accent);
  stroke: var(--accent);
  fill: var(--accent);
}
.t-warn {
  color: var(--warn);
  stroke: var(--warn);
}
.t-bad {
  color: var(--bad);
  stroke: var(--bad);
}
.tc-line.t-accent,
.tc-line.t-bad {
  fill: none;
}
.tc-dot.t-bad {
  fill: var(--bad);
}
.tc-dot.hollow,
.tc-marker {
  fill: var(--surface-2);
}
.tc-tip {
  position: absolute;
  z-index: 2;
  max-width: 240px;
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-1);
  background: var(--surface);
  box-shadow: var(--shadow);
  pointer-events: none;
  white-space: nowrap;
}
.tc-tip small {
  display: block;
  color: var(--muted);
  font-size: var(--fs-1);
}
.tc-tip b {
  font-size: var(--fs-2);
}
.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-5);
  margin-top: var(--s-2);
  color: var(--muted);
  font-size: var(--fs-1);
}
.trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
.trend-legend i {
  display: inline-block;
  width: 16px;
  height: 0;
  border-top: 2px solid var(--accent);
}
.trend-legend i.l-dashed {
  border-top-style: dashed;
}
.trend-legend i.l-hollow {
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
}
/* v5.26.0: as séries da Comparação das baterias (as cores --serie-* do base.css) */
.t-s1 {
  stroke: var(--serie-1);
  fill: var(--serie-1);
}
.t-s2 {
  stroke: var(--serie-2);
  fill: var(--serie-2);
}
.t-s3 {
  stroke: var(--serie-3);
  fill: var(--serie-3);
}
.t-s4 {
  stroke: var(--serie-4);
  fill: var(--serie-4);
}
.tc-line.t-s1,
.tc-line.t-s2,
.tc-line.t-s3,
.tc-line.t-s4 {
  fill: none;
}
.trend-legend i.l-s1 {
  border-top: 3px solid var(--serie-1);
}
.trend-legend i.l-s2 {
  border-top: 3px solid var(--serie-2);
}
.trend-legend i.l-s3 {
  border-top: 3px solid var(--serie-3);
}
.trend-legend i.l-s4 {
  border-top: 3px solid var(--serie-4);
}
/* v5.26.0: os eventos no gráfico da bateria (a reinstalação do Windows, a BIOS) */
.tc-event {
  stroke: var(--line-2);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}
.trend-chart .tc-event-label {
  fill: var(--muted);
  stroke: var(--surface);
  stroke-width: 4px;
  stroke-linejoin: round;
  paint-order: stroke;
}
.battery-trend {
  margin-bottom: var(--s-5);
}
.battery-trend-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-1) var(--s-5);
}
.battery-trend-head .trend-legend {
  margin: 0 0 var(--s-3);
}
.battery-compare .trend-legend {
  margin: 0 0 var(--s-4);
  color: var(--ink);
  font-size: var(--fs-2);
}
.battery-compare .chips-bar {
  margin: 0;
}
.trend-band {
  display: flex;
  gap: 2px;
  height: 12px;
}
.trend-band span {
  min-width: 4px;
  border-radius: var(--r-1);
  background: var(--off);
}
.trend-band .b-ok {
  background: var(--good);
}
.trend-band .b-atencao {
  background: var(--warn);
}
.trend-band .b-critico {
  background: var(--bad);
}
.trend-band-axis {
  display: flex;
  justify-content: space-between;
  margin-top: var(--s-1);
  color: var(--faint);
  font: var(--fs-1) var(--mono);
}
.trend-note {
  margin-top: var(--s-3);
  font-size: var(--fs-2);
}
.good-text {
  color: var(--good);
}
.original-row td {
  background: var(--surface-2);
}
pre.original {
  max-height: 340px;
  margin: 0;
  overflow: auto;
  font: var(--fs-1)/1.45 var(--mono);
  white-space: pre;
}
textarea.mono {
  font-family: var(--mono);
  font-size: var(--fs-1);
}
.panel-head.wrap {
  flex-wrap: wrap;
}
.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}
.token-table td small {
  display: block;
  color: var(--muted);
  font-size: var(--fs-1);
}
.token-table td small.warn {
  color: var(--warn);
}
/* v5.17.0 (P02): o texto por baixo de um selo tem a cor dele. */
.token-table td small.bad {
  color: var(--bad);
}
/* v2.6: comando para voltar a descarregar um script antigo; quebra a linha em vez de alargar a tabela. */
.token-update {
  max-width: 380px;
  margin-top: var(--s-1);
  font-size: var(--fs-1);
}
.token-update summary {
  cursor: pointer;
}
.token-update p {
  margin: var(--s-1) 0;
}
.token-update-for {
  display: block;
  color: var(--muted);
  font-size: var(--fs-1);
}
.token-update .copy-block {
  margin: 2px 0 var(--s-3);
}
.token-update .copy-block pre {
  padding: var(--s-3);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.token-table tr.revoked td {
  color: var(--muted);
}
.token-table .token-actions {
  text-align: right;
}
.token-table td {
  vertical-align: middle;
}
.copy-block {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  margin: var(--s-2) 0 var(--s-4);
}
.copy-block pre {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: var(--s-4);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--surface-2);
  font: var(--fs-1)/1.5 var(--mono);
  white-space: pre;
}
details.platform {
  margin-bottom: var(--s-3);
}
details.platform summary {
  cursor: pointer;
  font-weight: 650;
  padding: var(--s-1) 0;
}
.import-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s-3);
}
.import-item {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
}
.import-item.h-critico {
  border-color: var(--bad);
}
.import-item.h-atencao {
  border-color: var(--warn);
}
.import-item.error {
  border-style: dashed;
}
.import-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}
.import-item .reason {
  color: var(--ink);
}
.warn-text {
  color: var(--warn) !important;
}
.check-line {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  cursor: pointer;
}
.check-line input {
  /* v3.1.0: sem isto, a regra geral dos inputs (largura 100%, 38 px) esticava a caixa */
  flex: none;
  width: auto;
  min-height: 0;
  margin-top: 3px;
}
.check-line small {
  display: block;
  color: var(--muted);
}
.day-smart {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.day-smart li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-1) var(--s-3);
  padding: var(--s-3) var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  cursor: pointer;
}
.day-smart li:hover {
  background: var(--surface-2);
}
.day-smart small {
  flex-basis: 100%;
  color: var(--muted);
}
/* v4.3.0: calibração automática das escritas (histórico do disco) */
.calibration {
  margin: var(--s-2) 0 var(--s-4);
}
.calibration.proposal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--accent);
  border-radius: var(--r-2);
  background: var(--accent-soft);
}
.calibration.proposal p {
  flex: 1 1 240px;
  margin: 0;
}
.calibration.proposal small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}
.calibration code {
  font-size: var(--fs-1);
}
/* v4.4.0: firmware dos discos (mudanças no histórico e nas tendências, nota na página Saúde) */
.smart-history tr.firmware-row td {
  padding: var(--s-2) var(--s-3);
  background: var(--accent-soft);
  color: var(--ink);
  font: var(--fs-1) var(--sans);
}
.disk-table td small.firmware-note {
  color: var(--warn);
}
.firmware-changes {
  margin: var(--s-1) 0 0;
  padding-left: var(--s-5);
  font-size: var(--fs-2);
}
/* v5.14.0 (ponto 9): no telemóvel, os discos e a memória em cartões compactos (a tabela fica no
   computador); sem nenhuma medição, como começar. */
.h-cards {
  display: none;
  margin: 0;
  padding: 0;
  list-style: none;
}
.h-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: var(--s-4) var(--s-1) var(--s-4) var(--s-4);
  border-top: 1px solid var(--line);
}
.h-card:first-child {
  border-top: 0;
}
.h-card.clickable {
  cursor: pointer;
}
.h-card.h-atencao {
  box-shadow: inset 3px 0 0 var(--warn);
}
.h-card.h-critico {
  box-shadow: inset 3px 0 0 var(--bad);
}
.h-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
}
.h-card-head .pill {
  flex: none;
}
.h-card small {
  color: var(--muted);
}
.h-card-problem {
  color: var(--warn);
  font-weight: 650;
}
.h-card.h-critico .h-card-problem {
  color: var(--bad);
}
.h-card-numbers {
  font-family: var(--mono);
  font-size: var(--fs-2);
}
.no-readings {
  display: flex;
  gap: var(--s-4);
  margin-bottom: var(--s-4);
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--surface-2);
}
.no-readings-ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--r-2);
  background: var(--accent-soft);
  color: var(--accent);
}
.no-readings h3 {
  font-size: var(--fs-4);
}
.no-readings p {
  margin: var(--s-2) 0 var(--s-4);
  color: var(--muted);
}
.no-readings-act {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}
@media (max-width: 860px) {
  .h-cards {
    display: block;
  }
  .h-table {
    display: none;
  }
}
/* v5.25.0: o Mac: as células e o uso ao longo da vida, lado a lado no computador */
.bat-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-5);
  margin: 0 0 var(--s-4);
}
.bat-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3) var(--s-5);
  margin: 0;
}
.bat-list > div {
  min-width: 0;
}
.bat-list dt {
  color: var(--muted);
  font-size: var(--fs-1);
}
.bat-list dd {
  margin: 0;
  font-family: var(--mono);
  font-size: var(--fs-2);
  font-variant-numeric: tabular-nums;
}
.bat-list dd small {
  display: block;
  color: var(--muted);
  font-family: var(--sans);
  font-size: var(--fs-1);
}
