/* R1.3 public live audit — main website only, loaded AFTER all legacy styles.
   Keeps existing layout and ALL Work Form styles unchanged. */
body.r107-ui{--emd-table-surface:#fff;--emd-table-ink:#1e334a;--emd-table-head:#ecf3fa;--emd-table-line:#d5e2ee}
body.r107-ui[data-theme="dark"]{--emd-table-surface:#15283f;--emd-table-ink:#edf5ff;--emd-table-head:#213a55;--emd-table-line:#39536e}
/* Drawers: color + surface MUST be a matched pair. Never white-on-white. */
body.r107-ui #drawer :is(.tablewrap,.r5-tablewrap,.r1157-data-table,.r1156-table-container){background:var(--emd-table-surface)!important;color:var(--emd-table-ink)!important}
body.r107-ui #drawer :is(table.table,table.r5-table,table):not(.r1154-work-table){background:var(--emd-table-surface)!important;color:var(--emd-table-ink)!important;border-color:var(--emd-table-line)!important}
body.r107-ui #drawer :is(table.table,table.r5-table,table):not(.r1154-work-table) :is(th,td){background:var(--emd-table-surface)!important;color:var(--emd-table-ink)!important;border-color:var(--emd-table-line)!important;font-size:max(12px,.78rem)!important;line-height:1.42!important;overflow-wrap:normal!important;word-break:normal!important}
body.r107-ui #drawer :is(table.table,table.r5-table,table):not(.r1154-work-table) thead th{background:var(--emd-table-head)!important;color:var(--emd-table-ink)!important;font-weight:750!important}
body.r107-ui #drawer :is(table.table,table.r5-table,table):not(.r1154-work-table) tbody tr:nth-child(even) td{background:color-mix(in srgb,var(--emd-table-head) 45%,var(--emd-table-surface))!important}
body.r107-ui #drawer :is(table.table,table.r5-table,table):not(.r1154-work-table) :is(.muted,.sub,small){color:var(--emd-table-ink)!important;opacity:.82!important}
body.r107-ui #drawer :is(table.table,table.r5-table,table):not(.r1154-work-table) .record-link{color:var(--accent)!important;text-decoration:underline;text-underline-offset:2px}
/* Theme chooser — selectable preview and readable name regardless of palette. */
body.r107-ui .theme-choice{color:var(--text)!important;background:var(--panel)!important;border-color:var(--line)!important}
body.r107-ui .theme-choice :is(b,small,span){color:var(--text)!important;opacity:1!important}
body.r107-ui .theme-choice.active{outline:2px solid var(--accent)!important;outline-offset:1px}
/* Preserve all table columns, but avoid arbitrary word splitting. */
body.r107-ui #content :is(.table,.r5-table) th{overflow-wrap:normal!important;word-break:normal!important;hyphens:none!important;min-width:max-content}
body.r107-ui #content :is(.table,.r5-table) :is(th,td){font-size:max(12px,.78rem)!important;line-height:1.42!important}
body.r107-ui #content .r5-tablewrap{overscroll-behavior-x:contain}
body.r107-ui .emd-source-formula-error{display:inline-block;background:#fff3d3!important;color:#704700!important;border:1px solid #e4ba67;border-radius:6px;padding:3px 6px;font-size:12px;font-weight:720;white-space:normal;line-height:1.3}
body.r107-ui .emd-usage-pager{display:flex;align-items:center;justify-content:center;gap:14px;flex-wrap:wrap;padding:12px 5px;color:var(--text)}
body.r107-ui .emd-usage-pager button{min-width:88px}
@media(prefers-reduced-motion:reduce){body.r107-ui #content *{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}
