/* =============================================================
   RCT Guide Report Page
   Runs on the public /guide-report/ page, alongside checkin.css
   (shared loading/error/spinner styles). Guides open this almost
   exclusively on a phone, so everything below is mobile-first —
   the table layout for recipients only kicks in on wide screens.
============================================================= */

.rct-gr {
  display: flex; flex-direction: column; min-height: 100vh;
  font-size: 15px; color: #1d2327;
  max-width: 100%; overflow-x: hidden; /* safety net: nothing below should ever push wider than the viewport */
}
.rct-gr, .rct-gr input, .rct-gr select, .rct-gr button { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

.rct-gr__header {
  background: #1d2327; color: #fff;
  padding: 18px 16px calc(16px + env(safe-area-inset-top, 0px));
  padding-top: 18px;
}
.rct-gr__title { font-size: 19px; font-weight: 700; line-height: 1.3; }
.rct-gr__code { font-weight: 400; opacity: .65; font-size: 15px; }
.rct-gr__tour { font-size: 13px; opacity: .85; margin-top: 4px; }
.rct-gr__tourcodes { font-size: 12px; opacity: .55; margin-top: 2px; }

.rct-gr-body {
  padding: 12px 12px calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 12px;
  max-width: 640px; margin: 0 auto; width: 100%;
  box-sizing: border-box;
}

.rct-gr-card {
  background: #fff; border-radius: 12px; padding: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 1px 8px rgba(0,0,0,.05);
}
.rct-gr-card__title {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: #50575e; margin: 0 0 12px;
}
.rct-gr-source { font-weight: 400; text-transform: none; letter-spacing: 0; color: #8c8f94; font-size: 12px; display: block; margin-top: 2px; }

/* ---------- Progress / breadcrumb strip (informational only, nothing locks) ---------- */
.rct-gr-progress {
  display: flex; align-items: center; gap: 4px; overflow-x: auto;
  padding: 10px 12px; background: #2c3338; -webkit-overflow-scrolling: touch;
}
.rct-gr-progress__step { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; opacity: .55; white-space: nowrap; }
.rct-gr-progress__step--done { opacity: .85; }
.rct-gr-progress__step--current { opacity: 1; }
.rct-gr-progress__num {
  width: 20px; height: 20px; border-radius: 50%; background: #50575e; color: #fff;
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rct-gr-progress__step--done .rct-gr-progress__num { background: #00a32a; }
.rct-gr-progress__step--current .rct-gr-progress__num { background: #2271b1; }
.rct-gr-progress__step--soon .rct-gr-progress__num { background: #787c82; }
.rct-gr-progress__label { font-size: 11.5px; color: #fff; font-weight: 600; }
.rct-gr-progress__label em { font-style: normal; opacity: .7; }
.rct-gr-progress__sep { color: #6c7378; font-size: 12px; flex: 0 0 auto; }

/* ---------- Numbered step cards ---------- */
.rct-gr-step-card__eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .8px; color: #2271b1; margin-bottom: 4px; }
.rct-gr-step-card--send { background: #eef6fc; border: 1px solid #b8daf0; }
.rct-gr-step-card--send .rct-gr-step-card__eyebrow { color: #0a5a94; }
.rct-gr-step-card--soon { opacity: .7; }

/* ---------- Buttons (bigger touch targets than the shared checkin.css base) ---------- */
.rct-gr .rct-ci-btn {
  min-height: 44px; padding: 10px 18px; font-size: 15px;
  border-radius: 8px; justify-content: center;
}
.rct-gr .rct-ci-btn--sm { min-height: 38px; padding: 8px 14px; font-size: 13px; }
.rct-gr .rct-ci-btn--secondary {
  background: #f0f0f1; color: #1d2327;
}
.rct-gr .rct-ci-btn--secondary:hover { background: #dcdcde; }
.rct-gr .rct-ci-btn:disabled { opacity: .5; cursor: default; }

.rct-gr-link-btn {
  border: none; background: none; color: #2271b1; font-size: 13px;
  font-weight: 600; cursor: pointer; padding: 10px 4px; text-decoration: underline;
}

/* ---------- Photo ---------- */
.rct-gr-photo { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.rct-gr-photo__thumb { max-width: 100%; width: 220px; border-radius: 10px; display: block; }

/* ---------- CSV upload / add recipient controls ---------- */
.rct-gr-load-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.rct-gr-app-instructions { background: #f0f6fc; border: 1px solid #c5d9ed; border-radius: 8px; padding: 8px 10px; }
.rct-gr-csv-upload { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 14px; }
.rct-gr-hint { font-size: 12.5px; color: #787c82; margin: 4px 0; line-height: 1.5; }
.rct-gr-hint--warn { color: #9a6600; }
.rct-gr-hint--bad { color: #d63638; }

.rct-gr-booking-suggestion {
  font-size: 12.5px; color: #9a6600; margin-top: 4px; line-height: 1.5;
}
.rct-gr-booking-suggestion .rct-gr-link-btn { font-size: 12.5px; padding: 0 0 0 4px; }

.rct-gr-verify-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px;
}

.rct-gr-add-recipient { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.rct-gr-add-input {
  padding: 10px 12px; border: 1px solid #c3c4c7; border-radius: 8px; font-size: 15px;
  width: 100%; box-sizing: border-box;
}

.rct-gr-icon-btn {
  border: none; background: none; cursor: pointer; font-size: 14px; padding: 2px 4px;
  color: #787c82; vertical-align: middle;
}
.rct-gr-icon-btn:hover { color: #2271b1; }
.rct-gr-edit-actions { display: flex; gap: 8px; margin-top: 6px; }

.rct-gr-bulk-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px;
}
.rct-gr-bulk-bar .rct-gr-add-input { width: auto; flex: 1 1 180px; }
.rct-gr-bulk-selectall {
  display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600;
  white-space: nowrap;
}

/* ---------- Recipients: card-stack on phones, table from 700px up ---------- */
.rct-gr-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-bottom: 4px; }

@media (max-width: 699px) {
  .rct-gr-table, .rct-gr-table thead, .rct-gr-table tbody, .rct-gr-table th, .rct-gr-table td, .rct-gr-table tr {
    display: block;
  }
  .rct-gr-table thead { display: none; }
  .rct-gr-table tr {
    border: 1px solid #eee; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px;
    display: grid;
    /* minmax(0, ...) not plain auto/1fr — grid items default to a min-width of
       "auto" (their content's un-shrunk size), so a <select> with a long
       option label or a long email would otherwise force the whole row (and
       the page) wider than the viewport instead of wrapping/eliding. */
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, auto);
    align-items: start; gap: 4px 10px; max-width: 100%; box-sizing: border-box;
  }
  .rct-gr-table td { border: none; padding: 4px 0; min-width: 0; }
  .rct-gr-table td[data-label]:not([data-label=""])::before {
    content: attr(data-label); display: block; font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .4px; color: #a7aaad; margin-bottom: 2px;
  }
  .rct-gr-recipient-row td:nth-child(1) { grid-row: 1 / 3; }
  .rct-gr-recipient-row td:nth-child(2) { grid-column: 2; }
  .rct-gr-recipient-row td:nth-child(3) { grid-column: 2; }
  .rct-gr-recipient-row td:nth-child(4) { grid-column: 2; }
  .rct-gr-recipient-row td:nth-child(5) { grid-row: 1; grid-column: 3; }
  .gr-preview-row td:nth-child(1) { grid-column: 1 / 3; }
  .gr-preview-row td:nth-child(2) { grid-column: 1 / 3; }
  .gr-preview-row td:nth-child(3) { grid-row: 1; grid-column: 3; }
}

@media (min-width: 700px) {
  .rct-gr-table th {
    text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px;
    color: #787c82; padding: 6px 8px; border-bottom: 2px solid #f0f0f1;
  }
  .rct-gr-table td { padding: 8px; border-bottom: 1px solid #f0f0f1; vertical-align: middle; }
}

.gr-recipient-check, .gr-preview-row input[type="checkbox"] { width: 20px; height: 20px; }
.rct-gr-email-cell { word-break: break-all; }
.gr-template-select {
  padding: 8px 10px; border: 1px solid #c3c4c7; border-radius: 6px; font-size: 13px;
  width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; background: #fff;
}
.gr-preview-name, .gr-preview-email {
  padding: 8px 10px; border: 1px solid #c3c4c7; border-radius: 6px; font-size: 14px;
  width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box;
}

.rct-gr-row-remove {
  border: none; background: #f6f7f7; color: #787c82; width: 32px; height: 32px;
  border-radius: 50%; font-size: 18px; line-height: 1; cursor: pointer;
}
.rct-gr-row-remove:hover { background: #fcf0f1; color: #d63638; }

/* ---------- Badges & inline hints ---------- */
.rct-gr-badge {
  font-size: 10px; font-weight: 700; border-radius: 8px; padding: 2px 7px;
  text-transform: uppercase; letter-spacing: .3px; margin-left: 4px; white-space: nowrap;
}
.rct-gr-badge--ok   { background: #d1f2e2; color: #0a7a3f; }
.rct-gr-badge--bad  { background: #fcf0f1; color: #d63638; }
.rct-gr-badge--warn { background: #fdf3d0; color: #9a6600; }

.rct-gr-typo-hint { font-size: 12px; color: #9a6600; margin-top: 3px; }
.rct-gr-typo-hint--bad { color: #d63638; }
.rct-gr-send-error { font-size: 12px; color: #d63638; margin-top: 3px; }

.gr-preview-row--warn { background: #fefaf0; }
.gr-preview-row--invalid { background: #fef3f3; }
@media (max-width: 699px) {
  .gr-preview-row--warn.gr-preview-row { border-color: #f0d090; }
  .gr-preview-row--invalid.gr-preview-row { border-color: #f0b4b6; }
}

/* ---------- Send bar ---------- */
.rct-gr-send-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid #f0f0f1;
  position: sticky; bottom: 0; background-color: inherit;
}
.rct-gr-send-bar .rct-ci-btn { flex: none; }
.rct-gr-send-msg { font-size: 13px; color: #50575e; flex-basis: 100%; }

/* ---------- Note (rich text) ---------- */
.rct-gr-editor {
  border: 1px solid #c3c4c7; border-radius: 8px; overflow: hidden;
  background: #fff; margin-bottom: 12px;
}
.rct-gr-editor__toolbar {
  display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid #e0e0e0; background: #f6f7f7;
}
.rct-gr-editor__btn {
  background: none; border: 1px solid transparent; border-radius: 6px;
  min-width: 40px; min-height: 40px; font-size: 15px; color: #50575e; cursor: pointer;
}
.rct-gr-editor__btn:hover, .rct-gr-editor__btn:active { background: #e0e0e0; border-color: #c3c4c7; color: #1d2327; }
.rct-gr-editor__content {
  min-height: 80px; padding: 12px; font-size: 15px;
  color: #1d2327; line-height: 1.6; outline: none;
}
.rct-gr-editor__content:focus { box-shadow: inset 0 0 0 2px rgba(34,113,177,.15); }

/* ---------- Stats ---------- */
.rct-gr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 10px; }
.rct-gr-stat {
  display: flex; flex-direction: column; align-items: center;
  background: #f6f7f7; border-radius: 8px; padding: 12px 8px;
}
.rct-gr-stat__val { font-size: 20px; font-weight: 800; color: #1d2327; }
.rct-gr-stat__label { font-size: 11px; color: #787c82; text-transform: uppercase; letter-spacing: .4px; margin-top: 2px; }
