/* =============================================================================
   Arodus — shared "Turn into report" / cadence panel.
   One panel, two entry points: the Dashboard (pre-fills current view) and
   Settings → Reporting Cadences (starts with a view picker). Reuses the app
   tokens (--canvas, --surface, --accent, fonts, radii) defined on each page.
   ========================================================================== */

.rp-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(6, 11, 18, .66); backdrop-filter: blur(3px);
  display: none; align-items: flex-start; justify-content: center;
  padding: 48px 20px; overflow-y: auto;
}
.rp-overlay.show { display: flex; }

.rp-panel {
  width: 100%; max-width: 540px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop, 0 12px 40px rgba(0,0,0,.5));
  display: flex; flex-direction: column; max-height: 88vh; overflow: hidden;
}

/* header */
.rp-head { display: flex; align-items: center; gap: 10px; padding: 17px 20px; border-bottom: 1px solid var(--border); flex: none; }
.rp-head .rp-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--text); }
.rp-head .rp-close { margin-left: auto; width: 32px; height: 32px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text-muted); cursor: pointer; }
.rp-head .rp-close:hover { color: var(--text); }

/* scroll region holds the pinned source bar + body */
.rp-scroll { overflow-y: auto; flex: 1; }

/* pinned source line — trust: export matches screen */
.rp-source { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 13px 20px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.rp-source .rp-vicon { width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; color: var(--accent-hover); flex: none; }
.rp-sbody { flex: 1; min-width: 0; }
.rp-sname { color: var(--text); font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-smeta { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.rp-source select.rp-field { width: 100%; }

/* body */
.rp-body { padding: 18px 20px 4px; display: flex; flex-direction: column; gap: 16px; }
.rp-q { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--text); margin: 0; }

/* destination choices */
.rp-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rp-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 13px 13px 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); cursor: pointer; text-align: left; font-family: var(--font-ui); }
.rp-choice:hover { border-color: var(--border-strong); }
.rp-choice.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.rp-choice .ci { color: var(--text-muted); }
.rp-choice.on .ci { color: var(--accent-hover); }
.rp-choice .cl { font-weight: 600; font-size: 13px; color: var(--text); }
.rp-choice .cd { font-size: 11px; color: var(--text-muted); line-height: 1.35; }

/* a path's fields (progressive disclosure) */
.rp-path { display: none; flex-direction: column; gap: 15px; border-top: 1px solid var(--border); padding-top: 16px; }
.rp-path.show { display: flex; }

.rp-fld { display: flex; flex-direction: column; gap: 7px; }
.rp-fld > label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.rp-field { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 9px 11px; color: var(--text); font-family: var(--font-ui); font-size: 13px; outline: none; }
.rp-field:focus { border-color: var(--border-strong); }
.rp-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* segmented control */
.rp-seg { display: inline-flex; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; width: fit-content; }
.rp-seg button { background: transparent; border: 0; color: var(--text-muted); font-size: 12.5px; font-weight: 500; padding: 7px 14px; cursor: pointer; font-family: var(--font-ui); white-space: nowrap; }
.rp-seg button + button { border-left: 1px solid var(--border); }
.rp-seg button.on { background: var(--surface); color: var(--text); }

/* live link */
.rp-endpoint { display: flex; align-items: center; gap: 10px; background: var(--canvas); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 9px 11px; }
.rp-endpoint .rp-url { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 12px; color: var(--text-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-copy { flex: none; display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text-muted); font-size: 11.5px; font-weight: 500; padding: 6px 10px; cursor: pointer; font-family: var(--font-ui); }
.rp-copy:hover { border-color: var(--border-strong); color: var(--text); }
.rp-copy.done { color: #34D399; border-color: #1f5340; }
.rp-signed { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--text-muted); }
.rp-signed svg { color: #34D399; flex: none; }
.rp-expiry-note { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-body); }

.rp-lnk { color: var(--link); font-size: 12.5px; font-weight: 500; background: none; border: 0; padding: 0; cursor: pointer; font-family: var(--font-ui); width: fit-content; }
.rp-lnk:hover { color: var(--accent-hover); }
.rp-lnk.danger { color: #F0746E; }
.rp-lnk.danger:hover { color: #FF7A7A; }

/* recipient chips */
.rp-chips { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 7px 9px; }
.rp-chips:focus-within { border-color: var(--border-strong); }
.rp-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(61,114,214,.12); border: 1px solid rgba(61,114,214,.32); color: var(--link); border-radius: var(--pill); padding: 3px 6px 3px 10px; font-size: 12px; }
.rp-chip .x { cursor: pointer; color: var(--text-muted); display: inline-flex; }
.rp-chip .x:hover { color: var(--text); }
.rp-chips input { flex: 1; min-width: 130px; background: none; border: 0; outline: none; color: var(--text); font-family: var(--font-ui); font-size: 13px; padding: 3px 2px; }
.rp-chips input::placeholder { color: var(--text-muted); }

/* primary action inside a path */
.rp-action { display: flex; align-items: center; gap: 12px; }
.rp-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: var(--r-sm); padding: 9px 16px; font-family: var(--font-ui); font-weight: 600; font-size: 13px; cursor: pointer; background: var(--accent); color: #fff; white-space: nowrap; }
.rp-btn:hover { background: var(--accent-hover); }
.rp-btn:disabled { opacity: .5; cursor: default; }
.rp-btn.ghost { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-body); }
.rp-btn.ghost:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface-2); }
.rp-action .rp-hint { font-size: 11.5px; color: var(--text-muted); }

/* framing: include reported (unverified) events — OFF by default */
.rp-framing { padding: 12px 20px 0; }
.rp-tog { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; cursor: pointer; color: var(--text-body); font-size: 13px; font-family: var(--font-ui); }
.rp-tog:hover { color: var(--text); }
.rp-sw { width: 30px; height: 18px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-strong); position: relative; flex: none; transition: background .15s, border-color .15s; box-sizing: border-box; }
.rp-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--text-muted); transition: transform .15s, background .15s; }
.rp-tog.on .rp-sw { background: var(--accent); border-color: var(--accent); }
.rp-tog.on .rp-sw::after { transform: translateX(12px); background: #fff; }
.rp-tognote { margin-top: 8px; font-size: 11.5px; line-height: 1.5; color: var(--text-muted); max-width: 52ch; }

/* success banner */
.rp-done { display: flex; align-items: center; gap: 10px; background: #10241C; border: 1px solid #1f5340; color: #34D399; border-radius: var(--r-sm); padding: 11px 13px; font-size: 12.5px; }
.rp-done svg { flex: none; }

/* footer — persistent reassurance about report contents */
.rp-foot { display: flex; gap: 9px; align-items: flex-start; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface); flex: none; font-size: 11.5px; color: var(--text-muted); line-height: 1.45; }
.rp-foot svg { flex: none; margin-top: 1px; color: var(--text-muted); }

[hidden] { display: none !important; }
