.royalty-shell{--royalty-gold:#e1ad01;--royalty-black:#100c00;display:grid;gap:14px}.royalty-hero{background:var(--royalty-black);color:#fff;border-radius:18px;padding:24px 26px;display:flex;justify-content:space-between;align-items:center;gap:18px;box-shadow:0 12px 30px rgba(16,12,0,.13)}.royalty-hero h2{font-weight:800;margin:2px 0 4px}.royalty-hero h2 i{color:var(--royalty-gold);margin-right:8px}.royalty-hero p{margin:0;color:#d6d3cb}.royalty-kicker{font-size:.72rem;font-weight:800;letter-spacing:.16em;color:var(--royalty-gold)}.royalty-tabs{display:flex;gap:6px;overflow-x:auto;padding:3px 0}.royalty-tab{border:1px solid #d9d6cd;background:#fff;border-radius:999px;padding:8px 14px;white-space:nowrap;font-weight:700;color:#373328}.royalty-tab:hover,.royalty-tab.active{border-color:var(--royalty-gold);background:var(--royalty-gold);color:var(--royalty-black)}.royalty-filter-card{display:grid;grid-template-columns:minmax(170px,1.2fr) repeat(3,minmax(135px,.7fr)) minmax(220px,1.4fr) auto;gap:10px;align-items:end;border:1px solid #e2dfd7;background:#fff;border-radius:16px;padding:14px}.royalty-filter-card label{display:block;font-size:.72rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em;margin-bottom:4px;color:#5b574d}.royalty-filter-buttons{display:flex;gap:6px}.royalty-metrics{display:grid;grid-template-columns:repeat(5,minmax(150px,1fr));gap:10px}.royalty-metric{min-height:105px;background:#fff;border:1px solid #e2dfd7;border-radius:15px;padding:16px;display:flex;justify-content:space-between;align-items:flex-start;box-shadow:0 7px 20px rgba(16,12,0,.04)}.royalty-metric span{display:block;text-transform:uppercase;letter-spacing:.06em;font-size:.7rem;font-weight:800;color:#777268}.royalty-metric strong{display:block;margin-top:6px;font-size:1.28rem;color:#17140e}.royalty-metric>i{color:var(--royalty-gold);font-size:1.25rem;background:#fff7d7;padding:10px;border-radius:50%}.royalty-metric.positive strong{color:#178b51}.royalty-metric.warning strong{color:#c63d42}.royalty-data-card{background:#fff;border:1px solid #e2dfd7;border-radius:16px;overflow:hidden}.royalty-toolbar{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:14px 16px;border-bottom:1px solid #e2dfd7}.royalty-toolbar h5{font-weight:800;margin:0}.royalty-toolbar span{font-size:.82rem;color:#777268}.royalty-actions{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}.royalty-table{font-size:.87rem}.royalty-table thead th{font-size:.7rem;text-transform:uppercase;letter-spacing:.04em;color:#5c584f;background:#f6f5f2;white-space:nowrap}.royalty-table td{white-space:nowrap}.royalty-table tbody tr:hover{background:#fffaf0}.royalty-status{background:#ece9e1;color:#28241b}.royalty-status-paid,.royalty-status-completed{background:#d8f3e4;color:#08703c}.royalty-status-partially-paid,.royalty-status-published{background:#fff1bd;color:#735500}.royalty-status-waived,.royalty-status-void,.royalty-status-voided{background:#eee;color:#5b5b5b}.royalty-line{display:grid;grid-template-columns:minmax(220px,1fr) 110px 150px 110px 42px;gap:8px;align-items:center;margin-bottom:8px}.royalty-line-total{text-align:right;font-weight:800}.royalty-email-preview{white-space:pre-wrap;background:#f7f6f2;border:1px solid #e3e0d8;padding:14px;border-radius:10px;max-height:300px}.comprehensive-analysis-export{float:right;margin:0 0 10px 10px}@media(max-width:1200px){.royalty-filter-card{grid-template-columns:repeat(3,1fr)}.royalty-metrics{grid-template-columns:repeat(3,1fr)}}@media(max-width:768px){.royalty-hero{padding:18px;align-items:flex-start}.royalty-filter-card{grid-template-columns:1fr 1fr}.royalty-filter-search,.royalty-filter-buttons{grid-column:1/-1}.royalty-metrics{grid-template-columns:1fr 1fr}.royalty-toolbar{align-items:flex-start;flex-direction:column}.royalty-actions{justify-content:flex-start}.royalty-line{grid-template-columns:1fr 80px 100px}.royalty-line-total{display:none}.royalty-remove-line{grid-column:3}}@media(max-width:480px){.royalty-filter-card,.royalty-metrics{grid-template-columns:1fr}.royalty-hero{flex-direction:column}.royalty-filter-search,.royalty-filter-buttons{grid-column:auto}.royalty-filter-buttons .btn{flex:1}}

/* V18.8 workflow surfaces */
.royalty-toolbar{justify-content:flex-start;flex-wrap:wrap}.royalty-row-count{margin-left:auto!important}.royalty-form-section{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;border:1px solid #e2dfd7;border-radius:12px;background:#faf9f6}.royalty-template-editor{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.8rem;line-height:1.45}.royalty-preview-panel{border:1px solid #e0d9c8;border-radius:15px;background:linear-gradient(180deg,#fff,#fffaf0);padding:16px;min-height:140px}.royalty-preview-head{display:flex;justify-content:space-between;align-items:center;gap:18px;border-bottom:1px solid #e8e2d5;padding-bottom:12px}.royalty-mini-stat{background:#fff;border:1px solid #e5e1d8;border-radius:12px;padding:12px;height:100%}.royalty-mini-stat span{display:block;font-size:.68rem;text-transform:uppercase;letter-spacing:.07em;color:#777268;font-weight:800}.royalty-mini-stat strong{display:block;margin-top:4px;font-size:1rem}.royalty-document-frame{width:100%;min-height:660px;border:1px solid #dedad1;border-radius:12px;background:#fff}.royalty-document-frame-tall{min-height:740px}.royalty-invoice-summary-card{position:sticky;top:0;border:1px solid #e1ddd4;border-radius:14px;padding:18px;background:#fff;box-shadow:0 10px 28px rgba(16,12,0,.06)}.royalty-summary-row{display:flex;justify-content:space-between;gap:14px;border-top:1px solid #eeeae2;padding:9px 0}.royalty-summary-row>span{color:#777268}.royalty-summary-row>strong{text-align:right}.royalty-other-line{border:1px solid #e6e1d7;border-radius:12px;padding:10px;background:#fff}.royalty-bulk-change{height:100%;border:1px solid #e4e0d6;border-radius:12px;padding:12px;background:#faf9f6}.royalty-pdf-render-frame{position:fixed!important;left:-10000px!important;top:0!important;width:816px!important;height:1056px!important;border:0!important;opacity:.01!important;pointer-events:none!important}.royalty-table .btn-group{gap:3px}.royalty-table .btn-group>.btn{border-radius:.375rem!important}.royalty-email-preview{max-height:380px;overflow:auto}.royalty-table td:nth-last-child(1){position:sticky;right:0;background:inherit}.royalty-table thead th:nth-last-child(1){position:sticky;right:0;z-index:2}.royalty-data-card .table-responsive{max-height:min(68vh,760px)}.royalty-data-card thead{position:sticky;top:0;z-index:3}.royalty-data-card thead th{background:#f6f5f2}
@media(max-width:768px){.royalty-document-frame,.royalty-document-frame-tall{min-height:520px}.royalty-preview-head{align-items:flex-start;flex-direction:column}.royalty-row-count{margin-left:0!important}.royalty-invoice-summary-card{position:static}}

/* V18.8.1 consistency and template builder corrections (retained in V18.8.2) */
.royalty-hero,.royalty-filter-card,.royalty-data-card,.royalty-metric{border-radius:10px}
.royalty-tab{border-radius:8px;padding:7px 12px;font-weight:600}
.royalty-tab.active{box-shadow:inset 0 -2px 0 rgba(0,0,0,.18)}
.royalty-filter-card .form-control,.royalty-filter-card .form-select,.royalty-shell .btn{border-radius:7px}
.royalty-filter-card{grid-template-columns:minmax(190px,1.1fr) repeat(3,minmax(135px,.65fr)) minmax(230px,1.4fr) auto}
.royalty-toolbar{padding:10px 12px}.royalty-data-card{box-shadow:none}
.royalty-block-palette{display:grid;gap:8px}
.royalty-builder-block{display:flex;align-items:center;gap:9px;width:100%;border:1px solid #d9d4c8;background:#fff;border-radius:7px;padding:9px 10px;text-align:left;font-weight:600;color:#2b271f;cursor:grab}
.royalty-builder-block:hover{border-color:#e1ad01;background:#fff9df}.royalty-builder-block:active{cursor:grabbing}
.royalty-template-dropzone{min-height:390px;border:1px dashed #c9a72d;background:#fffef9}
.royalty-template-dropzone:focus{border-style:solid}
.royalty-document-frame{border-radius:8px}
@media(max-width:1200px){.royalty-filter-card{grid-template-columns:repeat(3,1fr)}}


/* V18.8.2 production interaction, compact table, and nested preview fixes */
.royalty-table th,.royalty-table td{padding:.48rem .62rem;vertical-align:middle}.royalty-table tbody tr{height:42px}.royalty-select-col{width:38px}.royalty-actions-col{width:64px}.royalty-data-row{cursor:default}.royalty-data-row:focus{outline:2px solid rgba(225,173,1,.55);outline-offset:-2px}.royalty-row-action-menu{position:relative;display:inline-block}.royalty-row-action-menu>summary{list-style:none;width:34px;height:31px;padding:4px 8px;display:inline-grid;place-items:center}.royalty-row-action-menu>summary::-webkit-details-marker{display:none}.royalty-row-action-popover{position:absolute;z-index:80;right:0;top:calc(100% + 5px);min-width:205px;padding:6px;background:#fff;border:1px solid #d9d5cb;border-radius:9px;box-shadow:0 14px 34px rgba(17,17,17,.18);display:grid;gap:2px;text-align:left}.royalty-row-action-item{border:0;background:transparent;border-radius:6px;padding:8px 9px;display:grid;grid-template-columns:22px 1fr;gap:7px;align-items:center;text-align:left;color:#242019;font-size:.82rem}.royalty-row-action-item:hover{background:#fff7d8}.royalty-row-action-item.success{color:#087846}.royalty-row-action-item.danger{color:#c72736}.royalty-row-action-item i{text-align:center}.royalty-preview-modal{z-index:1085}.royalty-preview-backdrop{z-index:1080!important}.royalty-email-editor{font-family:Arial,Helvetica,sans-serif;line-height:1.55;min-height:360px}.royalty-email-design-frame{min-height:600px}.royalty-column-chooser{position:relative}.royalty-column-chooser .dd-column-menu{z-index:90}.royalty-toolbar>.dd-column-chooser{margin-left:0}.royalty-document-frame{display:block}.royalty-table td:last-child,.royalty-table th:last-child{min-width:60px}.royalty-table tbody tr.table-warning td{background:#fff4c9}.royalty-filter-card,.royalty-toolbar,.royalty-tabs,.royalty-data-card{font-size:.92rem}
@media(max-width:768px){.royalty-row-action-popover{position:fixed;right:12px;top:auto}.royalty-table th,.royalty-table td{padding:.42rem .5rem}.royalty-email-editor{min-height:280px}}

/* V18.8.3: Royalty multi-location filter uses the same searchable selector as other modules. */
.royalty-filter-locations{min-width:0}.royalty-filter-locations .dd-actual-multi-holder{width:100%;min-width:0}.royalty-filter-locations .dd-actual-summary{min-height:38px}.royalty-filter-locations .form-text{font-size:.72rem;margin-top:4px}.royalty-filter-card .dd-actual-menu{z-index:120}

/* V18.10.1: secured POS evidence and unified export menu. */
.royalty-export-menu .dropdown-menu{min-width:190px;z-index:110}.royalty-export-menu .dropdown-item{font-size:.84rem;padding:.55rem .8rem}.royalty-export-menu .dropdown-item i{width:18px;text-align:center;color:#8d6d00}.royalty-sales-attachments{display:grid;gap:7px;margin-top:10px}.royalty-sales-attachment{display:flex;justify-content:space-between;align-items:center;gap:12px;border:1px solid #e3dfd5;border-radius:8px;background:#fff;padding:9px 10px}.royalty-sales-attachment>div:first-child{min-width:0;display:flex;align-items:center}.royalty-sales-attachment strong{max-width:520px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.royalty-sales-attachment small{color:#777268;margin-left:8px;white-space:nowrap}@media(max-width:620px){.royalty-sales-attachment{align-items:flex-start;flex-direction:column}.royalty-sales-attachment>div:first-child{align-items:flex-start;flex-wrap:wrap}.royalty-sales-attachment small{margin-left:25px}}

/* V18.10.2: top-layer action menus and production mobile hardening. */
.royalty-row-action-popover.royalty-action-portaled{position:fixed!important;z-index:2147483001!important;margin:0!important;overflow-y:auto;overscroll-behavior:contain;max-width:calc(100vw - 16px)}
.royalty-filter-locations .dd-stable-multi-holder,.royalty-filter-locations .dd-actual-multi-holder{width:100%;min-width:0}
.royalty-filter-card:has(details.dd-actual-multi-details[open]),.royalty-filter-locations:has(details.dd-actual-multi-details[open]){position:relative;z-index:2147483000;overflow:visible!important}
@media(max-width:767.98px){
  .royalty-shell{gap:10px;min-width:0}
  .royalty-hero{padding:15px 14px;border-radius:8px}.royalty-hero h2{font-size:1.35rem}.royalty-hero p{font-size:.82rem}
  .royalty-tabs{margin-inline:-2px;padding-bottom:5px}.royalty-tab{padding:7px 10px;font-size:.82rem}
  .royalty-filter-card{grid-template-columns:1fr!important;padding:11px;gap:8px}.royalty-filter-search,.royalty-filter-buttons{grid-column:auto}.royalty-filter-buttons{width:100%}.royalty-filter-buttons .btn{flex:1}
  .royalty-metrics{display:flex;overflow-x:auto;scroll-snap-type:x proximity;padding-bottom:4px}.royalty-metric{min-width:180px;min-height:92px;scroll-snap-align:start;padding:13px}
  .royalty-toolbar{padding:9px}.royalty-actions{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.royalty-actions>.btn,.royalty-actions>.dropdown,.royalty-actions>.dd-column-chooser{width:100%}.royalty-actions>.dropdown>.btn,.royalty-actions>.dd-column-chooser>summary{width:100%}
  .royalty-data-card .table-responsive{max-height:62vh;overflow:auto;-webkit-overflow-scrolling:touch}.royalty-table{min-width:760px}.royalty-table td:last-child,.royalty-table th:last-child{position:sticky;right:0;background:#fff;box-shadow:-5px 0 8px rgba(17,17,17,.05)}.royalty-table thead th:last-child{background:#f6f5f2}
  .royalty-row-action-popover.royalty-action-portaled{min-width:min(230px,calc(100vw - 16px))}
  #upgradeGenericModal .modal-dialog.modal-xl,#upgradeGenericModal .modal-dialog.modal-lg,.royalty-preview-modal .modal-dialog{width:auto;max-width:none;margin:.4rem;height:calc(100% - .8rem)}
  #upgradeGenericModal .modal-content,.royalty-preview-modal .modal-content{max-height:100%;border-radius:9px}
  #upgradeGenericModal .modal-body,.royalty-preview-modal .modal-body{padding:12px;overflow:auto}
  .royalty-sales-attachment strong{max-width:calc(100vw - 92px)}
}

/* V18.10.4: reviewed imports, compact collapsible filters, and consistent grouping. */
.royalty-filter-heading{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:12px;padding-bottom:8px;border-bottom:1px solid #ece8df}.royalty-filter-heading>div{display:flex;align-items:center;gap:7px}.royalty-filter-heading>div>span{font-size:.73rem;color:#777268}.royalty-filter-card.is-collapsed{display:flex;align-items:center;padding:9px 12px}.royalty-filter-card.is-collapsed .royalty-filter-heading{width:100%;padding:0;border:0}.royalty-filter-card.is-collapsed .royalty-filter-field{display:none}.royalty-group-control{display:flex;align-items:center;gap:7px;margin:0}.royalty-group-control>span{white-space:nowrap;font-size:.75rem!important;font-weight:700;color:#5c584f!important}.royalty-group-control .form-select{min-width:150px;height:32px}.royalty-group-row td{position:static!important;background:#fff7d8!important;border-top:2px solid #e1ad01;color:#272217;font-weight:800}.royalty-group-row td span{margin-right:9px}.royalty-group-row td small{color:#777268;font-weight:500}.royalty-import-review-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.royalty-import-counts{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}.royalty-import-counts span{border:1px solid #ddd7ca;border-radius:999px;background:#fff;padding:5px 9px;font-size:.75rem;font-weight:700}.royalty-import-counts .success{color:#087846;border-color:#9dd8bd}.royalty-import-counts .danger{color:#bd2332;border-color:#efb4bb}.royalty-import-table-wrap{max-height:min(60vh,620px);border:1px solid #ded9cf;border-radius:8px}.royalty-import-table{min-width:1100px;margin:0}.royalty-import-table thead{position:sticky;top:0;z-index:4}.royalty-import-table thead th{background:#f5f3ee;white-space:nowrap;font-size:.72rem}.royalty-import-table td{min-width:150px}.royalty-import-table td:first-child,.royalty-import-table td:nth-child(2),.royalty-import-table td:nth-child(3){min-width:62px}.royalty-import-cell{min-width:145px}.royalty-import-invalid td{background:#fff5f5}.royalty-import-errors{min-width:280px!important;white-space:normal;font-size:.78rem}.royalty-import-errors>div{display:flex;gap:6px;color:#bd2332;margin-bottom:4px}.royalty-import-errors>div.warning{color:#856500}
@media(max-width:767.98px){.royalty-filter-heading>div>span{display:none}.royalty-filter-card.is-collapsed{padding:8px 10px}.royalty-group-control{width:100%;justify-content:space-between}.royalty-group-control .form-select{flex:1}.royalty-import-review-head{display:block}.royalty-import-counts{justify-content:flex-start;margin-top:8px}.royalty-import-table-wrap{max-height:58vh}}

/* V18.10.5: complete invoice editor and collection-waiver workflow. */
.royalty-invoice-edit-totals{display:grid;grid-template-columns:repeat(6,minmax(130px,1fr));gap:8px}.royalty-invoice-edit-table{max-height:260px;border:1px solid #e2dfd7;border-radius:8px}.royalty-invoice-edit-table thead{position:sticky;top:0;z-index:2}.royalty-invoice-edit-table thead th{background:#f6f5f2;white-space:nowrap}.royalty-invoice-edit-table td{vertical-align:middle}
@media(max-width:1199.98px){.royalty-invoice-edit-totals{grid-template-columns:repeat(4,minmax(120px,1fr))}}
@media(max-width:767.98px){.royalty-invoice-edit-totals{grid-template-columns:repeat(2,minmax(0,1fr))}.royalty-invoice-edit-table{max-height:220px}.royalty-invoice-edit-table table{min-width:680px}}

/* V18.10.6: actionable KPI filters, sortable headers, and useful group analysis. */
.royalty-shell{grid-template-columns:minmax(0,1fr)}.royalty-shell>*{min-width:0}.royalty-data-card,.royalty-data-card .table-responsive{min-width:0}
button.royalty-metric{font:inherit;color:inherit;text-align:left;cursor:pointer;width:100%}button.royalty-metric:hover{border-color:#c99a00;box-shadow:0 9px 24px rgba(16,12,0,.10);transform:translateY(-1px)}button.royalty-metric:focus-visible{outline:3px solid rgba(225,173,1,.34);outline-offset:2px}button.royalty-metric.is-active{border-color:#b88900;background:#fff8dc;box-shadow:inset 0 0 0 2px rgba(225,173,1,.34)}
.royalty-sortable{cursor:pointer;user-select:none}.royalty-sortable>i{color:#aaa59b;font-size:.66rem}.royalty-sortable.sort-asc,.royalty-sortable.sort-desc{color:#211d14;background:#fff4c6!important}.royalty-sortable.sort-asc>i,.royalty-sortable.sort-desc>i{color:#a77e00}
.royalty-group-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.royalty-group-heading>div:first-child{display:flex;align-items:center;gap:8px}.royalty-group-summary{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap}.royalty-group-stat{display:inline-flex;gap:4px;align-items:center;border:1px solid #ddd5bd;border-radius:999px;background:#fff;padding:4px 8px;font-size:.72rem;font-weight:600}.royalty-group-stat.positive b{color:#087846}.royalty-group-stat.warning b{color:#b52f38}
@media(max-width:767.98px){.royalty-group-heading{align-items:flex-start;flex-direction:column}.royalty-group-summary{justify-content:flex-start}.royalty-group-stat{font-size:.68rem;padding:3px 7px}}


/* V18.10.21: invoice preview lifecycle + mobile viewport hardening. */
.royalty-preview-backdrop{opacity:.34!important}
.royalty-preview-modal .modal-content{overflow:hidden}
.royalty-preview-modal .modal-body{background:#f3f1ec}
.royalty-preview-modal .modal-footer{background:#fff;border-top:1px solid #e2ded5}
@media(max-width:767.98px){
  .royalty-preview-modal .modal-dialog{margin:.25rem;height:calc(100dvh - .5rem);max-height:calc(100dvh - .5rem)}
  .royalty-preview-modal .modal-content{height:100%;max-height:100%;border-radius:8px}
  .royalty-preview-modal .modal-header{padding:.75rem .85rem;flex:0 0 auto}
  .royalty-preview-modal .modal-body{padding:8px;overflow:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
  .royalty-preview-modal .modal-footer{position:sticky;bottom:0;z-index:4;flex:0 0 auto;padding:.6rem .75rem max(.6rem,env(safe-area-inset-bottom))}
  .royalty-document-frame,.royalty-document-frame-tall{min-height:0;height:calc(100dvh - 178px);border-radius:8px}
  .royalty-invoice-summary-card{position:static;padding:14px}.royalty-summary-row{padding:7px 0}
  .royalty-preview-modal .row.g-3>.col-lg-4,.royalty-preview-modal .row.g-3>.col-lg-8{width:100%}
}

/* V18.10.23: invoice preview is document-first at every viewport width. */
.royalty-preview-modal .modal-dialog{max-width:min(1460px,calc(100vw - 24px))}
.royalty-preview-modal .modal-body{min-height:0}
.royalty-invoice-view{display:grid;grid-template-rows:auto minmax(620px,1fr);gap:10px;min-width:0}
.royalty-invoice-view-summary{display:grid;grid-template-columns:minmax(180px,1.1fr) minmax(0,3fr) auto;align-items:center;gap:10px;padding:10px 12px;border:1px solid #dfdbd1;border-radius:10px;background:#fff}
.royalty-invoice-view-identity{min-width:0;display:grid;line-height:1.2}.royalty-invoice-view-identity strong{font-size:1rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.royalty-invoice-view-identity small{color:#777268;margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.royalty-invoice-view-facts{display:grid;grid-template-columns:repeat(6,minmax(88px,1fr));gap:6px;min-width:0}.royalty-invoice-view-facts>span{min-width:0;padding:6px 8px;border-left:1px solid #ece8df}.royalty-invoice-view-facts small{display:block;color:#777268;font-size:.64rem;text-transform:uppercase;letter-spacing:.04em;font-weight:800}.royalty-invoice-view-facts b{display:block;margin-top:2px;font-size:.78rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.royalty-invoice-view-facts .badge{font-size:.68rem}
.royalty-invoice-view-actions{display:flex;gap:6px;justify-content:flex-end;flex-wrap:wrap}.royalty-invoice-view-frame{display:block;width:100%;height:100%;min-height:620px;border-radius:10px;background:#fff}
@media(max-width:1199.98px){.royalty-invoice-view-summary{grid-template-columns:1fr auto}.royalty-invoice-view-facts{grid-column:1/-1;grid-row:2;grid-template-columns:repeat(3,minmax(0,1fr))}.royalty-invoice-view-facts>span{border-left:0;border-top:1px solid #ece8df}}
@media(max-width:767.98px){
  .royalty-preview-modal .modal-dialog{max-width:none}
  .royalty-invoice-view{grid-template-rows:auto minmax(0,1fr);height:100%;gap:8px}
  .royalty-invoice-view-summary{grid-template-columns:1fr;padding:8px;gap:7px}
  .royalty-invoice-view-identity{display:none}
  .royalty-invoice-view-facts{display:flex;grid-column:auto;grid-row:auto;overflow-x:auto;gap:5px;padding-bottom:2px;scrollbar-width:none}.royalty-invoice-view-facts::-webkit-scrollbar{display:none}.royalty-invoice-view-facts>span{flex:0 0 auto;min-width:92px;border:1px solid #ece8df;border-radius:7px;padding:5px 7px}
  .royalty-invoice-view-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}.royalty-invoice-view-actions .btn{width:100%;min-height:42px}
  .royalty-invoice-view-frame{height:calc(100dvh - 255px)!important;min-height:360px!important}
}

/* V18.10.24: invoice preview controls stay above the document frame. */
.royalty-preview-modal{z-index:20000!important;background:rgba(0,0,0,.34)}
.royalty-preview-modal .modal-dialog{position:relative;z-index:20001;pointer-events:auto}
.royalty-preview-modal .modal-content{position:relative;z-index:20002;pointer-events:auto}
.royalty-preview-modal .royalty-preview-header{position:relative;z-index:30;display:flex;align-items:center;gap:10px;background:#fff;pointer-events:auto}
.royalty-preview-modal .royalty-preview-header .modal-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.royalty-preview-header-actions{margin-left:auto;display:flex;gap:6px;align-items:center;position:relative;z-index:31;pointer-events:auto}
.royalty-preview-header-actions .btn{position:relative;z-index:32;pointer-events:auto;touch-action:manipulation}
.royalty-preview-modal .btn-close{position:relative;z-index:32;pointer-events:auto}
.royalty-preview-modal .modal-body{position:relative;z-index:1}
.royalty-invoice-view-summary{position:relative;z-index:3;pointer-events:auto}
.royalty-invoice-view-frame{position:relative;z-index:1}
@media(max-width:767.98px){
  .royalty-preview-modal .royalty-preview-header{flex-wrap:wrap}
  .royalty-preview-header-actions{order:3;width:100%;display:grid;grid-template-columns:1fr 1fr;margin-left:0}
  .royalty-preview-header-actions .btn{width:100%;min-height:42px}
}
