/* Post-sync welcome screen (feat/sync-summary-welcome-redesign, 2026-05-18).
 * Three-section overlay shown after first-sync + repeat syncs:
 *
 *   .sync-summary-welcome    — Section 1: personalised greeting + tagline
 *   .sync-summary-summary    — Section 2: 4-bucket breakdown + stats + Export
 *   .sync-summary-next-steps — Section 3: three action cards
 *   .sync-summary-footer     — primary CTA (Open my calendar →)
 *
 * Locked layout 2026-05-18: Export sits inside Section 2 (next to the data
 * it exports), not in the global footer. Footer becomes single-CTA.
 *
 * See products/mermix/client/js/sync-summary.js for behaviour.
 */

/* Centered fixed overlay. No backdrop so the populated calendar shows
 * behind — the customer sees what just happened. */
.sync-summary-chip {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10001;
  width: min(660px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 20px 24px 22px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-accent);
  border-radius: var(--radius-lg, 8px);
  box-shadow: var(--shadow-lg, 0 12px 32px rgba(0, 0, 0, 0.20));
  font-size: var(--font-sm, 0.875rem);
  color: var(--color-text);
  /* Defensive: explicit opacity floor + animation-fill-mode so reduced-
     motion browsers (and any agent that skips the keyframe) still see the
     overlay at opacity 1. The 0.22s pop is decorative; visibility isn't. */
  opacity: 1;
  animation: sync-summary-pop 0.22s ease-out both;
}

@keyframes sync-summary-pop {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.96); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.sync-summary-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 20px;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sync-summary-close:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.sync-summary-section {
  display: block;
}

.sync-summary-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 14px 0;
  opacity: 0.6;
}

/* ── Section 1: Welcome ───────────────────────────────────────────────── */

.sync-summary-welcome {
  text-align: left;
  padding-top: 2px;
}

.sync-summary-greeting {
  margin: 0 0 4px;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.2;
  color: var(--color-text);
}

.sync-summary-tagline {
  margin: 0;
  font-size: var(--font-sm, 0.875rem);
  color: var(--color-text-muted);
}

/* ── Section 2: What we just did ──────────────────────────────────────── */

.sync-summary-section-title {
  margin: 0 0 10px;
  font-size: var(--font-xs, 0.75rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.sync-summary-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Empty-state copy in Section 2 — wizard fired but no actionable issues
   came back from Jira (all Done, or no active issues yet). */
.sync-summary-empty-note {
  margin: 0;
  font-size: var(--font-sm, 0.875rem);
  color: var(--color-text-muted);
  line-height: 1.5;
}

.sync-summary-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 2px 0;
  font-size: var(--font-sm, 0.875rem);
}

.sync-summary-row .sync-summary-label {
  color: var(--color-text);
  white-space: nowrap;
}

.sync-summary-row-mute .sync-summary-label {
  color: var(--color-text-muted);
}

.sync-summary-dotleader {
  flex: 1;
  border-bottom: 1px dotted var(--color-border);
  margin: 0 4px;
  align-self: flex-end;
  height: 1px;
}

.sync-summary-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 24px;
  text-align: right;
  color: var(--color-text);
}

/* ── Section 2: destinations (calendar / backlog) + how-it-works ─────────── */

.sync-summary-lead {
  margin: 0 0 12px;
  font-size: var(--font-sm, 0.875rem);
  color: var(--color-text);
  line-height: 1.45;
}

.sync-summary-dest {
  margin-bottom: 10px;
}

.sync-summary-dest-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 2px;
}

.sync-summary-dest-label {
  font-size: var(--font-sm, 0.875rem);
  font-weight: 600;
  color: var(--color-text);
}

.sync-summary-dest-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  color: var(--color-accent);
}

.sync-summary-reason {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 2px 0 2px 12px;
  font-size: var(--font-sm, 0.875rem);
}

.sync-summary-reason-label {
  color: var(--color-text-muted);
  white-space: nowrap;
}

.sync-summary-reason-count {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 24px;
  text-align: right;
  color: var(--color-text);
}

/* Collapsible "How we placed your tasks" */
.sync-summary-how {
  margin-top: 6px;
  border-top: 1px solid var(--color-border);
  padding-top: 8px;
}
.sync-summary-how-summary {
  cursor: pointer;
  font-size: var(--font-xs, 0.78rem);
  font-weight: 600;
  color: var(--color-accent);
  list-style: none;
}
.sync-summary-how-summary::-webkit-details-marker { display: none; }
.sync-summary-how-summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.15s;
}
.sync-summary-how[open] .sync-summary-how-summary::before {
  transform: rotate(90deg);
}
.sync-summary-how-body {
  margin-top: 8px;
  font-size: var(--font-xs, 0.78rem);
  color: var(--color-text-muted);
  line-height: 1.5;
}
.sync-summary-how-intro { margin: 0 0 6px; }
.sync-summary-how-list {
  margin: 0 0 6px;
  padding-left: 0;
  /* The GRID lives on the list, not each row, so the description column lines
     up across every rule. Per-<li> grids size independently and the
     descriptions start at a different x on each line — technically wrapped
     correctly, still hard to scan. */
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 10px;
  row-gap: 3px;
  align-items: baseline;
}

/* catalyst.css styles bare `li` as a CALENDAR ROW — fixed height:var(--row-height),
   display:flex, bordered, surface background. That is right for the resource
   list and wrong for prose: it turned each rule into a fixed-height bordered
   box whose term and description became flex items, so terms wrapped
   mid-phrase ("Back from due / date —", "1 day at / due date / —"). Reset it
   here and lay the rules out as what they are: a two-column definition list.
   Same bleed the copilot bubbles already reset. */
/* display:contents dissolves the row box so <strong> and the description text
   become direct grid items of the list above. It also drops catalyst's fixed
   height/border/background wholesale, which is exactly what we want. */
.sync-summary-how-list li {
  display: contents;
}
.sync-summary-how-list li:last-child { border-bottom: none; }
.sync-summary-how-list li:hover { background: none; box-shadow: none; }

/* max-content keeps the term on one line; below that the columns stack rather
   than squeezing the description into a sliver. */
@media (max-width: 520px) {
  .sync-summary-how-list { grid-template-columns: 1fr; column-gap: 0; row-gap: 8px; }
}

.sync-summary-how-list strong { color: var(--color-text); font-weight: 600; white-space: nowrap; }
.sync-summary-how-note { margin: 0; font-style: italic; }

.sync-summary-tail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 0 0;
  font-size: var(--font-xs, 0.78rem);
  color: var(--color-text-muted);
}

.sync-summary-tail-prefix {
  color: var(--color-text-muted);
  font-style: italic;
  margin-right: 2px;
}

.sync-summary-pill {
  background: var(--color-surface-alt);
  color: var(--color-text);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--font-xs, 0.78rem);
  border: 1px solid var(--color-border);
}

.sync-summary-stat-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
  font-size: var(--font-xs, 0.78rem);
  color: var(--color-text-muted);
}

.sync-summary-stat-sep {
  color: var(--color-border);
}

.sync-summary-export {
  margin-top: 12px;
}

.sync-summary-export-desc {
  margin: 0 0 8px;
  font-size: var(--font-xs, 0.78rem);
  color: var(--color-text-muted);
  line-height: 1.45;
}

.sync-summary-export-btn {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  padding: 5px 12px;
  font-size: var(--font-xs, 0.78rem);
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
}
.sync-summary-export-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-surface-alt);
}

/* ── Section 3: What's next ───────────────────────────────────────────── */

.sync-summary-next-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Passive hint blocks — NOT interactive. No cursor, no hover, no accent
 * border. Earlier iteration looked like CTAs (accent border-left + hover
 * highlight) but only Cards 2/3 had real actions and Card 1 was a no-op;
 * the inconsistency was itself the confusion. User direction 2026-05-18:
 * make them read like nudges. Footer's "Open my calendar" is the only
 * action in the welcome screen. */
.sync-summary-next-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  width: 100%;
  padding: 8px 0 8px 12px;
  border-left: 2px solid var(--color-border);
  background: transparent;
}

.sync-summary-next-card-title {
  font-size: var(--font-sm, 0.875rem);
  font-weight: 600;
  color: var(--color-text);
}

.sync-summary-next-card-hint {
  font-size: var(--font-xs, 0.78rem);
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* ── Footer (single primary CTA) ──────────────────────────────────────── */

.sync-summary-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.sync-summary-cta {
  border: 1px solid var(--color-accent);
  background: var(--color-accent);
  color: #fff;
  padding: 7px 16px;
  font-size: var(--font-sm, 0.875rem);
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
}
.sync-summary-cta:hover {
  filter: brightness(0.95);
}

/* ── Dependency conflicts ──────────────────────────────────────────────────
   Tasks scheduled before the work they depend on. These are the customer's
   own Jira dates (Mermix never moves them), so this is presented as a finding
   about their plan — informative amber, not an error red. */
.sync-summary-conflicts {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
  margin: var(--space-md) 0 0;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid color-mix(in srgb, var(--color-warning) 35%, transparent);
  border-left: 3px solid var(--color-warning);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-warning) 8%, transparent);
}
.sync-summary-conflicts-icon {
  color: var(--color-warning);
  font-size: var(--font-md);
  line-height: 1.3;
  flex: 0 0 auto;
}
.sync-summary-conflicts-body { flex: 1 1 auto; min-width: 0; }
.sync-summary-conflicts-lead {
  margin: 0 0 var(--space-xs);
  font-weight: 600;
  color: var(--color-text);
}
.sync-summary-conflicts-list {
  margin: 0 0 var(--space-xs);
  padding-left: var(--space-md);
  color: var(--color-text-muted);
  font-size: var(--font-sm);
}
.sync-summary-conflicts-list li { margin: 0 0 2px; }
.sync-summary-conflicts-more,
.sync-summary-conflicts-note {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--font-xs);
}
.sync-summary-conflicts-note { font-style: italic; margin-top: var(--space-xs); }
