/* página do TCC: laboratório de inferência e arranjo sistólico */

.lab {
  display: grid; grid-template-columns: auto 1fr; gap: 32px; margin-top: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px;
}
.pad-wrap { position: relative; width: 280px; height: 280px; }
#pad {
  width: 280px; height: 280px; display: block; border-radius: 10px; background: #000;
  cursor: crosshair; touch-action: none; border: 1px solid var(--line);
}
.pad-hint {
  position: absolute; inset: 0; display: grid; place-items: center; margin: 0; pointer-events: none;
  font: 400 13px var(--mono); color: rgba(255, 255, 255, .45);
}
.pad-hint[hidden] { display: none; }
.lab-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; width: 280px; }
.lab-actions .btn { height: 36px; cursor: pointer; }
.sent { display: flex; align-items: center; gap: 10px; }
.sent canvas { width: 56px; height: 56px; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 4px; background: #000; }
.sent small { font: 400 11px/1.4 var(--mono); color: var(--muted); }

.samples { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(5, 52px); gap: 5px; }
.samples button {
  padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #000; cursor: pointer; display: block;
}
.samples button:hover, .samples button.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.samples canvas { width: 50px; height: 50px; image-rendering: pixelated; display: block; border-radius: 5px; }

.verdict { margin: 0 0 18px; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.verdict span { font: 700 44px var(--sans); letter-spacing: -0.03em; color: var(--ink); line-height: 1; }
.verdict small { font: 400 13px var(--mono); color: var(--muted); }

.bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 5px; }
.bars li { display: grid; grid-template-columns: 92px 1fr 64px; gap: 10px; align-items: center; font: 400 13px var(--mono); color: var(--ink-2); }
.bars .track { height: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.bars .fill { height: 100%; width: 0; background: var(--muted); opacity: .45; transition: width .25s ease; }
.bars li.top { color: var(--ink); font-weight: 500; }
.bars li.top .fill { background: var(--accent); opacity: 1; }
.bars .val { text-align: right; }
.bars .val small { color: var(--muted); }
.lab .src { font-size: 12px; color: var(--muted); margin: 14px 0 0; }

.maps { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.maps figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.maps figcaption { font-size: 13px; color: var(--ink-2); margin-bottom: 12px; }
.map-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.map-grid canvas { width: 100%; aspect-ratio: 1; image-rendering: pixelated; border-radius: 2px; background: #000; display: block; }

.sys { grid-template-columns: 1fr 360px; }
.array-fig { margin: 0; }
#array { width: 360px; height: 360px; display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.array-fig figcaption { font-size: 12px; color: var(--muted); margin-top: 8px; }

.work { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
.work th { font: 400 12px var(--mono); color: var(--muted); text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.work td { padding: 8px 10px; border-bottom: 1px dashed var(--line); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.work td:first-child { font-family: var(--mono); color: var(--accent); }
.work tfoot td { border-bottom: 0; color: var(--ink); font-weight: 600; }
.work.big td { font-size: 16px; }

.res { grid-template-columns: 1fr 1fr; }

@media (max-width: 900px) {
  .lab { grid-template-columns: 1fr; }
  .maps, .sys, .res { grid-template-columns: 1fr; }
  .array-fig { justify-self: center; }
}
@media (max-width: 640px) {
  .lab { padding: 16px; }
  .pad-wrap, #pad, .lab-actions { width: 100%; max-width: 280px; }
  #pad { height: auto; aspect-ratio: 1; }
  .pad-wrap { height: auto; }
  .samples { grid-template-columns: repeat(5, 1fr); }
  .samples canvas { width: 100%; height: auto; aspect-ratio: 1; }
  .bars li { grid-template-columns: 76px 1fr 56px; }
  #array { width: 100%; height: auto; aspect-ratio: 1; }
  .array-fig { justify-self: stretch; }
  .map-grid.small { grid-template-columns: repeat(8, 1fr); }
}
