/* media-room.css — the Media room (rendered by js/rooms-extra.js, renderMedia).

   Phone first: 375 px is the design width. One column, 44 px buttons, the
   page never scrolls sideways. On a wider screen the cards lay out in
   columns and the build table keeps its three columns. Only the tokens both
   apps already define are used (--panel, --border, --text, --accent, ...).
   One copy in each app (frontend/css and backend/css) — keep them identical. */

.mr { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.mr-section { min-width: 0; }
.mr-section > .xr-h { margin-bottom: 4px; }
.mr-section > .hint { margin: 0 0 10px; }

.mr-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 720px) {
  .mr-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}

.mr-card { display: flex; flex-direction: column; gap: 10px; margin: 0 !important; min-width: 0; }
.mr-head { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.mr-n { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--accent-soft); color: var(--accent-strong); font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.mr-titlewrap { min-width: 0; flex: 1; }
.mr-title { margin: 0; font-size: 16px; line-height: 1.3; font-weight: 700; overflow-wrap: anywhere; }
.mr-sum { margin: 4px 0 0 !important; font-size: 13px; line-height: 1.45; color: var(--text-muted); overflow-wrap: anywhere; }

.mr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mr-chip { white-space: nowrap; }
.mr-chip.mr-ready { background: var(--accent-soft); color: var(--accent-strong); box-shadow: inset 0 0 0 1px var(--border-strong); }
.mr-chip.mr-script { background: var(--neutral-chip); color: var(--text); }
.mr-chip.mr-off { background: var(--danger-soft); color: var(--danger); }

.mr-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mr-btn { min-height: 44px; min-width: 44px; padding: 0 16px; font-size: 13.5px; white-space: nowrap; }
.mr-btn.is-done { border-color: var(--accent); }

.mr-reader { max-height: min(60dvh, 520px); overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-sunken); line-height: 1.55; overflow-wrap: anywhere; font-size: 14px; }
.mr-reader:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mr-reader[hidden] { display: none; }
.mr-reader .mr-h { font-family: var(--font-display, inherit); margin: 14px 0 6px; line-height: 1.25; }
.mr-reader h3.mr-h { font-size: 17px; }
.mr-reader h4.mr-h { font-size: 15px; }
.mr-reader .mr-h:first-child { margin-top: 0; }
.mr-reader .mr-p { margin: 0 0 10px; }

.mr-img { display: block; width: 100%; max-width: 100%; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.mr-img[hidden] { display: none; }

.mr-how { margin: 0 !important; }
.mr-steps { margin: 0; padding-left: 22px; line-height: 1.55; }
.mr-steps li { margin: 0 0 8px; padding-left: 4px; overflow-wrap: anywhere; }
.mr-steps li:last-child { margin-bottom: 0; }

.mr-coming { margin: 0 !important; padding: 14px 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); color: var(--text-muted); font-family: var(--font-mono); font-size: 13px; }

.mr-tablecard { margin: 0 !important; padding: 8px 12px !important; }
.mr-table { table-layout: auto; }
.mr-cap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mr-table th.mr-name { font-family: inherit; text-transform: none; letter-spacing: 0; font-size: 13.5px; font-weight: 700; color: var(--text); white-space: nowrap; }
.mr-table td.mr-line { color: var(--text-muted); line-height: 1.45; overflow-wrap: anywhere; }
.mr-table td.mr-status { white-space: nowrap; }

.mr-refused { margin: 0 !important; }
.mr-live { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Phone: each table row becomes a small stacked block — name and status on
   one line, the sentence under them — so nothing needs a sideways scroll. */
@media (max-width: 600px) {
  .mr-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .mr-table, .mr-table tbody { display: block; }
  .mr-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); }
  .mr-table tr:last-child { border-bottom: none; }
  .mr-table th.mr-name, .mr-table td { padding: 0 !important; border: none !important; }
  .mr-table th.mr-name { white-space: normal; }
  .mr-table td.mr-line { grid-column: 1 / -1; grid-row: 2; margin-top: 3px; font-size: 13px; }
  .mr-table td.mr-status { grid-column: 2; grid-row: 1; }
  .mr-actions .mr-btn { flex: 1 1 auto; }
}
