/*
 * hadef-delight: first-run welcome overlay + empty states + pitch progress panel.
 * All tokens match the existing /app design system (orange accent, cream ground, JetBrains Mono eyebrows).
 * Vanilla, zero framework deps, uses polish-stack confetti + hadefToast when available.
 */
:root {
  --d-accent: #E8621A;
  --d-accent-dark: #C2410C;
  --d-accent-soft: #FFF1E8;
  --d-ink: #1C1917;
  --d-muted: #67615A;
  --d-cream: #F8F5F0;
  --d-line: #E7E0D3;
  --d-surface: #FFFFFF;
}

/* ---------------- First-run welcome overlay ---------------- */
.h-welcome-scrim {
  position: fixed; inset: 0; background: rgba(28,25,23,0.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 9990; display: flex; align-items: center; justify-content: center;
  animation: h-fade-in 240ms ease-out;
}
@keyframes h-fade-in { from { opacity: 0 } to { opacity: 1 } }
.h-welcome-card {
  background: var(--d-surface); border: 1px solid var(--d-line);
  border-radius: 18px; padding: 32px 32px 28px; width: min(460px, calc(100vw - 40px));
  box-shadow: 0 20px 60px rgba(28,25,23,0.35);
  animation: h-card-in 320ms cubic-bezier(0.16,1,0.3,1);
}
@keyframes h-card-in { from { opacity: 0; transform: translateY(12px) scale(0.98) } to { opacity: 1; transform: translateY(0) scale(1) } }
.h-welcome-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px; font-weight: 700; color: var(--d-accent);
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: space-between;
}
.h-welcome-title {
  font-size: 24px; font-weight: 800; letter-spacing: -0.02em;
  line-height: 1.18; color: var(--d-ink); margin-bottom: 10px;
}
.h-welcome-body {
  font-size: 14.5px; line-height: 1.55; color: var(--d-muted); margin-bottom: 22px;
}
.h-welcome-steps { display: flex; gap: 6px; margin-bottom: 22px; }
.h-welcome-step {
  flex: 1; height: 4px; border-radius: 99px; background: var(--d-line);
  transition: background 200ms;
}
.h-welcome-step.active { background: var(--d-accent); }
.h-welcome-actions { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.h-welcome-btn {
  padding: 10px 18px; border-radius: 10px; border: none; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 700; transition: all 160ms;
}
.h-welcome-btn--primary { background: var(--d-accent); color: #fff; box-shadow: 0 4px 12px rgba(232,98,26,0.28); }
.h-welcome-btn--primary:hover { background: var(--d-accent-dark); transform: translateY(-1px); }
.h-welcome-btn--ghost { background: transparent; color: var(--d-muted); }
.h-welcome-btn--ghost:hover { color: var(--d-ink); }
.h-welcome-skip {
  position: absolute; top: 18px; right: 18px; color: rgba(255,255,255,0.72);
  font-size: 12px; cursor: pointer; background: transparent; border: none;
  font-family: inherit; padding: 6px 10px; border-radius: 8px;
}
.h-welcome-skip:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* ---------------- Empty state block ---------------- */
.h-empty {
  border: 2px dashed var(--d-line); border-radius: 14px; padding: 28px 24px;
  text-align: center; background: #FFFEFC; animation: h-card-in 240ms ease-out;
}
.h-empty-icon {
  width: 48px; height: 48px; border-radius: 12px; background: var(--d-accent-soft);
  color: var(--d-accent-dark); display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.h-empty-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.h-empty-title { font-size: 15px; font-weight: 700; color: var(--d-ink); margin-bottom: 6px; }
.h-empty-sub { font-size: 13px; line-height: 1.55; color: var(--d-muted); margin-bottom: 18px; max-width: 420px; margin-left: auto; margin-right: auto; }
.h-empty-actions { display: inline-flex; gap: 10px; }
.h-empty-btn {
  padding: 10px 18px; border-radius: 10px; font-family: inherit; font-size: 13px;
  font-weight: 700; cursor: pointer; border: none; transition: all 160ms;
}
.h-empty-btn--primary { background: var(--d-accent); color: #fff; box-shadow: 0 4px 12px rgba(232,98,26,0.28); }
.h-empty-btn--primary:hover { background: var(--d-accent-dark); transform: translateY(-1px); }
.h-empty-btn--ghost { background: transparent; color: var(--d-muted); border: 1px solid var(--d-line); }
.h-empty-btn--ghost:hover { color: var(--d-ink); border-color: var(--d-ink); }

/* ---------------- Pitch progress panel ---------------- */
.h-progress {
  background: var(--d-surface); border: 1px solid var(--d-line); border-radius: 14px;
  padding: 22px 24px; box-shadow: 0 1px 2px rgba(28,25,23,0.04);
}
.h-progress-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.h-progress-title { font-size: 15px; font-weight: 700; color: var(--d-ink); }
.h-progress-elapsed { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; color: var(--d-muted); }
.h-stage-list { display: flex; flex-direction: column; gap: 10px; }
.h-stage {
  display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--d-line);
}
.h-stage:last-child { border-bottom: none; }
.h-stage-bullet {
  width: 18px; height: 18px; border-radius: 99px; background: var(--d-line);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 200ms;
}
.h-stage-bullet svg { width: 10px; height: 10px; color: #fff; display: none; }
.h-stage.active .h-stage-bullet { background: var(--d-accent); box-shadow: 0 0 0 4px rgba(232,98,26,0.15); animation: h-stage-pulse 1.4s ease-in-out infinite; }
.h-stage.done .h-stage-bullet { background: var(--d-accent); }
.h-stage.done .h-stage-bullet svg { display: block; }
@keyframes h-stage-pulse { 0%,100% { box-shadow: 0 0 0 4px rgba(232,98,26,0.15) } 50% { box-shadow: 0 0 0 8px rgba(232,98,26,0.06) } }
.h-stage-label { font-size: 13.5px; font-weight: 600; color: var(--d-ink); }
.h-stage.pending .h-stage-label { color: var(--d-muted); font-weight: 500; }
.h-stage-note { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; color: var(--d-muted); }

/* ---------------- Kanban drag-drop ghost + chosen styles ---------------- */
.kanban-ghost { opacity: 0.35; background: var(--d-accent-soft); }
.kanban-chosen { cursor: grabbing !important; box-shadow: 0 12px 30px rgba(28,25,23,0.22); transform: rotate(1deg); }

/* ---------------- Following freshness badge ---------------- */
.h-fresh-badge {
  position: absolute; top: 10px; right: 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 99px;
  background: var(--d-line); color: var(--d-muted);
  pointer-events: none;
}
.h-fresh-badge.is-hot  { background: #FEE2E2; color: #991B1B; animation: h-fresh-pulse 2s ease-in-out infinite; }
.h-fresh-badge.is-warm { background: #FEF3C7; color: #92400E; }
.h-fresh-badge.is-cool { background: #E0E7FF; color: #3730A3; }
@keyframes h-fresh-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.35) } 50% { box-shadow: 0 0 0 6px rgba(220,38,38,0) } }

/* Add relative to following cards so badge positions correctly */
[data-following-card] { position: relative; }

/* ---------------- Calendar event-type colors ---------------- */
.h-cal-booking        { background: #DCFCE7; color: #065F46; border-left: 3px solid #16A34A; }
.h-cal-followup       { background: #FEF3C7; color: #92400E; border-left: 3px solid #D97706; }
.h-cal-pitch-send     { background: #DBEAFE; color: #1E40AF; border-left: 3px solid #2563EB; }
.h-cal-signal         { background: #EDE9FE; color: #5B21B6; border-left: 3px solid #7C3AED; }
.h-cal-brain-extracted{ background: #FCE7F3; color: #9D174D; border-left: 3px solid #DB2777; }
.h-cal-default        { background: var(--d-accent-soft); color: var(--d-accent-dark); border-left: 3px solid var(--d-accent); }

/* ---------------- Settings: plan chooser polish ---------------- */
.h-plan-chooser { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 12px 0 20px; }
@media (max-width: 760px) { .h-plan-chooser { grid-template-columns: 1fr; } }
.h-plan-card {
  background: var(--d-surface); border: 1.5px solid var(--d-line); border-radius: 14px;
  padding: 18px 18px 20px; cursor: pointer; transition: border-color 160ms, transform 160ms, box-shadow 160ms;
}
.h-plan-card:hover { border-color: var(--d-accent); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(28,25,23,0.08); }
.h-plan-card.is-current { border-color: var(--d-accent); background: var(--d-accent-soft); }
.h-plan-card.is-current::after { content: 'Current'; display: inline-block; margin-left: 6px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10px; padding: 2px 7px; border-radius: 99px; background: var(--d-accent); color: #fff; letter-spacing: 0.06em; }
.h-plan-name { font-size: 15px; font-weight: 800; color: var(--d-ink); margin-bottom: 4px; }
.h-plan-price { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 20px; color: var(--d-ink); font-weight: 700; margin-bottom: 8px; }
.h-plan-price span { font-size: 11px; color: var(--d-muted); font-weight: 500; }
.h-plan-features { list-style: none; margin: 10px 0 0; padding: 0; font-size: 12.5px; color: var(--d-muted); line-height: 1.55; }
.h-plan-features li { padding-left: 18px; position: relative; margin-bottom: 2px; }
.h-plan-features li::before { content: '\2713'; position: absolute; left: 0; color: var(--d-accent); font-weight: 800; }
.h-plan-cta {
  margin-top: 14px; width: 100%; padding: 10px; border: none; border-radius: 10px;
  font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: all 160ms;
  background: var(--d-accent); color: #fff; box-shadow: 0 4px 12px rgba(232,98,26,0.28);
}
.h-plan-cta:hover { background: var(--d-accent-dark); transform: translateY(-1px); }
.h-plan-card.is-current .h-plan-cta { background: transparent; color: var(--d-accent-dark); box-shadow: none; border: 1px solid var(--d-accent-dark); }

/* ---------------- Card hover lift across /app ---------------- */
.tile, .stat-card, .feed-item, [data-following-card] {
  transition: transform 200ms cubic-bezier(0.16,1,0.3,1), box-shadow 200ms cubic-bezier(0.16,1,0.3,1), border-color 200ms;
}
.tile:hover, .stat-card:hover, .feed-item:hover, [data-following-card]:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(28,25,23,0.08);
}
