/* Page wrapper — dark, centers the e-ink canvas. */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #1a1a1a;
  color: #eaeaea;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  font-family: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

.page-label {
  font-size: 11px;
  color: #888;
  margin-bottom: 10px;
  letter-spacing: 0.05em;
}

.controls {
  margin-top: 18px;
  font-size: 13px;
  display: flex;
  gap: 18px;
}
.controls a {
  color: #6af;
  text-decoration: none;
}
.controls a:hover { text-decoration: underline; }

/* The 800×480 TRMNL canvas — pure black / pure white. */
.canvas {
  width: 800px;
  height: 480px;
  background: #000;
  color: #fff;
  padding: 8px 14px;
  overflow: hidden;
  font-size: 11px;
  line-height: 13px;
  border: 1px solid #333;
  position: relative;
}

.title-bar {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 12px;
  border-bottom: 1px solid #fff;
  padding-bottom: 3px;
  margin-bottom: 4px;
}

.section {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
  margin-bottom: 4px;
}

.c-ticker { width: 50px; }
.c-name   { width: 170px; }
.c-price  { width: 70px; }
.c-pct    { width: 60px; }
.c-cell   { width: 30px; }
.c-num    { width: 40px; }
.c-stage  { width: 44px; }
.c-flip   { width: 22px; }

.section thead th {
  font-weight: 400;
  font-size: 10px;
  text-align: center;
  padding: 2px 3px 2px 3px;
  border-bottom: 1px solid #fff;
  white-space: nowrap;
}

.section thead .section-title {
  font-weight: 700;
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.section thead th.num {
  text-align: right;
}

.section tbody td {
  padding: 0 3px;
  white-space: nowrap;
  font-size: 11px;
  line-height: 13px;
}

.section tbody .ticker { font-weight: 700; }
.section tbody .name   { color: #ddd; }
.section tbody .price,
.section tbody .pct-change { text-align: right; }
.section tbody .cell  { text-align: center; }
.section tbody .num   { text-align: right; }
.section tbody .stage { text-align: center; }
.section tbody .flip  { text-align: center; }

/* Subtle visual cue for pos/neg today on the web preview only.
   On the TRMNL device this all renders monochrome anyway. */
.pct-change.pos { color: #fff; }
.pct-change.neg { color: #bbb; }

.page-indicator {
  position: absolute;
  bottom: 6px;
  right: 14px;
  font-size: 10px;
  color: #fff;
}

/* ---- shared scanner-screen layout (EMA / Reclaim / MACD) ---- */
.scan-grid {
  display: flex;
  gap: 14px;
}
.scan-col {
  flex: 1;
  min-width: 0;
}
.side-head {
  font-weight: 700;
  font-size: 11px;
  border-bottom: 1px solid #fff;
  padding-bottom: 2px;
  margin-bottom: 4px;
  letter-spacing: 0.03em;
}
.side-head .count {
  float: right;
  font-weight: 400;
  color: #bbb;
}

/* EMA tier chips */
.tier-row {
  display: flex;
  align-items: baseline;
  margin-bottom: 6px;
}
.tier-badge {
  flex: 0 0 18px;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid #fff;
  text-align: center;
  margin-right: 6px;
  line-height: 15px;
}
.chips {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 3px 8px;
}
.chip {
  font-size: 12px;
  line-height: 15px;
}
.chip.casc {
  font-weight: 700;
}
.chip.casc::before {
  content: "● ";
  font-size: 8px;
  vertical-align: middle;
}
.empty { color: #888; }

/* Reclaim / MACD mini tables */
table.mini {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
}
table.mini th {
  font-weight: 400;
  font-size: 10px;
  color: #ccc;
  border-bottom: 1px solid #555;
  padding: 1px 4px;
}
table.mini td {
  font-size: 11px;
  line-height: 14px;
  padding: 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
table.mini .l { text-align: left; }
table.mini .r { text-align: right; }
table.mini th:not(.l):not(.r) { text-align: center; }
table.mini td:not(.l):not(.r) { text-align: center; }
table.mini .tk { font-weight: 700; }

.legend {
  position: absolute;
  bottom: 6px;
  left: 14px;
  font-size: 9px;
  color: #aaa;
}
