/* Transfer-pace view — Apple-clean read on "is today good or bad vs history?"
   Reuses the dashboard design tokens (styles.css). Loaded alongside it. */

.viewswitch { display: flex; align-items: center; margin-bottom: var(--sp-4); }

#pace-view { animation: pace-fade 0.18s ease; }
@keyframes pace-fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.pace-loading {
  padding: 60px var(--sp-6); text-align: center; color: var(--muted);
  font-size: 14px;
}

/* ---------- headline verdict (2-second read) ---------- */
.pace-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-5);
}
.pace-hero__top {
  display: flex; align-items: center; gap: var(--sp-4);
  flex-wrap: wrap; margin-bottom: var(--sp-4);
}
.pace-badge {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 7px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 800; letter-spacing: 0.4px;
  border: 1px solid transparent; white-space: nowrap;
}
.pace-badge::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.pace-badge.good  { color: var(--green); background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.pace-badge.ahead { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.pace-badge.warn  { color: var(--amber); background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.pace-badge.bad   { color: var(--red); background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.pace-badge.neutral { color: var(--muted); background: var(--surface-3); border-color: var(--line-strong); }

.pace-hero__title { font-size: 15px; font-weight: 700; color: var(--fg-strong); }
.pace-hero__sub { font-size: 12px; color: var(--muted); }
.pace-hero__spacer { flex: 1 1 auto; }
.pace-hero__stale {
  font-size: 11px; color: var(--amber); font-weight: 600;
  padding: 3px 8px; border-radius: 999px; background: var(--amber-soft);
}

.pace-hero__summary {
  font-size: 14px; color: var(--fg); line-height: 1.5;
  margin-bottom: var(--sp-4); max-width: 900px;
}
.pace-hero__summary b { color: var(--fg-strong); }
.pace-hero__summary .up { color: var(--green); font-weight: 700; }
.pace-hero__summary .down { color: var(--red); font-weight: 700; }
.pace-hero__summary .flat { color: var(--muted); font-weight: 700; }

.pace-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); }
@media (max-width: 900px) { .pace-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pace-tile {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: var(--sp-4);
  display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.pace-tile__label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); font-weight: 600; }
.pace-tile__value { font-size: 26px; font-weight: 700; color: var(--fg-strong); line-height: 1.1; font-variant-numeric: tabular-nums; }
.pace-tile__value small { font-size: 13px; font-weight: 600; color: var(--muted); }
.pace-tile__sub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pace-tile__sub .up { color: var(--green); font-weight: 700; }
.pace-tile__sub .down { color: var(--red); font-weight: 700; }
.pace-tile__sub .flat { color: var(--muted); font-weight: 600; }

/* ---------- data-quality banner ---------- */
.pace-dq {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent);
  color: var(--fg); border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-5); font-size: 13px; line-height: 1.5;
}
.pace-dq b { color: var(--amber); }
.pace-dq svg { flex: none; color: var(--amber); margin-top: 2px; }

/* ---------- section headings ---------- */
.pace-h2 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--muted); font-weight: 700; margin: var(--sp-6) 0 var(--sp-3);
}
.pace-note { font-size: 11px; color: var(--faint); margin-bottom: var(--sp-3); }
.pace-note b { color: var(--muted); }

/* ---------- status panels (3-up) ---------- */
.pace-panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); }
@media (max-width: 800px) { .pace-panels { grid-template-columns: 1fr; } }
.pace-panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: var(--sp-4); box-shadow: var(--shadow-sm);
}
.pace-panel h3 { margin: 0 0 var(--sp-2); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); font-weight: 700; }
.pace-panel__big { font-size: 30px; font-weight: 700; color: var(--fg-strong); line-height: 1.05; font-variant-numeric: tabular-nums; }
.pace-panel__big small { font-size: 14px; font-weight: 600; color: var(--muted); }
.pace-panel__row { font-size: 13px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.pace-panel__row b { color: var(--fg); }

/* ---------- heatmap + cumulative grids ---------- */
.pace-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
table.pace-heat { border-collapse: separate; border-spacing: 0; font-size: 11px; width: 100%; }
table.pace-heat th, table.pace-heat td { padding: 0; text-align: center; }
.pace-heat th.hour { font-weight: 600; color: var(--muted); font-size: 10px; padding: 6px 0 2px; border-bottom: 1px solid var(--line); }
.pace-heat th.blk { font-weight: 500; color: var(--faint); font-size: 9px; padding: 2px 0 6px; }
.pace-heat .daylabel {
  text-align: left; padding: 0 12px 0 12px; color: var(--fg); white-space: nowrap;
  font-size: 12px; font-variant-numeric: tabular-nums;
}
.pace-heat .daylabel .tagtoday { color: var(--amber); font-weight: 800; margin-left: 6px; font-size: 10px; }
.pace-heat .daylabel .tagcomp { color: var(--red); font-weight: 700; margin-left: 6px; font-size: 10px; }
.pace-cell {
  width: 34px; height: 38px; line-height: 1; padding: 2px 0; vertical-align: middle;
  border-right: 1px solid var(--surface); border-bottom: 1px solid var(--surface);
  font-variant-numeric: tabular-nums;
}
.pace-cell .big { font-size: 12px; font-weight: 700; }
.pace-cell .cum { font-size: 9px; font-weight: 400; opacity: 0.7; margin-top: 2px; }
.pace-cell.future, .pace-cum-cell.future {
  background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 4px, var(--surface-3) 4px, var(--surface-3) 8px);
  color: var(--faint);
}
/* Blue volume ramp (fixed scale, works both themes; matches the skill). */
.v0 { background: var(--surface-3); color: var(--faint); }
.v1 { background: #dbeafe; color: #1e3a8a; }
.v2 { background: #93c5fd; color: #10245e; }
.v3 { background: #60a5fa; color: #0b1c46; }
.v4 { background: #3b82f6; color: #fff; }
.v5 { background: #1d4ed8; color: #fff; }
.v6 { background: #1e3a8a; color: #fff; }
.pace-heat tr.today .daylabel { color: var(--amber); font-weight: 800; }
.pace-heat tr.today td { background: color-mix(in srgb, var(--amber) 12%, transparent); }
.pace-heat tr.comp .daylabel { color: var(--red); font-weight: 700; }
.pace-heat tr.comp td { background: color-mix(in srgb, var(--red) 9%, transparent); }
.pace-heat tr.today .pace-cell, .pace-heat tr.comp .pace-cell { background-clip: padding-box; }
.pace-heat .tot { text-align: right; padding: 0 8px 0 14px; font-weight: 700; font-size: 12px; color: var(--fg-strong); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pace-heat .sp, .pace-heat .cplcol { text-align: right; padding: 0 12px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pace-heat .sofar { font-size: 9px; color: var(--red); font-weight: 600; }

/* cumulative grid cells */
table.pace-cum { border-collapse: separate; border-spacing: 0; font-size: 10px; width: 100%; }
.pace-cum th { font-weight: 600; color: var(--muted); padding: 6px 4px; border-bottom: 1px solid var(--line); font-size: 9px; text-align: right; white-space: nowrap; }
.pace-cum th:first-child { text-align: left; padding-left: 12px; }
.pace-cum-cell { padding: 5px 4px; text-align: right; border-bottom: 1px solid var(--line); vertical-align: middle; font-variant-numeric: tabular-nums; }
.pace-cum-cell .cnum { font-size: 11px; font-weight: 600; color: var(--fg-strong); }
.pace-cum-cell .cplnum { font-size: 9px; color: var(--muted); margin-top: 1px; }
.pace-cum .daylabel { text-align: left; padding-left: 12px; color: var(--fg); white-space: nowrap; font-size: 11px; }
.pace-cum tr.today td { background: color-mix(in srgb, var(--amber) 12%, transparent); }
.pace-cum tr.today .daylabel { color: var(--amber); font-weight: 800; }
.pace-cum tr.comp td { background: color-mix(in srgb, var(--red) 9%, transparent); }
.pace-cum tr.comp .daylabel { color: var(--red); font-weight: 700; }
.pace-cum tr.avg td { background: var(--surface-2); border-top: 2px solid var(--line-strong); }
.pace-cum tr.avg .daylabel { font-style: italic; color: var(--muted); font-weight: 700; }
.pace-cum .eod { text-align: right; padding: 5px 12px; font-weight: 700; color: var(--fg-strong); white-space: nowrap; }

/* legend */
.pace-legend { display: flex; gap: 6px; align-items: center; margin: var(--sp-3) 0; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.pace-legend .sw { width: 22px; height: 13px; border-radius: 3px; }

/* ---------- block-by-block comparison table ---------- */
.pace-block-table { width: 100%; border-collapse: collapse; font-size: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.pace-block-table th { font-weight: 600; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line-strong); font-size: 11px; text-align: right; background: var(--surface-2); white-space: nowrap; text-transform: uppercase; letter-spacing: 0.3px; }
.pace-block-table th:first-child { text-align: left; }
.pace-block-table td { padding: 6px 12px; text-align: right; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.pace-block-table td:first-child { text-align: left; color: var(--muted); }
.pace-block-table tr:last-child td { border-bottom: none; }
.pace-block-table tbody tr:hover td { background: var(--accent-soft); }
.pace-pos { color: var(--green); font-weight: 700; }
.pace-neg { color: var(--red); font-weight: 800; }
.pace-warn { color: var(--amber); font-weight: 700; }
.pace-neu { color: var(--muted); }

.pace-prov { font-size: 11px; color: var(--faint); margin-top: var(--sp-5); line-height: 1.6; border-top: 1px solid var(--line); padding-top: var(--sp-3); }
.pace-prov b { color: var(--muted); }
.pace-prov details { margin-top: 4px; }
.pace-prov summary { cursor: pointer; color: var(--muted); }
