/* --------------------------------------------------------------------------
   The card's details — what changes, the facts, and each message as it will
   arrive (card.details, 2026-10-05)
   -------------------------------------------------------------------------- */

.card-risk.is-medium { color: var(--warn); }
.card-risk.is-high   { color: var(--neg); }

.card-details {
  display: grid;
  /* minmax(0, …): the previews row scrolls inside the card instead of pushing
     the card, and the conversation, sideways (audit — WCAG 1.4.10). */
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.card-section-title {
  margin: 0 0 8px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* What changes: label · before → after, one row each — as wide as its values,
   not the card: a short number pushed to the far side read as a separate fact. */
.card-changes {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(0, max-content) minmax(0, max-content);
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}

.card-change { display: contents; }

.card-change > span {
  padding: 9px 14px;
  font-size: 13.5px;
  line-height: 1.45;
  border-top: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.card-change:first-child > span { border-top: 0; }

.card-change-label  { color: var(--text-muted); font-weight: 600; background: var(--surface-raised); }
.card-change-before { color: var(--text-faint); }
.card-change-before del { text-decoration-color: color-mix(in srgb, var(--neg) 60%, transparent); }
/* The arrow is drawn, not text: a screen reader hears the column headers. */
.card-change-after::before { content: "→  " / ""; color: var(--text-faint); font-weight: 400; }
.card-change-after  { color: var(--text-strong); font-weight: 650; background: var(--success-soft); }
.card-changes em    { font-style: normal; color: var(--text-faint); }

/* Facts: a tidy list that uses the card's width — one fact spans it, rather
   than wrapping inside a 200px column. */
.card-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 20px;
  margin: 0;
}

.card-facts dt {
  font-size: 12px;
  color: var(--text-faint);
}

.card-facts dd {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
  overflow-wrap: anywhere;
}

/* Previews: side by side, scrolling sideways when there are many. */
.card-previews {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  /* Room for the phones' shadows, which the scrolling box would clip. */
  padding: 2px 14px 26px 2px;
  margin-bottom: -14px;
}

.preview { flex: none; margin: 0; }

.preview-caption {
  margin: 0 0 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.preview-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.5;
}

.preview-avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-grad);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

/* SMS and WhatsApp: a phone — drawn as a phone looks, in either theme. */
.phone {
  position: relative;
  width: 232px;
  padding: 10px 8px 14px;
  border: 7px solid #1d2230;
  border-radius: 30px;
  background: #f4f5f9;
  box-shadow: 0 14px 28px rgba(18, 23, 38, .16);
}

.phone-notch {
  width: 64px;
  height: 6px;
  margin: 0 auto 8px;
  border-radius: 999px;
  background: #1d2230;
}

.phone-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px 8px;
  border-bottom: 1px solid #e3e6ee;
  font-size: 12.5px;
  color: #171c26;
}

.phone-screen { min-height: 120px; padding: 12px 4px 4px; }

/* A name on a phone or a lock screen is the device's ink, not the answer's
   bold — which is white in the dark theme, and vanished on the phone. */
.phone strong, .preview-note strong { color: inherit; }

.phone-bubble {
  position: relative;
  max-width: 88%;
  padding: 8px 10px 16px;
  border-radius: 14px 14px 14px 4px;
  background: #e5e7ee;
  color: #1d2230;
}

.phone-bubble.is-rtl { margin-inline-start: auto; border-radius: 14px 14px 4px 14px; }

.phone-time {
  position: absolute;
  right: 8px;
  bottom: 3px;
  font-size: 9.5px;
  color: #5f6675;
}

.preview-phone.is-whatsapp .phone        { background: #efe7dd; }
.preview-phone.is-whatsapp .phone-head   { border-color: #d9cfc3; }
.preview-phone.is-whatsapp .phone-bubble { background: #d9fdd3; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.preview-phone.is-whatsapp .preview-avatar { background: #25d366; }

/* Email: an inbox card. */
.preview-mail {
  width: 320px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.preview-mail-head {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}

.preview-mail-head > div { display: grid; gap: 2px; min-width: 0; }
.preview-subject { color: var(--text-body); font-weight: 500; }

/* Push: a notification on a lock screen. */
.preview-lock {
  width: 300px;
  padding: 18px 12px;
  border-radius: 18px;
  background: linear-gradient(160deg, #062f87, #0971ce);
}

.preview-note {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(6px);
  color: #1d2230;
}

.preview-note-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 11.5px;
}

.preview-note-head span:last-child { margin-inline-start: auto; color: #5f6675; }

.preview-app {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--brand-grad);
}

/* A decided card keeps its details, quieter. */
/* Quieter by colour, not opacity — opacity took the receipt's labels below 3:1. */
.card-settled .card-change-after { background: transparent; }
/* The previews go with their heading: the receipt kept "The messages, as
   they will arrive" over nothing. */
.card-settled .card-section:has(.card-previews) { display: none; }

@media (max-width: 600px) {
  .card { padding: 0 16px; }
  .card-head, .card-foot { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .card-changes { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: 100%; }
  .card-change-label { grid-column: 1 / -1; padding-bottom: 2px !important; }
}
