/* Royal Contraste — private application chrome only. PDF templates are unchanged. */
@media screen {
  body:has(:is(.royal-team,.architect-app,.cab-page,.royal-community,.admin,.royal-workspace-shell,.ei-owner-layout)),body.royal-compact {
    --royal-ivory:#f5f0e9;--royal-paper:#fff;--royal-sand:#eae2d9;
    --royal-border-warm:#d5c9bf;--royal-charcoal:#282321;--royal-earth:#61564f;
    --royal-burgundy:#722636;--royal-burgundy-hover:#59202c;--royal-rose:#f4e8eb;
    --signature-wine:#722636;--signature-active:#914252;
    --rs-bg:#f5f0e9;--rs-paper:#fff;--rs-ink:#282321;--rs-muted:#61564f;--rs-line:#d5c9bf;--rs-gold:#722636;
    background:#f5f0e9!important;color:#282321!important;
  }
  :is(body.royal-compact,.royal-team,.architect-app,.cab-page,.royal-community,.admin,.ei-owner-layout) {
    font-family:'Segoe UI',Arial,sans-serif;
  }
  :is(.royal-team,.architect-app,.cab-page,.royal-community,.ei-owner-layout) {background:#f5f0e9!important;color:#282321;}
  :is(.royal-topbar,.architect-topbar,.rt-top,.cab-top,.comm-top) {
    background:#fff!important;border-bottom:1px solid #d5c9bf!important;
  }
  .royal-compact .royal-topbar {margin-inline:-24px;padding-inline:24px;background:#fff!important;}
  :is(.royal-primarybar,.rt-nav,.rc-rail,.cab-primary-nav,.architect-sidebar,.ei-navigation) {
    background:#722636!important;box-shadow:3px 0 14px #34201e0a;
  }
  :is(.royal-primarybar>nav,.rt-nav nav,.rc-rail nav,.cab-primary-nav,.architect-sidebar nav,.ei-navigation nav) :is(a,button) {
    color:#fff8f3!important;
  }
  :is(.royal-primarybar>nav,.rt-nav nav,.rc-rail nav,.cab-primary-nav,.architect-sidebar nav,.ei-navigation nav) :is(a,button):is(.active,[aria-current=page]) {
    background:#914252!important;color:#fff!important;box-shadow:inset 3px 0 #e8ca93;
  }
  :is(.royal-primarybar>nav,.rt-nav nav,.rc-rail nav,.cab-primary-nav,.architect-sidebar nav,.ei-navigation nav) :is(a,button):hover {
    background:#863b4b!important;
  }
  .architect-sidebar :is(.architect-brand,.architect-space-label,.architect-sidebar-bottom a) {color:#fff8f3!important;}
  :is(.royal-team,.architect-app,.cab-page,.royal-community,.admin,.ei-owner-layout) :is(h1,h2,h3),
  .royal-compact #app :is(.rd-heading,.royal-dashboard-head,.project-module>header,.panel:not(.royal-devis)) :is(h1,h2,h3) {
    color:#282321;font-family:'Segoe UI',Arial,sans-serif;letter-spacing:-.4px;
  }
  .royal-compact #app :is(.rd-heading,.royal-dashboard-head,.project-module>header) h1 {font-size:26px!important;font-weight:650;}
  .royal-compact #app:has(.rde-workspace)>header {margin:16px 0 20px;padding-bottom:14px;border-bottom:1px solid #d5c9bf;}
  .royal-compact #app:has(.rde-workspace)>header h1 {font:650 26px/1.3 'Segoe UI',Arial,sans-serif;color:#282321;margin:4px 0;}
  .royal-compact #app :is(.panel:not(.royal-devis),.project-module) h2 {font-size:18px;line-height:1.35;}
  .royal-compact #app>.panel,
  .royal-compact #app :is(.royal-kpi,.royal-dashboard-card,.project-list-table-wrap,.rd-list,.rd-context,.royal-maintenance-panel),
  .royal-team :is(.rt-card,.rtm-frame),.architect-app :is(.architect-section,.architect-profile-card),
  .cab-page :is(.cab-company,.cab-panel),.royal-community :is(.comm-panel,.comm-post),.admin>section {
    background:#fff!important;border:1px solid #d5c9bf!important;border-radius:9px;
    box-shadow:0 2px 6px #38251d05;
  }
  .royal-compact #app>.panel {padding:18px;}
  .royal-compact #app :is(.royal-recent-panel,.royal-context-panel,.sav-table-wrap,.sav-side) {
    background:#fff!important;border:1px solid #d5c9bf!important;border-radius:9px;box-shadow:0 2px 6px #38251d05;
  }
  .royal-compact #app .royal-kpi-strip {background:transparent!important;border:0;gap:12px;}
  .royal-compact #app .royal-kpi-strip>div {background:#fff;border:1px solid #d5c9bf;border-radius:8px;padding:17px;}
  .royal-compact #app .royal-kpi-strip :is(strong,small) {color:#282321;}
  .royal-compact #app .royal-kpi-strip svg {color:#722636;}
  .royal-compact #app :is(.royal-documents-table,.sav-table) th {background:#eae2d9;color:#51443e;border-color:#cfc1b6;}
  .royal-compact #app :is(.royal-documents-table,.sav-table) td {border-color:#e5dbd2;}
  .royal-compact #app .royal-panel-heading {border-bottom:1px solid #d5c9bf;}
  .royal-compact #app .sav-stats {background:transparent;border:0;padding:0;}
  .royal-compact #app .sav-stats button {border-color:#d5c9bf;background:#fff;color:#282321;}
  .royal-compact #app .sav-tabs button[aria-current=page] {background:#fff;border-bottom-color:#722636;color:#722636;}
  .royal-compact #app :is(input:not([type=checkbox]):not([type=radio]),select,textarea):not(.royal-devis *) {
    border-color:#bbaeA4;background:#fff;color:#282321;
  }
  :is(.royal-team,.architect-app,.cab-page,.admin) :is(input:not([type=checkbox]):not([type=radio]),select,textarea) {
    border-color:#bbaea4;background:#fff;color:#282321;
  }
  :is(.royal-compact #app,.royal-team,.architect-app,.cab-page,.admin) :is(input,textarea)::placeholder {color:#71665e;opacity:1;}
  :is(.royal-compact #app,.royal-team,.architect-app,.cab-page,.admin) :is(button,a,input,select,textarea,summary):focus-visible {
    outline:2px solid #722636!important;outline-offset:3px;
  }
  :is(.royal-compact #app,.royal-team,.architect-app,.cab-page,.admin) :is(button.primary,.architect-primary,.rt-primary) {
    background:#722636!important;color:#fff!important;border-color:#722636!important;
  }
  :is(.royal-compact #app,.royal-team,.architect-app,.cab-page,.admin) :is(button.primary,.architect-primary,.rt-primary):hover {background:#59202c!important;}
  :is(.royal-compact #app,.royal-team,.architect-app,.cab-page,.admin) button:disabled {cursor:not-allowed;}
  .royal-compact #app>.cards>.card {background:#fff!important;border:1px solid #d5c9bf;box-shadow:0 2px 6px #38251d05;border-top:3px solid #722636;}
  .royal-compact #app>.cards>.card :is(strong,small) {color:#282321!important;}
  .ei-owner-layout .ei-section {background:#fff;border:1px solid #d5c9bf;border-radius:9px;padding:22px;margin-bottom:18px;}
  /* Status cards, filters and rows have distinct surfaces. */
  .royal-compact #app .rd-summary {background:transparent!important;border:0;padding:0;gap:10px;overflow:visible;}
  .royal-compact #app .rd-summary>button {border:1px solid #d5c9bf;border-radius:8px;background:#fff!important;padding:12px 15px;min-height:62px;color:#51443e;}
  .royal-compact #app .rd-summary>button[aria-pressed=true] {border-color:#722636;background:#f4e8eb!important;box-shadow:inset 0 -3px #722636;}
  .royal-compact #app .rd-summary strong {font-size:23px;}
  .royal-compact #app .rd-filters {background:#eae2d9;border:1px solid #d5c9bf;padding:12px;border-radius:8px;gap:10px;margin-bottom:14px;}
  .royal-compact #app .rd-filters label {font-size:12px!important;font-weight:600;color:#51443e;}
  .royal-compact #app .rd-filters :is(input,select) {height:36px;min-height:36px;}
  .royal-compact #app .rd-filters>button {height:36px;background:white;border:1px solid #bbaea4;color:#51443e;}
  .royal-compact #app :is(.rd-tabs,.royal-module-subnav) {gap:4px;border-bottom:1px solid #cfc1b6;}
  .royal-compact #app :is(.rd-tabs,.royal-module-subnav)>button {color:#61564f;background:transparent;}
  .royal-compact #app :is(.rd-tabs,.royal-module-subnav)>button[aria-current=page] {background:#fff;color:#722636;font-weight:700;border-bottom:3px solid #722636;}
  .royal-compact #app :is(.rd-table,.project-list-table) {background:#fff;}
  .royal-compact #app :is(.rd-table,.project-list-table) th {background:#eae2d9!important;color:#51443e;font-size:12px;font-weight:650;border-bottom:1px solid #cfc1b6;padding:10px 12px;}
  .royal-compact #app :is(.rd-table,.project-list-table) td {color:#282321;font-size:13px;padding:11px 12px;line-height:1.45;border-bottom:1px solid #e5dbd2;}
  .royal-compact #app :is(.rd-table,.project-list-table) tbody tr:hover {background:#faf5ef;}
  .royal-compact #app .rd-table tr.is-selected {background:#f6eaed;}
  .royal-compact #app .rd-table tr.is-selected:hover {background:#f0e0e5;}
  .royal-compact #app .rd-table td>small {color:#61564f;font-size:12px;}
  .royal-compact #app .rd-select {font-weight:650;color:#282321;}
  .royal-compact #app .rd-status {font-weight:600;border:1px solid #d5d8dc;}
  .royal-compact #app .rd-status[data-rd-status=Accepté],.royal-compact #app .rd-status[data-rd-status=Payée] {border-color:#b8d6c6;}
  .royal-compact #app .rd-status[data-rd-status=Refusé] {border-color:#e2b8b9;}
  .royal-compact #app .rd-pagination {padding:12px;color:#61564f;}
  .rd-details>summary {color:#722636;background:#fff;border-radius:8px;}
  .rd-details .rd-detail-body {background:#fff;}
  /* Chantier Espaces: progress first, small photo tiles and clearly framed modules. */
  .royal-compact .royal-ivory-project {--project-ink:#282321;--project-muted:#61564f;--project-line:#d5c9bf;--project-ivory:#fff;--project-sand:#eae2d9;--project-burgundy:#722636;}
  .royal-compact .royal-ivory-project .ivory-project-heading h1 {font-size:26px!important;font-family:'Segoe UI',Arial,sans-serif;}
  .royal-compact .royal-ivory-project .ivory-project-facts {background:#fff;border-color:#d5c9bf;border-top:3px solid #722636;box-shadow:0 2px 6px #38251d05;}
  .royal-compact .royal-ivory-project .ivory-project-facts dd {font:600 14px/1.5 'Segoe UI',Arial,sans-serif;}
  .royal-compact .royal-ivory-project .ivory-project-layout .panel {background:#fff!important;border:1px solid #d5c9bf!important;border-radius:9px;box-shadow:0 2px 6px #38251d05;}
  .royal-compact .royal-ivory-project .ivory-project-layout h2 {font:650 18px/1.4 'Segoe UI',Arial,sans-serif;margin-bottom:14px;}
  .royal-ivory-project .ivory-project-tabs {background:#eae2d9;border:1px solid #d5c9bf;border-radius:8px;padding:5px;gap:4px;}
  .royal-compact .royal-ivory-project .ivory-project-tabs button {border-radius:5px;min-height:36px;padding:8px 13px;color:#51443e;}
  .royal-compact .royal-ivory-project .ivory-project-tabs button[aria-pressed=true] {background:#fff;border-bottom-color:#722636;box-shadow:0 1px 3px #38251d12;}
  .royal-ivory-project .project-photo-grid {grid-template-columns:repeat(auto-fill,minmax(125px,1fr));gap:10px;}
  .royal-ivory-project .project-photo {background:#fff;border:1px solid #d5c9bf;border-radius:7px;overflow:hidden;}
  .royal-ivory-project .project-photo img {height:110px;object-fit:cover;}
  .royal-ivory-project .project-photo-uploader {background:#faf6f0;border:1px dashed #bbaea4;border-radius:7px;padding:12px;}
  .royal-ivory-project .project-compact-info {border-top:3px solid #722636!important;}
  .royal-ivory-project .rp-track {background:#eee7df;}
  .royal-ivory-project .project-details>div {border-bottom:1px solid #e5dbd2;padding-block:9px;}
  /* Team, invited accountant, architect and community use the same work surfaces. */
  .royal-team .rtm-history,.royal-team .rtm .rt-history,.royal-team .rtm .rt-typing {background:#f5f0e9;}
  .royal-team .rtm-list {background:#faf6f0;border-color:#d5c9bf;}
  .royal-team .rtm-conversation.selected {background:#f4e8eb;border-color:#cfabb5;}
  .royal-team .rtm-tabs button[aria-current=page] {color:#722636;border-bottom-color:#722636;}
  .royal-team .rtm .rt-bubble {background:#fff;border:1px solid #d5c9bf;color:#282321;}
  .royal-team .rtm .rt-bubble.mine {background:#f4e8eb;border-color:#d8b9c2;}
  .architect-app .architect-note,.royal-team .rt-muted,.cab-page .cab-muted {color:#61564f;}
  .architect-app .architect-section-heading {border-bottom:1px solid #e5dbd2;padding-bottom:14px;}
  /* Action editor: existing controls and handlers are moved, never duplicated. */
  .rde-workspace {display:grid;grid-template-columns:minmax(0,1fr) 250px;gap:20px;align-items:start;max-width:1370px;margin:0 auto 24px;}
  .rde-workspace>.rde-paper {grid-column:1;grid-row:1;width:100%;min-width:0;margin:0!important;box-shadow:0 3px 16px #38251d0b;}
  .rde-workspace>.rde-toolbar {grid-column:2;grid-row:1;display:flex;flex-direction:column;align-items:stretch;position:sticky;top:74px;z-index:40;width:100%;max-width:none;margin:0;padding:18px;gap:16px;background:#fff;border:1px solid #cfc1b6;box-shadow:0 3px 12px #38251d08;backdrop-filter:none;border-top:3px solid #722636;border-radius:9px;}
  .rde-workspace .rde-edit-hint strong {font:650 17px/1.4 'Segoe UI',Arial,sans-serif;color:#282321;}
  .rde-workspace .rde-edit-hint span {font:12px/1.6 'Segoe UI',Arial,sans-serif;color:#61564f;max-width:none;}
  .royal-compact #app .rde-workspace .rde-document-actions {display:flex;flex-direction:column;align-items:stretch;gap:9px;margin:0;}
  .royal-compact #app .rde-workspace .rde-document-actions button {width:100%;min-height:40px;padding:10px 12px;font:600 13px/1.4 'Segoe UI',Arial,sans-serif;white-space:normal;border:1px solid #bbaea4;background:#fff;color:#51443e;border-radius:6px;}
  .royal-compact #app .rde-workspace .rde-document-actions button.primary {background:#722636!important;color:#fff!important;border-color:#722636!important;}
  .royal-compact #app .rde-workspace .rde-document-actions button[onclick="storeDoc()"] {background:#fff!important;color:#51443e!important;border-color:#bbaea4!important;}
  .royal-compact #app .rde-workspace .rde-document-actions button[onclick="issue()"] {background:#722636!important;color:#fff!important;border-color:#722636!important;}
  .rde-workspace .rde-table-scroll {max-width:100%;min-width:0;overflow-x:auto;}
  .rde-workspace .rde-lines {min-width:620px;}
  .rde-workspace .rpe-pdf-option {font:12px/1.6 'Segoe UI',Arial,sans-serif;color:#51443e;border-top:1px solid #e5dbd2;padding-top:14px;align-items:start;}
  .rde-workspace .rpe-pdf-option input {width:16px;min-width:16px;margin-top:3px;accent-color:#722636;}
  @media(min-width:901px) and (max-width:1190px) {.rde-workspace {grid-template-columns:minmax(0,1fr) 215px;gap:14px;}.rde-workspace>.rde-toolbar{padding:13px;}}
  @media(max-width:1000px) {
    .rde-workspace {grid-template-columns:minmax(0,1fr);gap:14px;}
    .rde-workspace>.rde-paper {grid-column:1;grid-row:2;}
    .rde-workspace>.rde-toolbar {grid-column:1;grid-row:1;position:static;}
    .royal-compact #app .rde-workspace .rde-document-actions {flex-direction:row;flex-wrap:wrap;}
    .royal-compact #app .rde-workspace .rde-document-actions button {flex:1 1 145px;width:auto;}
  }
  @media(max-width:700px) {
    .royal-compact .royal-topbar {margin-inline:0;padding-inline:0;background:transparent!important;}
    .royal-compact #app .rd-summary {gap:8px;}
    .royal-compact #app .rd-summary>button {min-height:58px;padding:10px;}
    .royal-compact #app .rd-filters {padding:10px;grid-template-columns:minmax(0,1fr) minmax(0,1fr);}
    .royal-compact #app .rd-filters :is(input,select),.royal-compact #app .rd-filters>button {min-height:44px;height:44px;}
    .royal-compact #app .rd-table {min-width:650px;}
    .royal-compact .royal-ivory-project .ivory-project-tabs {flex-wrap:nowrap;overflow-x:auto;}
    .royal-compact .royal-ivory-project .ivory-project-tabs button {flex-shrink:0;min-height:44px;}
    .rde-workspace>.rde-toolbar {padding:14px;gap:12px;}
    .royal-compact #app .rde-workspace .rde-document-actions button {min-height:44px;}
    .rde-workspace .rde-paper .qd-head {grid-template-columns:minmax(0,1fr);gap:12px;}
    .rde-workspace .rde-paper .qd-brand {display:flex;align-items:center;gap:10px;}
    .rde-workspace .rde-paper .qd-reference {text-align:left;}
    .rde-workspace .rde-paper .qd-dates>div {display:grid;grid-template-columns:minmax(0,1fr) 150px;align-items:center;}
    .rde-workspace .rde-paper .qd-reference .qd-dates dd {width:100%;max-width:none;}
    .rde-workspace .rde-paper .qd-dates input {width:100%;font-size:14px;min-height:44px;}
  }
}
