/* 統計報告頁 */

.reports-page {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  align-items: start;
}

@media (max-width: 1100px) {
  .reports-page {
    grid-template-columns: minmax(0, 1fr);
  }
}

.cfg-grid {
  display: grid;
  gap: 12px;
}

.strategy-pick {
  display: grid;
  gap: 4px;
  max-height: 240px;
  overflow: auto;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.2);
}

.strategy-pick label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 7px;
  cursor: pointer;
}

.strategy-pick label:hover {
  background: rgba(255, 255, 255, 0.06);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.result-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.chart-box {
  position: relative;
  width: 100%;
  height: 300px;
}

.chart-box canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
}

.chart-box.short {
  height: 220px;
}

.cmp-table td.name {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.best {
  color: var(--win);
  font-weight: 700;
}

.worst {
  color: var(--lose);
  font-weight: 700;
}

.theory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.sel-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
}

.sel-row .field {
  min-width: 160px;
}

.saved-list {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow: auto;
}

.saved-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.2);
  flex-wrap: wrap;
}

.saved-item .meta {
  flex: 1 1 180px;
  min-width: 0;
}

.saved-item .meta b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Concise statistics in both interfaces; advanced controls stay available on demand. */
.stats-advanced { margin: 12px 0; border: 1px solid var(--line); border-radius: 6px; padding: 10px; }
.stats-advanced > summary { cursor: pointer; font-weight: 600; }
#levels-table { width: 100%; min-width: 0; table-layout: fixed; }
#levels-table th, #levels-table td { white-space: normal; overflow-wrap: anywhere; }
#levels-table td { padding: 5px 8px; }
#levels-table .chip-btn { padding: 2px 10px; }
#levels-shoes-table.compact-shoes, #shoes-table.compact-shoes { width: 100%; min-width: 0; table-layout: fixed; }
.compact-shoes th, .compact-shoes td { white-space: normal !important; overflow-wrap: anywhere; padding: 7px 5px; }
.shoe-detail-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.shoe-detail-fields dd { margin: 4px 0; overflow-wrap: anywhere; }
.shoe-detail-fields dt { opacity: .7; }
@media screen and (max-width: 700px) {
  .compact-shoes thead { display: none; }
  .compact-shoes, .compact-shoes tbody { display: block; }
  .compact-shoes tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border: 1px solid var(--line); margin-bottom: 8px; }
  .compact-shoes td { display: block; text-align: left; min-width: 0; }
  .compact-shoes td::before { content: attr(data-label); display: block; opacity: .7; font-size: 11px; }
  .shoe-detail-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
