/* Application-only styling. Approved documents use their own standalone styles. */
[data-jmg-denied],input[data-money-canonical],[hidden]{display:none!important}
.jmg-money{font-variant-numeric:tabular-nums;min-width:0;width:100%}
.jmg-theme-control{display:flex;align-items:center;gap:8px;color:inherit;font-size:12px;margin:12px 0}
.jmg-theme-control select{max-width:135px;background:#fff;color:#052744}
.jmg-address{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.jmg-address label:nth-child(2){grid-column:span 2}
#clients .jd-table td:nth-child(2),#clients .jd-table td:nth-child(3),#clients table td:nth-child(2),#clients table td:nth-child(3){white-space:nowrap;font-variant-numeric:tabular-nums}
#clients table th:first-child{width:24%}#clients table th:nth-child(2){width:18%}#clients table th:nth-child(3){width:16%}
#clients table td:nth-child(4){overflow-wrap:anywhere}
#dlg.jmg-invoice-review .r-section{padding:12px;margin:8px 0}
#dlg.jmg-invoice-review .jd-details,#dlg.jmg-invoice-review dl{margin:0}
#dlg.jmg-invoice-review .jmg-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
#dlg.jmg-invoice-review .jmg-summary .total{background:#052744;color:#fff;border-left:4px solid #e80023}
#dlg.jmg-invoice-review .jmg-summary .total b{color:#fff}
html[data-jmg-theme=dark]{color-scheme:dark}
html[data-jmg-theme=dark] body,html[data-jmg-theme=dark] .app,html[data-jmg-theme=dark] main{background:#101b2b!important;color:#e7eef7!important}
html[data-jmg-theme=dark] :is(.jd-panel,.panel,.fm-panel,.fm-kpi,.jf-card,.jd-kpi,.jd-details,.jd-filter,.jd-filters,.jd-tabs,.jd-savebar,.jd-card,.jmg-summary,.jd-detail,.jmg-map-card,dialog,.db,.df,.gate,.box,.jmg-topbar){background:#192b42!important;color:#e7eef7!important;border-color:#40536b!important}
html[data-jmg-theme=dark] :is(.jd,.fm-welcome,.jd-panel,.jd-details,dialog,.box) :is(h1,h2,h3,h4,label,p,small,dt,dd,strong,b){color:inherit}
html[data-jmg-theme=dark] :is(input,textarea,select){background:#102238!important;color:#f1f5fb!important;border-color:#5f7490!important}
html[data-jmg-theme=dark] :is(table,tbody,td){background:#192b42!important;color:#e7eef7!important;border-color:#40536b!important}
html[data-jmg-theme=dark] th{background:#0c365c!important;color:#fff!important}
html[data-jmg-theme=dark] :is(.jd-btn,.btn,.jf-btn,.jd-tabs button,.jd-sort){background:#233c58;color:#eef5ff;border-color:#65809c}
html[data-jmg-theme=dark] :is(.jd-btn.primary,.btn.pri,.jf-btn.primary){background:#0865ac;color:#fff}
html[data-jmg-theme=dark] :is(.jd-btn.red,.jd-tabs button.active){background:#b90025;color:#fff}
html[data-jmg-theme=dark] :is(.jd-link,.fm-link){color:#86c6ff!important}
html[data-jmg-theme=dark] :is(.jd-note,.jd-empty,.jd-summary,.r-section,.jd-config-card){background:#192b42!important;color:#e7eef7!important;border-color:#40536b!important}
html[data-jmg-theme=dark] ::placeholder{color:#b2c1d4;opacity:1}
html[data-jmg-theme=dark] .app :is(h1,h2,h3,.jd-head p,.jd-date,.jd-pages,.jmg-profile,.fm-welcome,.fm-date,.jd-page-bottom){color:#e7eef7!important}
html[data-jmg-theme=dark] .app :is(.jd-pages span,.jd-head small,.jmg-profile small,.jd-date small){color:#c0ccdb!important}
html[data-jmg-theme=dark] .app .fm-menu{color:#e7eef7!important}
html[data-jmg-theme=dark] #fm-profile{color:#eef5ff!important}
html[data-jmg-theme=dark] .app .fm-signout{color:#eef5ff!important;border-color:#8194a6!important}
@media(max-width:800px){
  .app{grid-template-columns:minmax(0,1fr)!important}
  .app>aside{transform:translateX(-105%)!important;visibility:hidden}
  body.r-drawer .app>aside{transform:translateX(0)!important;visibility:visible}
  .app>main{grid-column:1!important}
  .jmg-topbar .fm-menu{display:inline-flex!important;visibility:visible!important;color:#052744;align-items:center;justify-content:center;min-width:40px;min-height:40px}
}

/* Second review: compact information groups, without touching printable CSS. */
.jmg-record-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:14px 0}
.jmg-record-card{border:1px solid var(--line,#dbe3ee);border-radius:10px;padding:14px;background:var(--card,#fff);min-width:0}
.jmg-record-card h3{margin:0 0 10px;font-size:14px;color:inherit}
.jmg-record-card dl{margin:0;display:grid;gap:10px;grid-template-columns:repeat(2,minmax(0,1fr))}
.jmg-record-card dt{font-size:11px;opacity:.7;margin-bottom:3px}.jmg-record-card dd{margin:0;font-weight:600;overflow-wrap:anywhere;font-size:13px}
.jmg-receiver-form{grid-column:1/-1}.jmg-receiver-form input{width:100%}
.jmg-column-filters input{width:100%;min-width:85px;max-width:180px;font-size:12px;padding:7px;border:1px solid #ccd5e1;border-radius:6px}
.jmg-column-filters th{padding:6px!important}.jmg-partial-save{padding:12px;background:#fff3d4;color:#613e00;border:1px solid #e4bd60;border-radius:8px}
.jmg-mobile-filters{display:none}
#dlg .jd .form.jmg-invoice-identity{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:10px!important}
.jmg-invoice-identity .jmg-record-card{padding:10px}.jmg-invoice-identity .jmg-record-card h3{font-size:12px;margin-bottom:6px}.jmg-invoice-identity p{margin:0;font-size:13px;font-weight:600;overflow-wrap:anywhere}
.jmg-invoice-identity dl{margin:0;display:contents}.jmg-invoice-identity .jmg-summary-cell{min-width:0;border:1px solid #dbe3ee;border-radius:8px;padding:10px;overflow-wrap:anywhere}
.jmg-geo-note{font-size:12px;line-height:1.5;padding:8px 0}
.jmg-geocoder-choice{border:1px solid #dbe3ee;border-radius:12px;padding:20px;max-width:min(540px,90vw);color:#102641}.jmg-geocoder-choice::backdrop{background:#10264188}.jmg-geocoder-choice button{display:block;width:100%;text-align:left;margin:10px 0;padding:12px;border:1px solid #ccd5e1;border-radius:8px;white-space:normal}.jmg-geocoder-choice p{font-size:13px;line-height:1.5}
html[data-jmg-theme="dark"] .jmg-record-card{background:#17283d;border-color:#33465c;color:#e5edf7}
html[data-jmg-theme="dark"] .jmg-column-filters input{background:#112237;color:#e5edf7;border-color:#33465c}
@media(max-width:760px){.jmg-record-grid{grid-template-columns:1fr}.jmg-record-card dl{grid-template-columns:1fr}#dlg .jd .form.jmg-invoice-identity{grid-template-columns:1fr!important}.jmg-column-filters input{max-width:125px}}
@media(max-width:760px){.jmg-mobile-filters{display:block;padding:12px;border:1px solid #ccd5e1;border-radius:8px;margin:10px 0}.jmg-mobile-filter-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:10px}.jmg-mobile-filter-grid label{display:grid;gap:4px;font-size:12px}.jmg-mobile-filter-grid input{width:100%;min-width:0;padding:8px}}
@media(max-width:760px){
  .jmg-address{grid-template-columns:repeat(2,minmax(0,1fr))}
  .jmg-address label:nth-child(2){grid-column:auto}
  #dlg{max-width:calc(100vw - 16px);width:calc(100vw - 16px);max-height:calc(100dvh - 16px);margin:auto}
  #dlg .db{padding:12px;overflow:auto}#dlg .dh{gap:8px}#dlg .dh b{overflow-wrap:anywhere}
  .jd-split,.jd-config-grid{grid-template-columns:minmax(0,1fr)!important}
  .jd-item-editor{overflow-x:auto}.jd-item-editor table{min-width:660px}
  .jd-detail-actions,.jd-savebar{flex-wrap:wrap;gap:8px}.jd-savebar{position:static!important}
  #dlg.jmg-invoice-review .jmg-summary{grid-template-columns:1fr}
  .jd-page-bottom,.jd-split>div{min-width:0}.app>main{min-width:0}
}
