/* Release R1b client screens (mad_recovery_journey): the inbox, the program
 * end, the progress report page and their cards. Built only on the app's
 * tokens (rehab_app_v5.css), so the three themes work; no color is the only
 * cue (unread has a dot AND bold text AND "New:" for screen readers; a
 * result has its words). 44 px tap targets, logical properties for
 * right-to-left pages. Versioned filename: module static files are cached. */

.mrj-lead { color: var(--ink-2); font-size: calc(0.9375rem * var(--tx, 1)); margin-block: 2px 12px; }
.mrj-kicker { font-size: calc(0.75rem * var(--tx, 1)); letter-spacing: .08em; text-transform: uppercase; color: var(--gold-2); font-weight: 700; margin-block-end: 6px; }
.mrj-strong { font-weight: 700; color: var(--ink); }
.mrj-h3 { margin-block: 0 6px; font-size: calc(1.125rem * var(--tx, 1)); line-height: 1.25; color: var(--ink); }
.mrj-small { color: var(--ink-3); font-size: calc(0.875rem * var(--tx, 1)); margin-block: 6px 10px; }
.mrj-foot { color: var(--ink-3); font-size: calc(0.875rem * var(--tx, 1)); margin-block: 18px 8px; text-align: center; }
.mrj-foot a { color: var(--gold-2); }
.mrj-card p, .mrj-option p, .mrj-result p { margin-block: 0 10px; }
.mrj-busy { opacity: .7; pointer-events: none; }
.mrj-final-note { color: var(--ink-2); font-size: calc(0.9375rem * var(--tx, 1)); margin-block: 0 12px; }

/* The bell and its count */
.mrj-bell { position: relative; color: var(--ink); text-decoration: none; }
.mrj-badge { position: absolute; inset-block-start: -4px; inset-inline-end: -4px; min-width: 20px; height: 20px; padding-inline: 5px;
             border-radius: var(--pill, 999px); background: var(--gold); color: var(--on-gold); font-size: 12px; font-weight: 800;
             line-height: 20px; text-align: center; box-shadow: 0 0 0 2px var(--bg); box-sizing: border-box; }

/* Rows that open something (inbox, report) */
.mrj-inbox-row { display: flex; align-items: center; gap: 12px; min-height: 64px; color: var(--ink); text-decoration: none; }
.mrj-inbox-row:focus-visible, .mrj-item:focus-visible, .mrj-end-card:focus-visible { outline: 3px solid var(--gold-2); outline-offset: 2px; }
.mrj-row-txt, .mrj-end-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mrj-ic { width: 40px; height: 40px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
          background: var(--gold-wash); color: var(--gold-2); }
.mrj-ic svg { width: 20px; height: 20px; }

/* The inbox */
.mrj-inbox-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mrj-inbox-head .mrj-lead { margin: 0; }
.mrj-link-btn { background: none; border: 0; padding: 10px 4px; min-height: 44px; color: var(--gold-2); font-weight: 700; cursor: pointer;
                text-decoration: underline; text-underline-offset: 3px; font-size: calc(0.9375rem * var(--tx, 1)); }
.mrj-list { list-style: none; padding: 0; margin: 10px 0 0; }
.mrj-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px; margin-block-end: 8px; border-radius: 16px; min-height: 64px;
            background: var(--card); border: 1px solid var(--line-2); color: var(--ink); text-decoration: none; }
.mrj-item.is-unread { border-color: var(--line); background: linear-gradient(180deg, var(--gold-wash-2), var(--card)); }
.mrj-item-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mrj-item-title { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.mrj-item.is-unread .mrj-item-title { font-weight: 800; }
.mrj-item-body { color: var(--ink-2); font-size: calc(0.9375rem * var(--tx, 1)); overflow-wrap: anywhere; }
.mrj-item-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.mrj-when { color: var(--ink-3); font-size: calc(0.8125rem * var(--tx, 1)); white-space: nowrap; }
.mrj-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.mrj-empty { text-align: center; color: var(--ink-2); }
.mrj-empty .mrj-medal { margin-inline: auto; }

/* The program end */
.mrj-hero { text-align: center; padding: 18px 8px 8px; }
.mrj-hero-h { margin: 10px 0 4px; font-size: calc(1.5rem * var(--tx, 1)); line-height: 1.2; color: var(--ink); }
.mrj-hero-sub { margin: 0; color: var(--ink-2); }
.mrj-medal { width: 48px; height: 48px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
             background: var(--gold); color: var(--on-gold); box-shadow: 0 0 0 6px var(--gold-wash); }
.mrj-medal svg { width: 24px; height: 24px; }
.mrj-medal.big { width: 76px; height: 76px; box-shadow: 0 0 0 10px var(--gold-wash), 0 0 0 20px var(--gold-wash-2); }
.mrj-medal.big svg { width: 38px; height: 38px; }
@media (prefers-reduced-motion: no-preference) {
    .mrj-hero .mrj-medal.big { animation: mrj-pop .6s ease-out both; }
}
@keyframes mrj-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.mrj-end-card { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.mrj-steps { margin: 6px 0 14px; padding-inline-start: 22px; color: var(--ink-2); }
.mrj-steps li { margin-block: 4px; }
.mrj-steps li.is-done { color: var(--ok); font-weight: 700; }
.mrj-steps li.is-done::after { content: " - done"; }

.mrj-result.mrj-improved { border-color: var(--ok); }
.mrj-result.mrj-worse { border-color: var(--amber-line-2, var(--amber)); }
.mrj-ba { list-style: none; padding: 0; margin: 8px 0 0; }
ul.card.mrj-ba { padding: 6px 16px; }
.mrj-ba-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-block: 8px; border-block-end: 1px dashed var(--line-2); }
.mrj-ba-row:last-child { border-block-end: 0; }
.mrj-ba-name { color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.mrj-ba-vals { display: inline-flex; gap: 6px; align-items: baseline; font-weight: 700; color: var(--ink); text-align: end; flex-wrap: wrap; justify-content: flex-end; }
.mrj-ba-b { color: var(--ink-3); font-weight: 600; }
.mrj-arrow { color: var(--gold-2); }
[dir="rtl"] .mrj-arrow { display: inline-block; transform: scaleX(-1); }
.mrj-joints .mrj-joint { padding-block: 8px; border-block-end: 1px dashed var(--line-2); }
.mrj-joints .mrj-joint:last-child { border-block-end: 0; }
.mrj-changes { margin: 4px 0 0; padding-inline-start: 18px; color: var(--ink-2); }
.mrj-chg { font-weight: 700; }
.mrj-chg-cleared, .mrj-chg-improved { color: var(--ok); }
.mrj-chg-worse { color: var(--amber); }
.mrj-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-block: 12px; border-radius: 14px;
            border: 1px dashed var(--line-2); color: var(--ink-2); font-size: calc(0.875rem * var(--tx, 1)); line-height: 1.4; }
.mrj-note svg { width: 20px; height: 20px; flex: none; color: var(--gold-2); }
.mrj-option .btn + .btn { margin-block-start: 8px; }
.mrj-mini { margin: 0 0 12px; padding-inline-start: 18px; color: var(--ink); }
.mrj-mini li { margin-block: 3px; }
.mrj-rest { text-align: center; }
.mrj-tick { display: flex; gap: 10px; align-items: flex-start; margin-block: 14px 10px; color: var(--ink); cursor: pointer; }
.mrj-tick input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--gold); }

/* How is it now? and pain now */
.mrj-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.mrj-answers { display: grid; grid-template-columns: 1fr; gap: 8px; margin-block: 8px; }
@media (min-width: 380px) { .mrj-answers { grid-template-columns: repeat(3, minmax(0, 1fr)); } .mrj-answers .btn { padding-inline: 8px; } }
.mrj-pain-pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--ink-2); font-size: calc(0.875rem * var(--tx, 1)); }
.mrj-pain-pick select { min-height: 44px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--card-2); color: var(--ink); padding: 6px 10px; font-size: 16px; }
.mrj-nrs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-block: 12px 6px; }
@media (min-width: 600px) { .mrj-nrs { grid-template-columns: repeat(11, minmax(44px, 1fr)); gap: 4px; } }
.mrj-nrs input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mrj-nrs label { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 12px; border: 1.5px solid var(--line-2);
                 background: var(--card-2); color: var(--ink); font-weight: 700; cursor: pointer; }
.mrj-nrs input:checked + label { border-color: var(--gold); background: var(--gold-wash); box-shadow: inset 0 0 0 2px var(--gold); }
.mrj-nrs input:focus-visible + label { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.mrj-anchors { display: flex; justify-content: space-between; color: var(--ink-3); font-size: calc(0.8125rem * var(--tx, 1)); margin-block-end: 14px; }
.mrj-pain .mrj-strong { display: block; margin-block-end: 4px; line-height: 1.35; }

/* The report page */
.mrj-report-sum { display: flex; justify-content: space-around; text-align: center; }
.mrj-stat { display: flex; flex-direction: column; gap: 2px; }
.mrj-stat .v { font-size: calc(1.5rem * var(--tx, 1)); font-weight: 800; color: var(--ink); }
.mrj-stat .k { color: var(--ink-3); font-size: calc(0.8125rem * var(--tx, 1)); }
.mrj-share { display: grid; gap: 10px; margin-block: 4px 8px; text-align: center; }
