/* ── History view shell ──────────────────────────────────────────────────── */
.view-shell {
  display: flex;
  flex-direction: column;
  max-width: 980px;
  margin: 0 auto;
  padding: calc(0.6rem + env(safe-area-inset-top)) 1rem 0.5rem;
  height: 100%;
  overflow: hidden;
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.15rem 0 0.65rem;
  flex-shrink: 0;
}

.view-header h2 {
  margin: 0;
  font-size: clamp(1.2rem, 3.5vw, 1.7rem);
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* ── Activity log list ───────────────────────────────────────────────────── */
.activity-log-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;  overflow-y: auto;
  min-height: 0;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 0.5rem);}

.activity-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.85rem;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(6px);
  animation: rise 400ms ease both;
}

.activity-card__left {
  flex: 1;
  min-width: 0;
}

.activity-date {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-soft);
  font-weight: 500;
}

.activity-sport {
  margin: 0.15rem 0 0;
  font-size: 0.96rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-card__stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  flex-shrink: 0;
  font-size: 0.88rem;
  color: var(--text-soft);
}

.activity-guided-badge {
  font-size: 0.76rem;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-weight: 600;
}

.activity-card__actions {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex-shrink: 0;
}

.activity-detail-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 1.2rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 160ms, border-color 160ms;
}

.activity-detail-btn:hover {
  color: var(--text-main);
  border-color: rgba(165, 202, 214, 0.4);
}

.activity-delete-btn {
  background: none;
  border: 1px solid rgba(218, 65, 65, 0.25);
  border-radius: 999px;
  color: rgba(218, 65, 65, 0.6);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 160ms, border-color 160ms, background 160ms;
  padding: 0;
}

.activity-delete-btn:hover {
  color: var(--danger);
  border-color: rgba(218, 65, 65, 0.5);
  background: rgba(218, 65, 65, 0.1);
}

/* ── Activity detail dialog content ─────────────────────────────────────── */
.detail-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
}

.detail-section-title {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-soft);
  font-weight: 600;
}

.detail-guided-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.detail-guided-card {
  background: rgba(9, 27, 35, 0.7);
  border: 1px solid rgba(170, 198, 209, 0.18);
  border-radius: 12px;
  padding: 0.65rem;
}

.detail-guided-card h4 {
  margin: 0;
  font-size: 0.97rem;
}

.detail-guided-meta {
  margin: 0.25rem 0 0.45rem;
  font-size: 0.83rem;
  color: #c5d8de;
}

.detail-guided-stats {
  display: flex;
  gap: 0.45rem;
}

.stat-badge {
  font-size: 0.77rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
}

.stat-ok {
  background: rgba(24, 191, 125, 0.2);
  color: var(--primary);
}

.stat-skip {
  background: rgba(247, 147, 30, 0.2);
  color: var(--accent);
}

.stat-stop {
  background: rgba(218, 65, 65, 0.2);
  color: var(--danger);
}

.empty-state {
  margin: 2rem auto;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.93rem;
  line-height: 1.6;
}

@media (max-width: 480px) {
  .detail-kpis {
    grid-template-columns: 1fr 1fr;
  }
}
