/* RMS styles (ported from KMS static/css/kms.css). Every colour comes from the theme's CSS variables
   (app/services/theme.py: the tenant's, or the platform's), which base.html writes into :root. */
:root {
  --bs-primary: var(--rms-primary);
  --bs-primary-rgb: var(--rms-primary-rgb);
  --bs-link-color: var(--rms-primary);
  --bs-link-color-rgb: var(--rms-primary-rgb);
  --bs-link-hover-color: var(--rms-primary-dark);
  --bs-focus-ring-color: rgba(var(--rms-primary-rgb), .25);
  --rms-sidebar-width: 264px;
}
body { background-color: var(--rms-page-bg); color: var(--rms-page-ink); }

.btn-primary {
  --bs-btn-bg: var(--rms-primary); --bs-btn-border-color: var(--rms-primary); --bs-btn-color: var(--rms-primary-ink);
  --bs-btn-hover-bg: var(--rms-primary-dark); --bs-btn-hover-border-color: var(--rms-primary-dark);
  --bs-btn-hover-color: var(--rms-primary-ink);
  --bs-btn-active-bg: var(--rms-primary-dark); --bs-btn-active-border-color: var(--rms-primary-dark);
  --bs-btn-disabled-bg: var(--rms-primary); --bs-btn-disabled-border-color: var(--rms-primary);
  --bs-btn-focus-shadow-rgb: var(--rms-primary-rgb);
}
.btn-outline-primary {
  --bs-btn-color: var(--rms-primary); --bs-btn-border-color: var(--rms-primary);
  --bs-btn-hover-bg: var(--rms-primary); --bs-btn-hover-border-color: var(--rms-primary);
  --bs-btn-hover-color: var(--rms-primary-ink);
  --bs-btn-active-bg: var(--rms-primary); --bs-btn-active-border-color: var(--rms-primary);
}
.btn-link { --bs-btn-color: var(--rms-primary); --bs-btn-hover-color: var(--rms-primary-dark); }
.pagination {
  --bs-pagination-color: var(--rms-primary); --bs-pagination-active-bg: var(--rms-primary);
  --bs-pagination-active-border-color: var(--rms-primary);
}
.nav-tabs .nav-link { color: var(--rms-primary); }
.nav-tabs .nav-link.active { border-top: 3px solid var(--rms-accent); font-weight: 600; color: var(--rms-page-ink); }
.nav-pills {    /* the active pill takes the theme's button colour (owner, 2026-10-19), not Bootstrap's blue */
  --bs-nav-pills-link-active-bg: var(--rms-primary); --bs-nav-pills-link-active-color: var(--rms-primary-ink);
}
.nav-tabs .nav-link.rms-tab-next:not(.active) { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); font-weight: 600; border-radius: .375rem .375rem 0 0; }
.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: rgba(var(--rms-primary-rgb), .55); box-shadow: 0 0 0 .25rem rgba(var(--rms-primary-rgb), .2);
}
.form-check-input:checked { background-color: var(--rms-primary); border-color: var(--rms-primary); }
.card { border-top: 3px solid var(--rms-accent) !important; }

/* ---------------------------------------------------------------- shell + main menu */
#app-shell { min-height: 100vh; }
.rms-sidebar {
  width: var(--rms-sidebar-width); min-width: var(--rms-sidebar-width);
  background: var(--rms-menu-bg); color: var(--rms-menu-ink);
  border-right: 4px solid var(--rms-active-bg);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  transition: margin-left .22s ease;
}
.rms-sidebar a, .rms-sidebar .nav-link, .rms-sidebar button { color: var(--rms-menu-ink); }
.rms-sidebar .rms-muted { color: var(--rms-menu-ink); opacity: .78; }
.rms-sidebar hr { border-color: currentColor; opacity: .3; }
.rms-sidebar .nav-link { border-radius: .375rem; padding: .4rem .65rem; }
.rms-sidebar .nav-link:not(.active):hover { background: var(--rms-menu-hover); }
.rms-sidebar .rms-nav-heading { cursor: default; font-weight: 600; opacity: .9; }
.rms-sidebar .rms-nav-heading:hover { background: none !important; }
.rms-sidebar .nav-link.active { background: var(--rms-active-bg); color: var(--rms-active-ink); font-weight: 600; }
.rms-sidebar .rms-group-toggle .bi-chevron-down { transition: transform .15s ease; }
.rms-sidebar .rms-group-toggle.collapsed .bi-chevron-down { transform: rotate(-90deg); }
.rms-brand { font-weight: 700; letter-spacing: .02em; }
.rms-logout button { background: none; border: 0; padding: 0; }

/* Sliding main menu (CMS): hide with the « button, Ctrl+\ or [; remembered in this browser. */
.rms-nav-hide { border: 0; padding: .1rem .35rem; line-height: 1; background: transparent; }
.rms-nav-hide:hover, .rms-nav-hide:focus-visible { background: var(--rms-menu-hover); }
.rms-nav-show { display: none; position: fixed; top: .75rem; left: 0; z-index: 1031; padding: .3rem .55rem;
  background: var(--rms-menu-bg); color: var(--rms-menu-ink); border: 0; border-radius: 0 .5rem .5rem 0;
  border-right: 3px solid var(--rms-active-bg); box-shadow: 0 .25rem .75rem rgba(0,0,0,.15); font-size: 1.15rem;
  line-height: 1; }
.rms-nav-show:hover, .rms-nav-show:focus-visible { background: var(--rms-menu-hover); color: var(--rms-menu-ink); }
html.rms-nav-collapsed .rms-sidebar { margin-left: calc(-1 * var(--rms-sidebar-width)); visibility: hidden;
  transition: margin-left .22s ease, visibility 0s .22s; }
html.rms-nav-collapsed .rms-nav-show { display: block; }
html.rms-nav-collapsed .rms-main > .container-fluid { padding-left: 3.5rem !important; }
@media print { .rms-sidebar, .rms-nav-show, .rms-help-fab { display: none !important; } }

.rms-main { min-width: 0; }
.rms-page-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem;
  flex-wrap: wrap; }
.rms-page-header h1 .bi { color: var(--rms-primary); }
.rms-help-fab { position: fixed; top: .6rem; right: .75rem; width: 2rem; height: 2rem; padding: 0; font-size: 1rem;
  z-index: 1030; }
/* room on the right so the Help button never covers a page's own buttons */
.rms-main > .container-fluid { padding-right: 3.25rem !important; }
.rms-kv dt { font-weight: 500; color: var(--bs-secondary-color); }
.rms-placeholder { max-width: 560px; margin: 4rem auto; text-align: center; }
.rms-phrase .badge { font-size: .95rem; font-weight: 500; }

/* ---------------------------------------------------------------- login pages */
.rms-auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  background: linear-gradient(135deg, var(--rms-menu-bg), var(--rms-active-bg)); }
.rms-auth-card { width: 100%; max-width: 440px; border-top: 4px solid var(--rms-accent) !important; }

/* ---------------------------------------------------------------- theme screen */
.rms-swatch { display: inline-block; width: 2.25rem; height: 2.25rem; border-radius: .4rem;
  border: 1px solid rgba(0,0,0,.15); vertical-align: middle; }
.rms-swatch-lg { width: 100%; height: 3.5rem; }
.rms-theme-preview { border: 1px solid rgba(0,0,0,.12); border-radius: .5rem; overflow: hidden; display: flex;
  min-height: 150px; }
.rms-theme-preview .pv-menu { width: 34%; padding: .75rem; }
.rms-theme-preview .pv-item { border-radius: .3rem; padding: .25rem .5rem; margin-bottom: .25rem; font-size: .85rem; }
.rms-theme-preview .pv-page { flex: 1; padding: .75rem; }
.rms-theme-preview .pv-btn { display: inline-block; border-radius: .3rem; padding: .25rem .65rem; font-size: .85rem; }

code { color: var(--rms-primary-dark); }

/* Small screens: the menu floats over the page instead of squeezing it, and starts hidden (base.html). */
@media (max-width: 767.98px) {
  .rms-sidebar { position: fixed; left: 0; top: 0; z-index: 1040; box-shadow: 0 0 1.5rem rgba(0,0,0,.25); }
  .rms-main > .container-fluid { padding-left: 3.5rem !important; padding-right: 1rem !important; }
}

/* Confirm dialog (replaces the browser's own confirm box; app.js rmsConfirm). Theme colours; red for removals. */
.rms-confirm { --rms-confirm-rgb: var(--rms-primary-rgb); }
.rms-confirm.is-danger { --rms-confirm-rgb: var(--bs-danger-rgb); }
.rms-confirm .modal-dialog { max-width: 440px; }
.rms-confirm .modal-content { border: 0; border-top: 4px solid rgb(var(--rms-confirm-rgb)); border-radius: .85rem;
  overflow: hidden; box-shadow: 0 1.25rem 3rem rgba(15, 23, 42, .28), 0 .25rem .75rem rgba(15, 23, 42, .12); }
.rms-confirm .modal-body { display: flex; gap: 1rem; align-items: flex-start; padding: 1.5rem 1.5rem 1.25rem; }
.rms-confirm-icon { flex: 0 0 auto; width: 2.75rem; height: 2.75rem; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 1.35rem; color: rgb(var(--rms-confirm-rgb));
  background: rgba(var(--rms-confirm-rgb), .12); box-shadow: 0 0 0 6px rgba(var(--rms-confirm-rgb), .06); }
.rms-confirm-copy { min-width: 0; padding-top: .15rem; }
.rms-confirm-title { font-size: 1.08rem; font-weight: 600; line-height: 1.35; margin: 0; overflow-wrap: anywhere; }
.rms-confirm-text { margin: .4rem 0 0; color: var(--bs-secondary-color); overflow-wrap: anywhere; white-space: pre-line; }
.rms-confirm .modal-footer { border-top: 1px solid var(--bs-border-color-translucent); background: var(--bs-tertiary-bg);
  padding: .75rem 1.25rem; gap: .5rem; }
.rms-confirm .modal-footer > .btn { margin: 0; min-width: 6.5rem; font-weight: 500; white-space: nowrap; }
.rms-confirm .rms-confirm-cancel { border: 1px solid var(--bs-border-color); }
.rms-confirm.fade .modal-dialog { transform: translateY(.5rem) scale(.97); transition: transform .18s ease-out; }
.rms-confirm.show .modal-dialog { transform: none; }
body:has(.rms-confirm.show) .modal-backdrop.show { opacity: .4; }
@supports (backdrop-filter: blur(2px)) { body:has(.rms-confirm.show) .modal-backdrop { backdrop-filter: blur(2px); } }
@media (max-width: 575.98px) { .rms-confirm .modal-footer > .btn { flex: 1 1 0; } }

/* longer tooltips read better a little wider, left-aligned */
.tooltip-inner { max-width: 320px; text-align: left; }
/* Page code at the foot of every page (decision 117): light, small, out of the way. */
.rms-page-code { display: flex; flex-wrap: wrap; gap: 1rem; padding: .25rem 1.5rem 1rem; font-size: .72rem;
  color: var(--bs-secondary-color); opacity: .75; }
.rms-page-code a { color: inherit; }
.rms-page-code-btn { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: copy; }
.rms-page-code-btn.copied::after { content: " · copied"; }
.rms-auth-wrap + .rms-page-code { position: fixed; left: 0; bottom: 0; color: var(--rms-menu-ink); }
@media print { .rms-page-code { opacity: 1; } }


/* Menu items of later phases: readable, a little lighter than built ones. */
.rms-sidebar .nav-link.rms-stub:not(.active) { opacity: .82; }
.rms-placeholder-icon { color: var(--rms-primary); opacity: .8; }
.rms-auth-icon { color: var(--rms-primary); }

/* Tenant dashboard: welcome card and module tiles */
.rms-welcome { border-top-width: 4px !important; }
.rms-welcome-kicker { color: var(--rms-primary); font-weight: 600; letter-spacing: .04em; }
.rms-stat { background: var(--rms-page-bg); border-radius: .5rem; padding: .65rem .5rem; height: 100%; }
.rms-stat-label { font-size: .75rem; color: var(--bs-secondary-color); }
.rms-stat-value { font-size: 1.15rem; font-weight: 600; overflow-wrap: anywhere; }
.rms-stat-small { font-size: .95rem; }
.rms-tile { color: inherit; transition: transform .12s ease, box-shadow .12s ease; }
.rms-tile:hover, .rms-tile:focus-visible { transform: translateY(-2px); box-shadow: 0 .5rem 1rem rgba(0,0,0,.08) !important; }
.rms-tile-icon { flex: 0 0 auto; width: 2.5rem; height: 2.5rem; border-radius: .6rem; display: flex; align-items: center;
  justify-content: center; font-size: 1.25rem; background: var(--rms-menu-bg); color: var(--rms-menu-ink); }
.rms-tile-title { color: var(--rms-page-ink); }
.rms-badge-phase { background: var(--rms-accent); color: var(--rms-page-ink); font-weight: 500; }
.rms-badge-live { background: var(--rms-primary); color: var(--rms-primary-ink); font-weight: 500; }
.min-w-0 { min-width: 0; }

/* Phase 1b: logo, lookups, swatches, tabs and record pages */
.rms-logo-box { background: rgba(255,255,255,.92); border-radius: .5rem; padding: .4rem; text-align: center; }
.rms-logo { max-width: 100%; max-height: 64px; object-fit: contain; }
.rms-logo-preview { max-height: 96px; max-width: 240px; object-fit: contain; border: 1px solid var(--bs-border-color);
  border-radius: .4rem; padding: .35rem; background: #fff; }
.rms-nested { color: var(--rms-primary); }
.rms-nested-badge { background: var(--rms-accent); color: var(--rms-page-ink); font-weight: 500; margin-left: .35rem; }
.rms-lookup-group { font-size: 1.05rem; font-weight: 600; color: var(--rms-primary); margin: 1.25rem 0 .5rem; }
.rms-geo .list-group-item { cursor: pointer; }
.rms-contrast-ok { color: var(--bs-success-text-emphasis); }
.rms-contrast-bad { color: var(--bs-danger-text-emphasis); font-weight: 600; }
.rms-sample { display: inline-block; padding: .15rem .5rem; border-radius: .3rem; font-size: .85rem; border: 1px solid rgba(0,0,0,.1); }
.rms-rights-module { background: var(--bs-tertiary-bg); }
.rms-preview-row-error td { background: var(--bs-danger-bg-subtle) !important; }
.rms-preview-row-skip td { color: var(--bs-secondary-color); }
.rms-mono { font-family: var(--bs-font-monospace); }
.rms-kpi { background: var(--rms-page-bg); border-radius: .5rem; padding: .6rem .75rem; }
.rms-kpi-label { font-size: .75rem; color: var(--bs-secondary-color); }
.rms-kpi-value { font-size: 1.1rem; font-weight: 600; }

/* Rooms Management (Phase 1c) */
.rms-code-chip { display: inline-block; font-family: var(--bs-font-monospace); font-size: .75rem; font-weight: 600;
  padding: .1rem .45rem; border-radius: .35rem; background: rgba(var(--rms-primary-rgb, 13, 110, 253), .1);
  color: var(--rms-primary); vertical-align: middle; letter-spacing: .03em; }
.rms-rooms-subnav .nav-link { color: var(--bs-body-color); border: 1px solid var(--bs-border-color); margin-right: .35rem; }
.rms-rooms-subnav .nav-link.active { background: var(--rms-primary); color: var(--rms-primary-ink, #fff); border-color: var(--rms-primary); }
.rms-unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .75rem; }
.rms-unit { background: #fff; border-radius: .5rem; padding: .75rem .9rem; box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);
  border-left: 4px solid var(--bs-border-color); }
.rms-unit.is-taken { border-left-color: var(--rms-primary); }
.rms-unit.is-free { border-left-color: var(--rms-accent, #d9b26f); border-left-style: dashed; }
.rms-unit.is-inactive { opacity: .6; }
.rms-unit-code { font-family: var(--bs-font-monospace); font-weight: 600; }
/* Rooms Assignment (R38): the drill-down columns, unit list and panel */
.rms-assign-steps .rms-assign-step { padding: .25rem .65rem .25rem .3rem; border-radius: 1rem; border: 1px solid var(--bs-border-color);
  background: #fff; color: var(--bs-secondary-color); }
.rms-assign-step.is-done { color: var(--bs-body-color); border-color: var(--rms-primary); }
.rms-assign-step.is-current { color: var(--rms-primary); border-style: dashed; border-color: var(--rms-primary); }
.rms-assign-col .list-group { max-height: 22rem; overflow-y: auto; }
.rms-assign-col .list-group-item.active { background: var(--rms-primary); border-color: var(--rms-primary); color: var(--rms-primary-ink, #fff); }
.rms-assign-col .list-group-item.active .rms-code-chip { background: rgba(255, 255, 255, .2); color: inherit; }
.rms-count { opacity: .7; white-space: nowrap; }
.rms-assign-unit { border-left: 4px solid transparent; }
.rms-assign-unit.is-taken { border-left-color: var(--rms-primary); }
.rms-assign-unit.is-free { border-left-color: var(--rms-accent, #d9b26f); }
.rms-assign-panel { border-top: 3px solid var(--rms-primary) !important; }
.rms-carousel { border-radius: .5rem; overflow: hidden; background: #1b1f23; }
.rms-carousel .carousel-item img { height: 26rem; object-fit: contain; background: #1b1f23; }
.rms-carousel .carousel-caption span { background: rgba(0, 0, 0, .55); padding: .2rem .6rem; border-radius: .3rem; }
.rms-carousel-empty { height: 16rem; border: 2px dashed var(--bs-border-color); border-radius: .5rem; display: flex;
  flex-direction: column; align-items: center; justify-content: center; color: var(--bs-secondary-color); }
.rms-thumb { width: 4.5rem; height: 4.5rem; object-fit: cover; border-radius: .35rem; flex-shrink: 0; }
.rms-step { display: inline-flex; width: 1.4rem; height: 1.4rem; border-radius: 50%; align-items: center; justify-content: center;
  background: var(--rms-primary); color: var(--rms-primary-ink, #fff); font-size: .75rem; margin-right: .35rem; }
.rms-feature.is-override .form-check-label { font-weight: 600; }
/* Customer Management (Phase 1c) */
.rms-badge-vip { background: #b8860b; color: #fff; font-weight: 500; }
.rms-row-blacklisted { box-shadow: inset 4px 0 0 var(--bs-danger); }
.rms-row-blacklisted td:first-child a { color: var(--bs-danger); }
.rms-avatar { width: 3.25rem; height: 3.25rem; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 2px solid var(--bs-border-color); }
.rms-avatar-empty { width: 3.25rem; height: 3.25rem; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); font-size: 1.4rem; flex-shrink: 0; }
.rms-masked { font-family: var(--bs-font-monospace); letter-spacing: .08em; }
.rms-revealed { font-family: var(--bs-font-monospace); background: #fff3cd; padding: .1rem .4rem; border-radius: .25rem; }
.rms-compare th { width: 11rem; }
.rms-compare td.is-filled { background: var(--bs-success-bg-subtle); }
.rms-compare td.is-kept { font-weight: 500; }
.rms-pref-group { break-inside: avoid; }
.rms-pref-cols { columns: 2 16rem; column-gap: 1.5rem; }
/* Comments and the Chart of Accounts (Phase 1c) */
.rms-acct-type { font-weight: 500; }
.rms-acct-asset { background: #dbe8f8; color: #1d4f91; }
.rms-acct-liability { background: #fbe5cf; color: #8a4b08; }
.rms-acct-equity { background: #e8def6; color: #5b3a8c; }
.rms-acct-revenue { background: #d6f0df; color: #1d6b3a; }
.rms-acct-expense { background: #f8dcdc; color: #9b2c2c; }
.rms-acct-tree .rms-acct-header td { background: var(--bs-tertiary-bg); }
.rms-acct-tree .rms-acct-toggle { width: 1rem; line-height: 1; text-decoration: none; }
.rms-comment-menu { min-width: 22rem; max-width: 32rem; }
.rms-comment-list { max-height: 18rem; overflow-y: auto; }
.rms-comment-cat { background: var(--bs-secondary-bg); color: var(--bs-body-color); font-weight: 500; }
.rms-comment-cat-warning { background: #f8dcdc; color: #9b2c2c; }
.rms-comment-cat-caution { background: #fbe5cf; color: #8a4b08; }
.rms-comment-cat-notice { background: #dbe8f8; color: #1d4f91; }
.rms-comment-cat-reminder { background: #d6f0df; color: #1d6b3a; }
.rms-print-table td, .rms-print-table th { padding-top: .2rem; padding-bottom: .2rem; }
@media print {
  .rms-print-sheet { font-size: 10pt; }
  .rms-print-table tr { break-inside: avoid; }
  .rms-main .container-fluid { padding: 0 !important; }
}
/* Transaction documents (Phase 1d) */
.rms-doc-lines .rms-line-comment td { background: var(--bs-tertiary-bg); }
.rms-doc-lines .rms-line-discount td { color: #9b2c2c; }
.rms-party-menu { max-height: 16rem; overflow-y: auto; }
.rms-reason-form .form-control { min-width: 9rem; }
.rms-grid-wrap { max-height: 70vh; }
.rms-occupancy { table-layout: fixed; }
.rms-occupancy .rms-grid-room { width: 12rem; position: sticky; left: 0; background: var(--bs-body-bg); z-index: 1; }
.rms-occupancy thead .rms-grid-room { background: var(--bs-tertiary-bg); }
.rms-occupancy .rms-grid-day { width: 3.4rem; font-size: .75rem; }
.rms-occupancy .rms-grid-cell { padding: .15rem .1rem; text-align: center; font-size: .7rem; height: 2rem; }
.rms-occupancy .rms-grid-cell a { color: inherit; text-decoration: none; display: block; font-family: var(--bs-font-monospace); }
.rms-grid-today { box-shadow: inset 0 0 0 2px rgba(var(--rms-primary-rgb), .35); }
.rms-grid-enquiry { background: #e9ecef; color: #495057; }
.rms-grid-provisional { background: #cff4fc; color: #055160; }
.rms-grid-confirmed { background: #cfe2ff; color: #084298; }
.rms-grid-checked_in { background: #d1e7dd; color: #0f5132; }
.rms-grid-checked_out { background: #dee2e6; color: #343a40; }
.rms-grid-event { background: #f3d9fa; color: #6a1b9a; }
.rms-grid-key { display: inline-block; width: 1rem; height: .8rem; border-radius: 2px; vertical-align: middle; border: 1px solid rgba(0,0,0,.1); }
.rms-ticket-qty { width: 5.5rem; }

/* Maintenance & Upkeep (Phase 1f): housekeeping board tiles and the Gantt chart */
.rms-hk-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: .6rem; }
.rms-hk-room { border-left: .35rem solid var(--bs-secondary) !important; }
.rms-hk-dirty { border-left-color: var(--bs-danger) !important; background: rgba(220, 53, 69, .04); }
.rms-hk-clean { border-left-color: var(--bs-primary) !important; }
.rms-hk-inspected { border-left-color: var(--bs-success) !important; background: rgba(25, 135, 84, .04); }
.rms-hk-out_of_order { border-left-color: var(--bs-dark) !important; background: rgba(33, 37, 41, .06); }
.rms-gantt-wrap { overflow-x: auto; max-width: 100%; }
.rms-gantt { display: block; font-family: system-ui, sans-serif; }
.rms-gantt-key { display: inline-block; width: 1.2rem; height: .7rem; border-radius: 2px; vertical-align: middle; margin-right: .2rem; }
@media print { .rms-hk-board { grid-template-columns: repeat(4, 1fr); } }

/* Content Catalogue and the AI run panel (Phase 1i, ported from KMS kms.css) */
.rms-notes { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.rms-original-frame { height: 75vh; min-height: 420px; background: #fff; }
.rms-doc-text { max-height: 360px; overflow: auto; white-space: pre-wrap; }
.rms-doc-text-full { white-space: pre-wrap; overflow-wrap: anywhere; }
.rms-chat-msg { padding: .6rem .75rem; border-left: 3px solid var(--bs-border-color); border-radius: .25rem; margin-bottom: .6rem; background: #fff; }
.rms-chat-msg.mine { border-left-color: var(--rms-accent); background: var(--bs-tertiary-bg); }
.rms-chat-msg.reply { margin-left: 1.5rem; }
.rms-chat-current { border-left: 3px solid var(--rms-accent); background: var(--bs-tertiary-bg); }
.rms-chat-msg:target { box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .25); }
.rms-sticky-actions { position: sticky; bottom: 0; background: var(--bs-body-bg); border-top: 1px solid var(--bs-border-color); z-index: 5; }
.rms-doc-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.rms-doc-tabs .nav-link { padding: .4rem .7rem; font-size: .95rem; white-space: nowrap; }
.rms-doc-tabs .nav-link .badge { font-weight: 500; }
.rms-doc-tabpanes > .tab-pane > .card,
.rms-doc-tabpanes > .tab-pane > div > .card { border-top-left-radius: 0; border-top-right-radius: 0; }
.rms-stats td:first-child { color: var(--bs-secondary-color); }
.rms-stats td { padding-left: .75rem; padding-right: .75rem; }
.rms-tabbed { border-top-left-radius: 0; }
.rms-view-tabs { border-bottom: 0; }
.rms-view-tabs .nav-link.active { background: var(--bs-body-bg); }
.rms-run-panel { position: fixed; right: .75rem; bottom: .75rem; width: 22rem; max-width: calc(100vw - 1.5rem); z-index: 1040; }
.rms-run-panel [data-rp="list"] { max-height: 50vh; overflow-y: auto; }
.rms-run-panel-item + .rms-run-panel-item { border-top: 1px solid var(--bs-border-color); padding-top: .4rem; margin-top: .4rem; }
@media print { .rms-run-panel { display: none !important; } }
/* Creative Media (Phase 1i part B, from CGN) */
.rms-chat-list { max-height: 62vh; overflow-y: auto; }
.rms-tip { cursor: help; color: var(--bs-secondary-color); }
/* v0.28 — mobile photo / video ingestion (R262–R264): videos in albums, the phone upload page, Uploaded Files */
.rms-carousel .carousel-item video { height: 26rem; object-fit: contain; background: #1b1f23; }
.rms-thumb-video { position: relative; display: inline-block; flex-shrink: 0; align-self: flex-start; line-height: 0; }
.rms-thumb-video > .bi-play-circle-fill { position: absolute; right: .2rem; bottom: .1rem; color: #fff;
  text-shadow: 0 0 4px rgba(0, 0, 0, .7); font-size: 1.1rem; }
.rms-mm-big { min-height: 3.5rem; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; gap: .5rem; }
.rms-mm-pick { position: relative; overflow: hidden; }
.rms-mm-pick input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.rms-mm-file { border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: .6rem; background: var(--bs-body-bg); }
.rms-mm-file.is-error { border-color: var(--bs-danger); }
.rms-mm-file.is-done { border-color: var(--bs-success); }
.rms-mm-file.is-duplicate { border-color: var(--bs-warning); background: var(--bs-warning-bg-subtle); }
.rms-mm-thumb { width: 4.5rem; height: 4.5rem; object-fit: cover; border-radius: .35rem; background: #263238;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #cfd8dc; font-size: 1.6rem; }
.rms-mm-file .progress { height: .6rem; }
.rms-mm-file.is-waiting { border-color: var(--bs-warning); }
.rms-mm-link { min-height: 2.25rem; text-decoration: none; font-size: .875rem; }   /* v0.30: Save to phone / Discard */
.rms-mm-banner { position: sticky; top: .5rem; z-index: 5; }
.rms-mm-file input.form-control { min-height: 2.5rem; }
.rms-mm-cta { border-left: 4px solid var(--rms-primary); }
.rms-inbox-thumb { width: 6rem; height: 6rem; object-fit: cover; border-radius: .35rem; background: #263238; }
.rms-inbox-card .form-check-input { width: 1.4rem; height: 1.4rem; }
.rms-ai-proposal { border-left: 3px solid var(--bs-info); padding-left: .5rem; }
@media (max-width: 575.98px) {
  .rms-mm-actions .btn { width: 100%; }
}

/* ---------------------------------------------------------------- Media Uploader's stripped layout (v0.29, R278) */
.rms-upbar { background: var(--rms-menu-bg); color: var(--rms-menu-ink); border-bottom: 4px solid var(--rms-active-bg); }
.rms-upbar a, .rms-upbar button { color: var(--rms-menu-ink); }
.rms-upbar .rms-logout button { background: none; border: 0; padding: 0; font: inherit; }
.rms-upbar-link { display: inline-flex; align-items: center; padding: .45rem .8rem; border-radius: .375rem;
  text-decoration: none; min-height: 2.5rem; }
.rms-upbar-link:not(.active):hover { background: var(--rms-menu-hover); }
.rms-upbar-link.active { background: var(--rms-active-bg); color: var(--rms-active-ink) !important; font-weight: 600; }
body.rms-uploader .rms-main > .container-fluid { padding-left: 1.5rem !important; padding-right: 1.5rem !important;
  max-width: 1100px; margin: 0 auto; }
@media (max-width: 767.98px) {
  .rms-upbar-nav { width: 100%; }
  .rms-upbar-nav .rms-upbar-link { flex: 1 1 0; justify-content: center; white-space: nowrap; padding: .4rem .5rem;
    font-size: .95rem; }
  body.rms-uploader .rms-main > .container-fluid { padding-left: 1rem !important; padding-right: 1rem !important; }
}
/* v0.31 — albums: Download on the carousel and the cards, the bulk bar, a project album grouped by task (R296–R303) */
.rms-carousel .rms-carousel-dl { position: absolute; top: .6rem; right: .6rem; z-index: 3; opacity: .9; }
.rms-carousel .rms-carousel-dl:hover, .rms-carousel .rms-carousel-dl:focus { opacity: 1; }
.rms-album-bulk { position: sticky; top: .5rem; z-index: 5; }
.rms-task-group > h3 a:hover { text-decoration: underline !important; }
.rms-task-strip { display: flex; flex-wrap: wrap; gap: .5rem; }
.rms-task-strip .rms-thumb { width: 6rem; height: 6rem; }
.rms-task-add { width: auto; max-width: 13rem; font-size: .8rem; }
.rms-task-chip { white-space: normal; text-align: left; font-size: .8rem; }
