/* public/app-ringcentral-import.css -- Settings > Integrations > "Import RingCentral history" (see app-ringcentral-import.js).
 *
 * Own tokens (--rci-*), light and dark. Same palette and type scale as the Dropbox and webhook cards next to it:
 * 11 chips, 12 helper and labels, 13 body, 15 card and section heads, 22 for the one number that matters on a tile.
 * Body copy is --rci-strong or --rci-ink at full contrast; colour and weight carry state only, never prose.
 *
 * Contrast (same pairs as app-webhook-settings.css): light: strong on card 16.4, ink on card 11.6, mut on card 7.5,
 * white on primary 7.6, bad on bad-bg 6.4, warn on warn-bg 6.6, ok on ok-bg 6.0.
 * dark: strong on card 13.8, ink on card 10.3, mut on card 6.9, dark on primary 8.9, bad on bad-bg 6.1, warn on warn-bg 8.3, ok on ok-bg 7.4.
 */
.rci-mount { display: block; margin-top: 12px; min-width: 0; }
.rci-mount:empty { display: none; }
.rci, .rci * { box-sizing: border-box; text-transform: none; letter-spacing: normal; }
.rci {
  --rci-card: #ffffff; --rci-paper: #f6f7fb; --rci-line: #dadde8; --rci-line-soft: #eceef4;
  --rci-strong: #161e2e; --rci-ink: #2b3347; --rci-mut: #4d5569;
  --rci-btn: #3b556f; --rci-btn-ink: #ffffff;
  --rci-ok: #17694a; --rci-ok-bg: #e6f2ec;
  --rci-busy: #2a5585; --rci-busy-bg: #e8f0f9;
  --rci-warn: #7a4a00; --rci-warn-bg: #fdf3dc; --rci-warn-line: #e3c071;
  --rci-bad: #a33425; --rci-bad-bg: #fbefec; --rci-bad-line: #e3b4ad;
  --rci-track: #dadde8;
  display: flex; flex-direction: column; gap: 16px; min-width: 0;
  padding: 20px; border: 1px solid var(--rci-line); border-radius: 16px; background: var(--rci-card);
  font-family: 'Montserrat', sans-serif; color: var(--rci-ink); font-size: 13px; line-height: 1.5; text-align: left;
}
body.hl-dark .rci {
  --rci-card: #171f30; --rci-paper: #121a2a; --rci-line: #26304a; --rci-line-soft: #202a40;
  --rci-strong: #e8edf6; --rci-ink: #c9d3e4; --rci-mut: #9cabc6;
  --rci-btn: #a9bdd3; --rci-btn-ink: #0f1727;
  --rci-ok: #5ccf9b; --rci-ok-bg: #1b3129;
  --rci-busy: #8db4ff; --rci-busy-bg: #1c2a45;
  --rci-warn: #f0c15a; --rci-warn-bg: #2e2714; --rci-warn-line: #6b5420;
  --rci-bad: #f0836b; --rci-bad-bg: #3a2521; --rci-bad-line: #6a3a33;
  --rci-track: #2f3b58;
}
.rci p, .rci h3, .rci h4 { margin: 0; padding: 0; }

/* head */
.rci-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rci-title { font-size: 15px; font-weight: 800; line-height: 1.3; color: var(--rci-strong); }
.rci-lede { color: var(--rci-ink); font-size: 13px; max-width: 64ch; }
.rci-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 99px; font-size: 11px; font-weight: 800; line-height: 1; border: 1px solid currentColor; background: var(--rci-card); }
.rci-pill-idle { color: var(--rci-mut); }
.rci-pill-ok { color: var(--rci-ok); background: var(--rci-ok-bg); }
.rci-pill-busy { color: var(--rci-busy); background: var(--rci-busy-bg); }
.rci-pill-warn { color: var(--rci-warn); background: var(--rci-warn-bg); }
.rci-pill-bad { color: var(--rci-bad); background: var(--rci-bad-bg); }

.rci-stack, .rci-block { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.rci-body { font-size: 13px; color: var(--rci-strong); }
.rci-hint { font-size: 12px; color: var(--rci-mut); }
.rci-status { font-size: 15px; font-weight: 800; color: var(--rci-strong); }

/* what was checked / what was left out */
.rci-detail { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border: 1px solid var(--rci-line); border-radius: 12px; background: var(--rci-paper); min-width: 0; }
.rci-detail-t { font-size: 13px; font-weight: 800; color: var(--rci-strong); }
.rci-detail-l { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--rci-strong); overflow-wrap: anywhere; }
.rci-detail-hint { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--rci-warn); background: var(--rci-warn-bg); border: 1px solid var(--rci-warn-line); }
.rci-account { margin: 0; font-size: 13px; font-weight: 600; color: var(--rci-strong); }
.rci-boxes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rci-box { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--rci-line); border-left-width: 4px; border-radius: 10px; background: var(--rci-card); min-width: 0; }
.rci-box-opened { border-left-color: var(--rci-ok); }
.rci-box-blocked { border-left-color: var(--rci-bad); background: var(--rci-bad-bg); }
.rci-box-no_mailbox, .rci-box-pending { border-left-color: var(--rci-line); }
.rci-box-h { display: flex; flex-direction: column; gap: 0; }
.rci-box-n { font-size: 13px; font-weight: 800; color: var(--rci-strong); overflow-wrap: anywhere; }
.rci-box-k { font-size: 12px; font-weight: 600; color: var(--rci-mut); }
.rci-box-r { font-size: 13px; color: var(--rci-strong); overflow-wrap: anywhere; }
.rci-box-more { margin: 0; font-size: 12px; color: var(--rci-mut); }

/* buttons */
.rci-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rci-btn {
  min-height: 40px; padding: 0 18px; border-radius: 10px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--rci-line); background: var(--rci-card); color: var(--rci-strong);
  font-family: inherit; font-size: 13px; font-weight: 700; line-height: 1.2; box-shadow: none; text-shadow: none;
}
.rci-btn:hover:not(:disabled) { border-color: var(--rci-btn); }
.rci-btn:disabled { opacity: .55; cursor: default; }
.rci-btn.rci-primary { background: var(--rci-btn); border-color: var(--rci-btn); color: var(--rci-btn-ink); }
.rci-btn:focus-visible { outline: 2px solid var(--rci-btn); outline-offset: 2px; }

/* the count */
.rci-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.rci-tile { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 12px 14px; border: 1px solid var(--rci-line); border-radius: 12px; background: var(--rci-paper); }
.rci-tile-l { font-size: 12px; font-weight: 700; color: var(--rci-mut); }
.rci-tile-v { font-size: 22px; font-weight: 800; line-height: 1.25; color: var(--rci-strong); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.rci-tile-wide { grid-column: span 2; }
.rci-tile-wide .rci-tile-v { font-size: 15px; line-height: 1.5; font-variant-numeric: normal; }
.rci-tile-n { font-size: 12px; color: var(--rci-ink); overflow-wrap: anywhere; }

/* team chat: every channel and what happens to it */
.rci-chans { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rci-chlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--rci-line); border-radius: 12px; overflow: hidden; background: var(--rci-card); }
.rci-ch { display: flex; flex-direction: column; gap: 2px; padding: 11px 14px; min-width: 0; border-top: 1px solid var(--rci-line-soft); }
.rci-ch:first-child { border-top: 0; }
.rci-ch-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; }
.rci-ch-n { font-size: 13px; font-weight: 800; color: var(--rci-strong); overflow-wrap: anywhere; min-width: 0; }
.rci-ch-c { flex: none; font-size: 12px; color: var(--rci-ink); font-variant-numeric: tabular-nums; }
.rci-ch-f { font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.rci-ch-ok { color: var(--rci-ok); } .rci-ch-busy { color: var(--rci-busy); } .rci-ch-idle { color: var(--rci-mut); } .rci-ch-bad { color: var(--rci-bad); }
#rci-chat-more { align-self: flex-start; }

/* progress */
.rci-prog-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rci-prog-n { font-size: 15px; font-weight: 800; color: var(--rci-strong); font-variant-numeric: tabular-nums; }
.rci-prog-p { font-size: 13px; font-weight: 700; color: var(--rci-ink); font-variant-numeric: tabular-nums; }
.rci-progress { display: block; }
.rci-track { position: relative; height: 10px; border-radius: 99px; background: var(--rci-track); overflow: hidden; }
.rci-fill { height: 100%; border-radius: 99px; background: var(--rci-btn); transition: width .4s ease; }
.rci-fill-busy { width: 38%; animation: rci-slide 1.4s ease-in-out infinite; }
@keyframes rci-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(270%); } }
@media (prefers-reduced-motion: reduce) { .rci-fill { transition: none; } .rci-fill-busy { animation: none; width: 100%; opacity: .5; } }

/* notes and finished */
.rci-note { font-size: 12px; font-weight: 700; padding: 10px 12px; border-radius: 8px; }
.rci-note-info { color: var(--rci-ink); background: var(--rci-paper); border: 1px solid var(--rci-line); font-weight: 600; }
.rci-note-warn { color: var(--rci-warn); background: var(--rci-warn-bg); }
.rci-note-bad { color: var(--rci-bad); background: var(--rci-bad-bg); }
.rci-done { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--rci-line); border-radius: 12px; background: var(--rci-ok-bg); }
.rci-done-ic { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--rci-card); color: var(--rci-ok); }
.rci-done-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rci-done-t { font-size: 15px; font-weight: 800; color: var(--rci-strong); }

/* the designed error */
.rci-error { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--rci-warn-line); border-radius: 12px; background: var(--rci-warn-bg); }
.rci-error-soft { border-color: var(--rci-bad-line); background: var(--rci-bad-bg); }
.rci-error-ic { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--rci-card); color: var(--rci-warn); }
.rci-error-soft .rci-error-ic { color: var(--rci-bad); }
.rci-error-tx { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rci-error-tx .rci-actions { margin-top: 6px; }
.rci-error-t { font-size: 15px; font-weight: 800; color: var(--rci-strong); }

/* loading */
.rci-skel-wrap { display: flex; flex-direction: column; gap: 10px; }
.rci-skel { height: 14px; border-radius: 6px; background: var(--rci-line-soft); animation: rci-pulse 1.3s ease-in-out infinite; }
.rci-skel-l { width: 100%; height: 40px; border-radius: 10px; } .rci-skel-m { width: 70%; } .rci-skel-s { width: 40%; }
@keyframes rci-pulse { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .rci-skel { animation: none; } }

@media (max-width: 520px) {
  .rci { padding: 16px; gap: 14px; }
  .rci-btn { width: 100%; }
  .rci-ch-h { flex-direction: column; gap: 2px; }
  .rci-tiles { grid-template-columns: 1fr 1fr; }
  .rci-error { flex-direction: column; gap: 10px; }
}

/* the Settings modal restyles buttons and uppercases labels; this card opts out and puts its colours back */
#hlmodal.hlset-modal .rci .rci-btn { font-family: inherit; text-transform: none; letter-spacing: normal; }
#hlmodal.hlset-modal .rci p, #hlmodal.hlset-modal .rci span, #hlmodal.hlset-modal .rci b, #hlmodal.hlset-modal .rci h4 { text-transform: none; letter-spacing: normal; }
#hlmodal.hlset-modal .rci p.rci-lede { color: var(--rci-ink); }
#hlmodal.hlset-modal .rci p.rci-body { color: var(--rci-strong); }
#hlmodal.hlset-modal .rci p.rci-hint { color: var(--rci-mut); }
#hlmodal.hlset-modal .rci p.rci-detail-hint { color: var(--rci-warn); padding: 12px 14px; margin: 0; }
#hlmodal.hlset-modal .rci p.rci-note { padding: 10px 14px; }
#hlmodal.hlset-modal .rci .rci-detail-l, #hlmodal.hlset-modal .rci .rci-detail-l li { color: var(--rci-strong); }
#hlmodal.hlset-modal .rci p.rci-note-warn { color: var(--rci-warn); }
#hlmodal.hlset-modal .rci p.rci-note-bad { color: var(--rci-bad); }
#hlmodal.hlset-modal .rci p.rci-note-info { color: var(--rci-ink); }
#hlmodal.hlset-modal .rci .rci-ch-n, #hlmodal.hlset-modal .rci .rci-ch-c, #hlmodal.hlset-modal .rci .rci-ch-f { text-transform: none; letter-spacing: normal; }
#hlmodal.hlset-modal .rci .rci-ch-n { color: var(--rci-strong); }
#hlmodal.hlset-modal .rci .rci-ch-ok { color: var(--rci-ok); } #hlmodal.hlset-modal .rci .rci-ch-busy { color: var(--rci-busy); } #hlmodal.hlset-modal .rci .rci-ch-idle { color: var(--rci-mut); } #hlmodal.hlset-modal .rci .rci-ch-bad { color: var(--rci-bad); }
#hlmodal.hlset-modal .rci p.rci-account, #hlmodal.hlset-modal .rci .rci-box-n, #hlmodal.hlset-modal .rci .rci-box-r { color: var(--rci-strong); }
#hlmodal.hlset-modal .rci .rci-box-k, #hlmodal.hlset-modal .rci p.rci-box-more { color: var(--rci-mut); }

/* Phones and tablets: every button in the import cards is a 44px tap (found by the 390/768 audit, docs/ua/mobile-audit.md). */
@media (max-width: 900px), (pointer: coarse) {
  .rci-btn { min-height: 44px; }
}
