/* Daily Habit Check-In overrides and additions */
.hc-container {
  padding: 0 12px;
}

.hc-title-wrap {
  display: grid;
  gap: 4px;
}

.hc-status-line {
  margin: 4px 0 0;
  color: #6b7280;
  font-weight: 600;
  font-size: 0.95rem;
}

.hc-surface {
  padding: 22px 22px 24px;
}

.hc-form {
  gap: 8px;
}

.hc-habit-picker {
  display: grid;
  gap: 10px;
  margin-bottom: 4px;
}

.hc-habit-empty {
  margin-top: 6px;
}

.hc-habit-sync {
  display: grid;
  gap: 6px;
}

.hc-sync-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hc-sync-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-weight: 600;
  font-size: 0.85rem;
}

.hc-field {
  min-width: 0;
}

.hc-primary-actions {
  gap: 8px;
  margin-top: 0;
}

.hc-reward {
  margin: 4px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #dbeafe;
  background: #f0f9ff;
  color: #0f172a;
  font-weight: 700;
  display: grid;
  gap: 4px;
  position: relative;
  overflow: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.hc-reward.is-hidden {
  opacity: 0;
  transform: translateY(-4px);
}

.hc-reward__title,
.hc-reward__meta {
  margin: 0;
}

.hc-reward__meta {
  font-weight: 600;
  color: #1d4ed8;
}

.hc-reward.is-celebrate::after {
  content: "";
  position: absolute;
  inset: -40% -10% auto;
  height: 120%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.35) 0 2px, transparent 2px),
    radial-gradient(circle, rgba(16, 185, 129, 0.35) 0 2px, transparent 2px),
    radial-gradient(circle, rgba(251, 191, 36, 0.35) 0 2px, transparent 2px);
  background-size: 24px 24px, 18px 18px, 22px 22px;
  animation: hc-confetti 1.8s ease-out;
  pointer-events: none;
}

@keyframes hc-confetti {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(20px);
  }
}

.hc-insight-card {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  display: grid;
  gap: 4px;
}

.hc-insight-card--soft {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.hc-insight-card--milestone {
  background: #fffbeb;
  border-color: #fde68a;
}

.hc-insight-card__label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
}

.hc-insight-card__text {
  margin: 0;
  font-weight: 600;
  color: #0f172a;
}

.hc-cohort {
  margin: 8px 0 0;
  font-weight: 600;
  color: #475569;
}

.hc-lock-card {
  border: 1px dashed #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  gap: 8px;
}

.hc-lock-card:not([hidden]) {
  display: grid;
}

.hc-export-actions {
  gap: 8px;
}

.hc-export-actions:not([hidden]) {
  display: grid;
}

.hc-note-panel {
  display: grid;
  gap: 10px;
  position: relative;
}

.hc-note-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hc-note-panel.is-locked {
  opacity: 0.7;
}

.hc-note-lock {
  gap: 8px;
  margin-top: 6px;
}

.hc-note-lock:not([hidden]) {
  display: grid;
}

.hc-auth-hint {
  margin-top: 6px;
}

.hc-accordion {
  background: #fff;
  padding: 0;
  overflow: hidden;
}

.hc-accordion summary {
  padding: 12px 14px;
  gap: 10px;
}

.hc-accordion .hc-accordion-body {
  padding: 0 14px 14px;
  gap: 12px;
  border-top: 1px solid #f1f5f9;
}

.hc-accordion__title {
  margin: 0;
  font-weight: 700;
  color: #0f172a;
}

.hc-history-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.hc-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  gap: 10px;
}

.hc-history-item.is-highlighted {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
  background: #eef2ff;
}

.hc-history-label {
  margin: 0;
  color: #0f172a;
  font-weight: 600;
}

.hc-history-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  border: 1px solid #e5e7eb;
  background: #fff;
}

.hc-history-status.is-done {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #166534;
}

.hc-history-status.is-skipped {
  background: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
}

.hc-history-status.is-missed {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #475569;
}

.hc-backfill {
  border: 1px dashed #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f8fafc;
}

.hc-backfill__actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 6px;
}

.hc-note-row {
  display: grid;
  gap: 6px;
}

.hc-error {
  color: #b91c1c;
  min-height: 0;
  margin: 0;
}

@media (max-width: 720px) {
  .hc-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .hc-surface {
    padding: 18px 16px 20px;
  }
}
