/* Roadmap — ONE universal roadmap for every organisation: 8 dependency-ordered setup phases
   (Initial tab), 6 recurring cadence tabs and the Audit Trail. Shared suite shell from
   app-chrome.css + menu.js + assistant.js. Fonts: Lexend (headings) + Mulish (body).
   State/due/confidence conveyed by text + colour, never colour alone. */

:root {
  --rm-navy: #16273F; --rm-ink: #33404F; --rm-muted: #5B6675; --rm-faint: #8791A0;
  --rm-line: #EAEDF3; --rm-line-soft: #F1F4F8; --rm-red: #E8402A; --rm-blue: #2F6FE0;
  --rm-green: #1FA97A; --rm-amber: #B5762F; --rm-shadow: 0 4px 16px rgba(18,38,63,0.05);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: 'Mulish', system-ui, sans-serif; color: var(--rm-ink); background: linear-gradient(180deg, #F6F4FB 0%, #F1F6F6 100%); }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-shell .rm-header-inner, .app-shell .rm-footer-inner { max-width: 90%; }
@keyframes rmFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rmShimmer { 0% { background-position: -450px 0; } 100% { background-position: 450px 0; } }

/* ---- Hero ---- */
.rm-hero { background: linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0)); border-bottom: 1px solid var(--rm-line); }
.rm-hero-inner { max-width: 90%; margin: 0 auto; padding: 26px 32px 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.rm-hero-title { font-family: 'Lexend'; font-weight: 800; font-size: 38px; margin: 0 0 8px; letter-spacing: -0.5px; color: var(--rm-navy); }
.rm-hero-sub { max-width: 720px; font-size: 14.5px; line-height: 1.6; color: var(--rm-muted); margin: 0; }

/* ---- Tabs ---- */
.rm-tabbar { background: #fff; border-bottom: 1px solid var(--rm-line); position: sticky; top: 0; z-index: 20; }
.rm-tabbar-inner { max-width: 90%; margin: 0 auto; padding: 0 32px; display: flex; gap: 22px; flex-wrap: wrap; }
.rm-tab { appearance: none; background: none; border: none; cursor: pointer; font-family: 'Lexend'; font-weight: 600; font-size: 15px; color: var(--rm-faint); padding: 16px 2px; border-bottom: 3px solid transparent; white-space: nowrap; }
.rm-tab:hover { color: var(--rm-navy); }
.rm-tab.active { font-weight: 700; color: var(--rm-navy); border-bottom-color: var(--rm-red); }
.rm-tab-count { margin-left: 7px; font-family: 'Lexend'; font-weight: 700; font-size: 11px; color: var(--rm-muted); background: #F1F4FA; border: 1px solid #E4E9F1; border-radius: 999px; padding: 2px 8px; }
.rm-tab-count.complete { color: #14795A; background: #E7F7F1; border-color: #CDEDE1; }

/* ---- Main ---- */
.rm-main { flex: 1; width: 100%; }
.rm-body { max-width: 90%; margin: 0 auto; padding: 26px 32px 56px; animation: rmFade .35s ease both; }
.rm-prompt { text-align: center; color: var(--rm-faint); font-size: 15px; padding: 60px 20px; }
.rm-error { max-width: 90%; margin: 32px auto; padding: 30px; text-align: center; color: #C0392B; background: #fff; border: 1px solid var(--rm-line); border-radius: 16px; }
.rm-empty-soft { background: #fff; border: 1px dashed #D5DDE8; border-radius: 16px; padding: 40px; text-align: center; color: var(--rm-muted); }
.rm-empty-soft b { display: block; font-family: 'Lexend'; font-size: 16px; color: var(--rm-navy); margin-bottom: 6px; }
.rm-card { background: #fff; border: 1px solid var(--rm-line); border-radius: 16px; padding: 22px 24px; box-shadow: var(--rm-shadow); }
.rm-pill { display: inline-flex; align-items: center; gap: 6px; font-family: 'Lexend'; font-weight: 700; font-size: 12px; color: var(--rm-navy); background: #F4F6FA; border: 1px solid #E4E9F1; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.rm-pill.complete { color: #14795A; background: #E7F7F1; border-color: #CDEDE1; }

/* ---- Buttons ---- */
.rm-btn { appearance: none; cursor: pointer; font-family: 'Lexend'; font-weight: 700; font-size: 13.5px; border-radius: 11px; padding: 10px 16px; border: 1px solid transparent; }
.rm-btn-primary { background: var(--rm-red); color: #fff; }
.rm-btn-primary:hover:not(:disabled) { background: #d3381f; }
.rm-btn-primary:disabled { opacity: .5; cursor: default; }
.rm-btn-ghost { background: #fff; color: var(--rm-muted); border-color: #E4E9F1; }
.rm-btn-ghost:hover:not(:disabled) { background: #F7F9FC; }

/* ---- Setup phases (Initial tab) ---- */
.rm-phases { display: flex; flex-direction: column; gap: 16px; }
.rm-phase { background: #fff; border: 1px solid var(--rm-line); border-radius: 16px; box-shadow: var(--rm-shadow); }
.rm-phase-head { display: flex; align-items: center; gap: 14px; width: 100%; padding: 18px 22px; background: none; border: none; cursor: pointer; text-align: left; }
.rm-phase-head:hover { background: #FBFCFE; }
.rm-phase-num { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 11px; background: #EEF3FF; color: var(--rm-blue); display: flex; align-items: center; justify-content: center; font-family: 'Lexend'; font-weight: 800; font-size: 15px; }
.rm-phase-num.done { background: #E7F7F1; color: var(--rm-green); }
.rm-phase-id { flex: 1; min-width: 0; }
.rm-phase-name { display: block; font-family: 'Lexend'; font-weight: 700; font-size: 16.5px; color: var(--rm-navy); }
.rm-phase-meta { display: block; font-size: 12.5px; color: var(--rm-faint); }
.rm-phase-prog { flex: 0 0 110px; }
.rm-phase-chev { flex: 0 0 auto; transition: transform .2s ease; }
.rm-phase-head[aria-expanded="true"] .rm-phase-chev { transform: rotate(180deg); }
.rm-phase-body { padding: 4px 22px 22px; display: flex; flex-direction: column; gap: 10px; animation: rmFade .25s ease both; }
.rm-pbar-track { display: block; height: 8px; border-radius: 999px; background: #EEF1F6; overflow: hidden; }
.rm-pbar-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg,#1FA97A,#28BFC0); }

/* ---- Cadence tabs (recurring, flat list) ---- */
.rm-cadence-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.rm-cadence-title { font-family: 'Lexend'; font-weight: 700; font-size: 24px; color: var(--rm-navy); margin: 0 0 4px; }
.rm-cadence-blurb { font-size: 14.5px; color: var(--rm-faint); }
.rm-cadence-headright { display: flex; align-items: center; gap: 12px; }
.rm-cadence-progtrack { display: block; width: 110px; height: 8px; border-radius: 999px; background: #EEF1F6; overflow: hidden; }
.rm-cadence-rows { display: flex; flex-direction: column; gap: 10px; }

/* ---- Row anatomy (shared by setup + recurring) ---- */
.rm-row { display: flex; align-items: flex-start; gap: 13px; padding: 14px 16px; background: #fff; border: 1px solid #E9EDF4; border-radius: 16px; }
.rm-row.done { background: #FBFDFC; border-color: #E2F0EA; }
.rm-row-num { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 8px; background: #F4F6FA; border: 1px solid #E4E9F1; display: flex; align-items: center; justify-content: center; font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 700; font-size: 11px; color: var(--rm-faint); margin-top: 2px; }
.rm-tick { flex: 0 0 auto; width: 22px; height: 22px; margin-top: 2px; border-radius: 7px; cursor: pointer; display: flex; align-items: center; justify-content: center; background: #fff; border: 1.6px solid #CBD4E0; }
.rm-tick.on { background: var(--rm-green); border-color: var(--rm-green); }
.rm-tick:focus-visible { outline: 3px solid rgba(47,111,224,0.3); outline-offset: 2px; }
.rm-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.rm-row-title { font-family: 'Lexend'; font-weight: 700; font-size: 14.5px; color: var(--rm-navy); line-height: 1.4; }
.rm-row.done .rm-row-title { color: var(--rm-faint); text-decoration: line-through; }
.rm-row-detail { display: flex; flex-direction: column; gap: 11px; padding: 14px 16px; background: #F7F9FC; border: 1px solid var(--rm-line-soft); border-radius: 12px; }
.rm-row-detail-block { display: flex; flex-direction: column; gap: 4px; }
.rm-row-detail-label { font-family: 'Lexend'; font-weight: 800; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--rm-faint); }
.rm-row-detail-text { font-size: 13.5px; line-height: 1.6; color: var(--rm-ink); }
.rm-row-line { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.rm-row-pill { display: inline-flex; align-items: center; flex: 0 0 auto; font-family: 'Lexend'; font-weight: 700; font-size: 10.5px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: #F4F6FA; border: 1px solid #E4E9F1; color: var(--rm-muted); }
.rm-row-pill--done { color: #14795A; background: #E7F7F1; border-color: #CDEDE1; }
.rm-row-pill--doing { color: #95530D; background: #FCF3E8; border-color: #F1E2C8; }
.rm-row-product { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1.5px solid #E4E9F1; border-radius: 10px; padding: 6px 12px; text-decoration: none; font-family: 'Lexend'; font-weight: 600; font-size: 12px; color: #3B4757; white-space: nowrap; }
.rm-row-product:hover { border-color: var(--rm-navy); color: var(--rm-navy); }
.rm-row-sig { display: inline-flex; align-items: center; gap: 6px; font-family: 'Lexend'; font-weight: 600; font-size: 11px; color: var(--rm-muted); }
.rm-expand-btn { flex: 0 0 auto; width: 38px; height: 38px; margin-left: 4px; border-radius: 11px; background: #F4F6FA; border: 1px solid #E4E9F1; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* Recurring rows: due chip, cadence note, sign-off button, reminder / no-owner / history lines. */
.rm-due-pill { display: inline-flex; align-items: center; flex: 0 0 auto; background: #F7F9FC; border: 1px solid #E4E9F1; color: var(--rm-ink); font-family: 'Lexend'; font-weight: 700; font-size: 10.5px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.rm-due-pill.overdue { background: #FCECEC; border-color: #F5D5D5; color: #C0392B; }
.rm-due-pill.soon { background: #FCF3E8; border-color: #F1E2C8; color: #95530D; }
.rm-cadence-note { font-size: 11.5px; color: var(--rm-faint); }
.rm-sign-btn { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; background: var(--rm-navy); border: none; border-radius: 10px; padding: 8px 14px; cursor: pointer; font-family: 'Lexend'; font-weight: 600; font-size: 12.5px; color: #fff; }
.rm-reminder { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--rm-faint); }
.rm-noowner { font-size: 11.5px; color: #95530D; font-weight: 600; }
.rm-history { font-size: 11.5px; color: var(--rm-faint); }

/* ---- Assignee picker ----
   Absolute, anchored to the trigger's own position:relative wrapper (never fixed) — see
   app.js's renderAssignPanel() doc comment for why. The overlay sits at z-index 55, strictly
   below the panel's 60. */
.rm-assign-trigger { display: flex; align-items: center; gap: 8px; height: 38px; box-sizing: border-box; background: #fff; border: 1.5px solid #E4E9F1; border-radius: 999px; padding: 0 14px 0 4px; cursor: pointer; max-width: 172px; }
.rm-assign-trigger.open, .rm-assign-trigger:hover { border-color: #B9CEF0; background: #F1F4FA; }
.rm-assign-label { min-width: 0; font-family: 'Lexend'; font-weight: 600; font-size: 12.5px; color: #33404F; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-avatar { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: 'Lexend'; font-weight: 800; font-size: 9px; color: #fff; }
.rm-avatar-sm { width: 18px; height: 18px; font-size: 8.5px; }
.rm-assign-overlay { position: fixed; inset: 0; z-index: 55; display: block; }
.rm-assign-panel { position: absolute; right: 0; z-index: 60; width: 264px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid #E4E8EF; border-radius: 16px; box-shadow: 0 16px 40px rgba(16,26,40,0.18); padding: 8px; animation: rmFade .14s ease both; }
.rm-assign-opt { display: flex; align-items: center; gap: 9px; width: 100%; height: 38px; box-sizing: border-box; background: none; border: none; border-radius: 9px; padding: 0 8px; cursor: pointer; text-align: left; }
.rm-assign-opt:hover { background: #F4F6FA; }
.rm-assign-opt.on { background: #F1F4FA; }
.rm-assign-opt-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.rm-assign-opt-name { font-family: 'Lexend'; font-weight: 600; font-size: 13px; color: var(--rm-navy); }
.rm-assign-opt-role { font-size: 11.5px; color: var(--rm-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Audit trail ---- */
.rm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.rm-head h2 { font-family: 'Lexend'; font-weight: 700; font-size: 22px; color: var(--rm-navy); margin: 0 0 4px; }
.rm-head-sub { font-size: 13.5px; color: var(--rm-faint); }
.rm-head-actions { display: flex; gap: 9px; }
.rm-trail { background: #fff; border: 1px solid var(--rm-line); border-radius: 16px; box-shadow: var(--rm-shadow); overflow: hidden; }
.rm-thead, .rm-trow { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.3fr) minmax(0, 1.3fr) 120px; gap: 16px; align-items: center; }
.rm-thead { padding: 13px 24px; background: #FAFBFD; border-bottom: 1px solid var(--rm-line); font-family: 'Lexend'; font-weight: 700; font-size: 11.5px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--rm-faint); }
.rm-trow { padding: 14px 24px; border-bottom: 1px solid var(--rm-line-soft); }
.rm-trow:last-child { border-bottom: none; }
.rm-trow.reopened { opacity: 0.7; }
.rm-tr-action { min-width: 0; }
.rm-tr-text { display: block; font-family: 'Lexend'; font-weight: 600; font-size: 13.5px; color: var(--rm-navy); }
.rm-tr-phase { display: block; font-size: 12px; color: var(--rm-faint); }
.rm-tr-tool { font-size: 13px; color: var(--rm-muted); }
.rm-tr-by { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--rm-navy); }
.rm-tr-date { font-size: 12.5px; color: var(--rm-muted); }
.rm-trail-skel { padding: 40px; text-align: center; color: var(--rm-faint); }

/* ---- Skeleton + toast ---- */
.rm-skel { background: linear-gradient(90deg, #eef1f6 25%, #f6f8fb 50%, #eef1f6 75%); background-size: 900px 100%; animation: rmShimmer 1.4s infinite; border: none; height: 150px; }
.rm-save-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--rm-navy); color: #fff; font-family: 'Lexend'; font-weight: 700; font-size: 13px; padding: 10px 18px; border-radius: 999px; z-index: 130; box-shadow: 0 8px 24px rgba(18,38,63,0.28); }

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .rm-hero-inner, .rm-body, .rm-tabbar-inner { padding-left: 18px; padding-right: 18px; }
  .rm-thead { display: none; }
  .rm-trow { grid-template-columns: 1fr; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .rm-phase-chev, .rm-expand-btn svg { transition: none; animation: none; }
}

/* Red header action = the Domains app's "+ Add domain" pill (fe-landscape .dl-add-btn): 999px radius,
   12px 22px, 15px Lexend 600, red glow, #D6371F on hover. Scoped to the header/hero so modal and
   wizard buttons sharing the class keep their own shape. */
.rm-head-actions .rm-btn-primary {
  display: inline-flex; align-items: center; gap: 9px; background: #E8402A; color: #fff; border: none;
  font-family: "Lexend", sans-serif; font-weight: 600; font-size: 15px; padding: 12px 22px;
  border-radius: 999px; box-shadow: 0 6px 16px rgba(232, 64, 42, 0.28); white-space: nowrap;
  text-decoration: none; cursor: pointer;
}
.rm-head-actions .rm-btn-primary:hover { background: #D6371F; }
.rm-head-actions .rm-btn-primary:focus-visible { outline: 2px solid #16273F; outline-offset: 3px; }

/* Page heading + subtitle — identical to the Dashboard's .db-greeting / .db-subtitle, suite-wide. */
.rm-hero-title { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 38px; line-height: 1.05; letter-spacing: -0.5px; color: #16273F; margin: 0 0 6px; }
.rm-hero-sub { font-size: 15.5px; font-weight: 400; color: #5B6675; margin: 0; }
