/* Final shared UI layer: readable text, one action size, responsive staff pages. */
:root[data-rhino-theme="dark"] {
  --rf-text:#f5f6f7;--rf-muted:#c2c6ce;--rf-faint:#b2b8c1;
  --rf-positive:#8cdea9;--rf-negative:#ffaaaa;--rf-warning:#ffda8e;
  --rh-link:#ffaf85;--rh-button:#ff793f;--rh-button-hover:#ff925f;--rh-button-text:#17120f;
  --rh-focus:#ffb590;--rh-control-border:#828a96;--rh-badge-bg:#2a303a;--rh-badge-text:#f4f6fa;
  --rf-card-background:var(--rf-surface);
}
:root[data-rhino-theme="light"] {
  --rf-text:#18202b;--rf-muted:#475466;--rf-faint:#526174;
  --rf-positive:#14613b;--rf-negative:#a42331;--rf-warning:#795000;
  --rh-link:#9e310d;--rh-button:#b93b0c;--rh-button-hover:#94300b;--rh-button-text:#fff;
  --rh-focus:#922b0d;--rh-control-border:#748092;--rh-badge-bg:#edf0f4;--rh-badge-text:#29384a;
  --rf-card-background:var(--rf-surface);
}
html {font-size:16px}
body {font-size:15px;line-height:1.55}
body.v52-app :is(.help,.muted,.subtitle,.v51-note,.v52-subnote,.v541-note,.v541-heading p,.v51-welcome p,.v52-caution) {color:var(--rf-muted);font-size:14px;line-height:1.6}
body.v52-app :is(input,select,textarea) {color:var(--rf-text);background:var(--rf-input);border-color:var(--rh-control-border);font-size:16px;line-height:1.4}
body.v52-app :is(input,select,textarea)::placeholder {color:var(--rf-muted);opacity:1}
body.v52-app :is(input,select):not([type=checkbox]):not([type=radio]) {min-height:44px}
body.v52-app label {color:var(--rf-muted);font-size:14px;line-height:1.5}
body.v52-app :is(p,li) {overflow-wrap:break-word}
body.v52-app :is(h1,h2,h3,h4) {line-height:1.3;letter-spacing:-.02em}
body.v52-app :is(.panel-head,.v52-panel-head,.v51-section-head) {flex-wrap:wrap;gap:16px}
body.v52-app :is(.panel-head,.v52-panel-head,.v51-section-head) :is(h2,h3) {font-size:20px;margin:0;min-width:0}
body.v52-app a:not(.button) {color:var(--rh-link)}
body.v52-app :is(.button,.button.small,.button.ghost,.button.subtle,summary.button,.rh-approval-tabs button,.v51-subtab,.v541-view-controls button) {
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:44px;min-width:112px;max-width:100%;padding:10px 16px;
  border-radius:10px;border:1px solid var(--rh-control-border);
  font-size:14px;font-weight:650;line-height:22px;text-align:center;
  white-space:normal;overflow-wrap:break-word;vertical-align:middle;text-decoration:none;
}
body.v52-app .button:not(.outline):not(.warning):not(.success):not(.ghost):not(.subtle) {background:var(--rh-button);color:var(--rh-button-text);border-color:var(--rh-button)}
body.v52-app .button:not(.outline):not(.warning):not(.success):not(.ghost):not(.subtle):hover {background:var(--rh-button-hover);color:var(--rh-button-text);border-color:var(--rh-button-hover)}
body.v52-app :is(.button.outline,.button.ghost,.button.subtle,.v51-subtab,.rh-approval-tabs button) {background:var(--rf-surface-raised);color:var(--rf-text)}
body.v52-app :is(.v51-subtab.selected,.rh-approval-tabs [aria-selected=true]) {background:var(--rh-button);color:var(--rh-button-text);border-color:var(--rh-button)}
body.v52-app .button.warning {background:#9c2831;border-color:#9c2831;color:#fff}
body.v52-app .button.success {background:#17643d;border-color:#17643d;color:#fff}
body.v52-app .button:not(.icon-button):not(.v51-help-icon):not(.rf-mobile-menu-button) {min-width:160px}
body.v52-app :is(button:disabled,.button:disabled) {opacity:1;color:var(--rf-muted)!important;background:var(--rf-surface-soft)!important;border-color:var(--rh-control-border)!important;cursor:not-allowed}
body.v52-app :is(button,a,input,select,textarea,summary):focus-visible {outline:3px solid var(--rh-focus);outline-offset:3px}
body.v52-app :is(.actions,.form-actions,.rf-office-actions,.v541-response-actions,.v541-view-controls) {display:flex;flex-wrap:wrap;gap:12px;align-items:stretch}
body.v52-app :is(.actions,.form-actions,.rf-office-actions,.v541-response-actions) > .button {flex:0 1 160px}
body.v52-app :is(.icon-button,.v51-help-icon,.rf-mobile-menu-button) {min-height:44px;min-width:44px;width:44px;padding:8px;flex-shrink:0}
body.v52-app .top-actions {flex-wrap:wrap;align-items:center;gap:10px}
body.v52-app :is(.grid-form,.grid-form>label) {min-width:0}
body.v52-app .grid-form > .form-actions {grid-column:1 / -1}
body.v52-app :is(.panel-body,.modal-card) {overflow-wrap:break-word}
body.v52-app .panel-body > details {margin-top:20px}
body.v52-app details > summary {cursor:pointer;min-height:44px;padding:12px 16px;font-weight:650;line-height:1.5}
body.v52-app :is(.badge,.v541-status,.rf537-status) {color:var(--rh-badge-text);background:var(--rh-badge-bg);font-size:13px;line-height:1.5;border:1px solid var(--rh-control-border)}
body.v52-app :is(th,td) {font-size:14px;line-height:1.5}
body.v52-app th {color:var(--rf-muted);text-transform:none;letter-spacing:0}
body.v52-app td small {font-size:13px;color:var(--rf-muted)}
body.v52-app svg text {opacity:1;font-size:13px}
body.v52-app .sidebar :is(.navitem,.v51-tool-link,.subtle,.v51-tools>summary) {color:#e1e5ec;font-size:14px;line-height:1.5}
body.v52-app .sidebar .navitem {min-height:48px;padding:12px 14px;gap:12px;margin:4px 0;position:relative}
body.v52-app .sidebar .navitem .icon {display:inline-flex;align-items:center;justify-content:center;width:24px;flex:0 0 24px;font-size:20px}
body.v52-app .sidebar .navitem.active {color:#fff;background:#373d47;box-shadow:inset 3px 0 #ff935d}
body.v52-app .sidebar .navitem.active::before {display:none}
body.v52-app .sidebar :is(.side-title,.brand small) {color:#bcc4d0}
body.v52-app .sidebar {background:#111214}
body.v52-app .sidebar .navitem.active .icon {color:#fff}
body.v52-app :is(.eyebrow,.v51-eyebrow,.v52-eyebrow) {color:var(--rh-link)}
body.v52-app .top-actions .button.v51-help-icon {width:44px;min-width:44px;max-width:44px}
body.v52-app #v51-context .v51-subtab.selected {background:var(--rh-button);color:var(--rh-button-text);border-color:var(--rh-button)}
body.v52-app :is(#content h2,#content h3,#modal-title,.v51-subnav .v51-subtab) {text-transform:none}
body.v52-app .sidebar :is(.v51-tool-link,.v51-tools>summary) {min-height:44px;padding:12px}
body.v52-app footer {font-size:13px;color:var(--rf-muted)}
.rh-pay-filter {display:grid;grid-template-columns:repeat(2,minmax(0,1fr)) auto;gap:16px;align-items:end;margin-bottom:16px}
.rh-pay-filter label {display:grid;gap:6px}
#rh-create-snapshot {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:16px;max-width:680px;margin:20px 0}
#rh-create-snapshot label {display:grid;gap:6px}
.rh-pay-presets {margin:0 0 24px}
.rh-pay-presets .button {min-width:144px}
.rh-pay-summary {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:24px 0}
.rh-pay-summary > div {padding:20px;border:1px solid var(--rf-line);border-radius:12px;background:var(--rf-surface-raised)}
.rh-pay-summary dt {color:var(--rf-muted);font-size:14px}
.rh-pay-summary dd {margin:8px 0;font-size:clamp(20px,2vw,28px);font-weight:700;line-height:1.3;font-variant-numeric:tabular-nums}
.rh-pay-summary small {color:var(--rf-muted);font-size:13px}
.rh-quick-guide ol {list-style:none;padding:0;counter-reset:guide}
.rh-quick-guide li {display:flex;gap:20px;align-items:center;padding:20px 0;border-bottom:1px solid var(--rf-line)}
.rh-quick-guide li::before {counter-increment:guide;content:counter(guide);font-size:20px;font-weight:700;color:var(--rh-link)}
.rh-quick-guide li>div {flex:1}.rh-quick-guide h3 {margin:0 0 6px}.rh-quick-guide p {margin:0 0 16px}
.rh-quick-guide li p {margin:0}.rh-quick-guide .callout {margin-top:24px}
body.rh-staff .v51-help-icon {display:inline-flex!important}
body.rh-staff #rf-mobile-bottom {grid-template-columns:repeat(5,minmax(0,1fr))}
@media(max-width:900px){.rh-pay-filter {grid-template-columns:1fr 1fr}.rh-pay-filter>.button {grid-column:1/-1;justify-self:start}.rh-pay-summary {gap:12px}}
@media(max-width:600px){
  .rh-pay-filter,.rh-pay-summary {grid-template-columns:minmax(0,1fr)}
  #rh-create-snapshot {grid-template-columns:minmax(0,1fr)}
  .rh-pay-filter>.button {justify-self:stretch}.rh-pay-presets .button {flex:1 1 120px;min-width:0}
  #content .rh-pay-presets {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
  #content .rh-pay-presets .button {min-width:0;width:100%;padding:10px 8px}
  .rh-pay-summary {gap:12px}.rh-pay-summary>div {padding:16px}
  body.v52-app :is(.panel-head,.v52-panel-head)> .button {width:100%}
  body.v52-app .topbar h1 {font-size:25px}
  body.v52-app .v52-theme-toggle {min-width:100px}
  body.v52-app :is(.actions,.form-actions,.rf-office-actions)>.button {flex:1 1 140px}
  .rh-quick-guide li {flex-wrap:wrap;gap:12px}.rh-quick-guide li>.button {margin-left:24px}
  body.rh-staff #rf-mobile-bottom button {font-size:11px;color:var(--rf-muted);padding:8px 2px;min-height:60px;line-height:1.3}
  body.rh-staff #rf-mobile-bottom button.active {color:var(--rf-text);box-shadow:inset 0 3px var(--rh-button)}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}
/* Inbox uses the same readable controls in both themes. */
.rh-inbox-tabs {display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px;margin:24px 0}
body.v52-app .rh-inbox-tabs .button {width:100%;justify-content:space-between;min-width:0}
body.v52-app .rh-inbox-tabs .button[aria-pressed=true] {background:var(--rh-button);color:var(--rh-button-text);border-color:var(--rh-button)}
.rh-inbox-count {font-variant-numeric:tabular-nums;font-size:13px;font-weight:700}
.rh-inbox-filter {display:grid;grid-template-columns:minmax(160px,2fr) minmax(150px,1fr) auto auto;gap:12px;align-items:end}
.rh-inbox-filter label,.rh-label-create label,.rh-label-row label {display:grid;gap:6px;min-width:0}
.rh-inbox-filter :is(input,select),.rh-label-row input,.rh-label-create input {width:100%}
.rh-inbox-results {display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;margin:20px 0}
.rh-inbox-list {display:grid;gap:16px}
.rh-inbox-card {padding:20px;border:1px solid var(--rh-control-border);border-radius:12px;background:var(--rf-surface-raised);min-width:0;overflow-wrap:anywhere}
.rh-inbox-card-heading {display:flex;align-items:start;justify-content:space-between;gap:16px}
.rh-inbox-card-heading h3 {margin:0;min-width:0;font-size:19px}
.rh-inbox-card-heading .badge {flex-shrink:0}
.rh-inbox-labels {display:flex;flex-wrap:wrap;gap:8px;list-style:none;padding:0}
.rh-inbox-labels li {padding:4px 10px;border:1px solid var(--rh-control-border);border-radius:6px;color:var(--rh-badge-text);background:var(--rh-badge-bg);font-size:14px}
.rh-inbox-reason {margin:8px 0 16px}.rh-inbox-reason p {margin:0 0 12px;color:var(--rf-muted)}
.rh-inbox-pages {margin:24px 0}.rh-inbox-empty {padding:24px;border:1px solid var(--rh-control-border);border-radius:12px}
.rh-label-choices {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:20px}
.rh-label-choices label {display:flex;gap:10px;align-items:center;min-height:44px;padding:8px;border:1px solid var(--rh-control-border);border-radius:6px;overflow-wrap:anywhere}
.rh-label-choices input {width:20px;height:20px;flex-shrink:0}
.rh-label-create {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:end;margin:20px 0}
.rh-label-row {display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:12px;align-items:end;border-top:1px solid var(--rf-line);padding:16px 0}
@media(max-width:1100px){.rh-inbox-filter {grid-template-columns:1fr 1fr}}
@media(max-width:600px){.rh-inbox-filter,.rh-label-choices,.rh-label-create,.rh-label-row {grid-template-columns:minmax(0,1fr)}.rh-inbox-card {padding:16px}.rh-inbox-card-heading {flex-direction:column;gap:8px}.rh-inbox-tabs {grid-template-columns:repeat(2,minmax(0,1fr))}.rh-inbox .panel-head>.actions {width:100%}.rh-label-row .button,.rh-label-create .button {width:100%}}

/* Crew-hour fields wrap to the dialog width, including laptop browser zoom. */
body.v52-app .modal-card .planner-time-worker {grid-template-columns:repeat(auto-fit,minmax(min(155px,100%),1fr));max-width:100%;width:100%;box-sizing:border-box}
body.v52-app .modal-card .planner-time-worker>* {min-width:0;max-width:100%;grid-column:auto}
body.v52-app .modal-card .planner-time-worker input,body.v52-app .modal-card .planner-time-worker select {box-sizing:border-box;max-width:100%;min-width:0;width:100%}
body.v52-app .modal-card .rhino-shift-row:not([data-shift-kind="NIGHT"]) .rhino-night-duration {display:none}
body.v52-app #planner-day-times,body.v52-app #planner-shift-lines {min-width:0;max-width:100%}
/* Legacy panels use the same surface tokens as the current light/dark theme. */
:root[data-rhino-theme] {
  --surface:var(--rf-surface);--surface-2:var(--rf-surface-raised);
  --panel:var(--rf-surface);--text:var(--rf-text);
}
body.v52-app .rf-invoice-summary>div {background:var(--rf-surface-raised);color:var(--rf-text);border-color:var(--rh-control-border)}
body.v52-app .rf-invoice-summary span {color:var(--rf-muted);opacity:1}
body.v52-app .rf-invoice-summary strong {color:var(--rf-text)}
body.v52-app .rf-invoice-filter {background:var(--rf-surface-raised);color:var(--rf-text);border-color:var(--rh-control-border)}
body.v52-app .rf-invoice-filter.active {background:var(--rh-button);color:var(--rh-button-text);border-color:var(--rh-button)}
body.v52-app .rf-invoice-filter:hover {background:var(--rf-surface-hover);color:var(--rf-text)}
body.v52-app .rf-invoice-filter.active:hover {background:var(--rh-button-hover);color:var(--rh-button-text)}
body.v52-app .rf-invoice-filter span {color:inherit;opacity:1}
body.v52-app :is(.v51-quote-buttons,.rf-invoice-more-menu) {background:var(--rf-surface);color:var(--rf-text)}
/* Outrank the older generic non-.button rule for invoice filter chips. */
body.v52-app #content .rf-invoice-filter {color:var(--rf-text)}
body.v52-app #content .rf-invoice-filter.active {color:var(--rh-button-text)}
body.v52-app #content .rf-invoice-filter.active:hover {color:var(--rh-button-text)}

/* Recalled documents: visible, accessible controls in both themes. */
.rh-document-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:nowrap;flex-shrink:0}
body.v52-app button.button.rh-document-visibility{display:inline-flex;align-items:center;justify-content:center;flex:0 0 38px;width:38px;min-width:38px;min-height:38px;padding:8px;border-radius:9px}
button.rh-document-visibility svg{display:block;flex:none}
.rh-hidden-toggle{margin:6px 0 10px;justify-self:start;width:auto}

.rh-dismiss-list{display:grid;gap:8px;margin:16px 0;max-height:260px;overflow:auto}
.rh-dismiss-list>div{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:10px;border:1px solid var(--rh-control-border);border-radius:8px}
#rh-dismiss-documents>label{display:block;margin:12px 0}

#rh-dismiss-documents .checkbox-label{display:flex;align-items:center;gap:10px;}
#rh-dismiss-documents .checkbox-label input{flex:0 0 auto;margin:0;}

#rh-cash-conversion .checkbox-label{display:flex;align-items:center;gap:10px;}
#rh-cash-conversion .checkbox-label input{flex:0 0 auto;margin:0;}
#rh-cash-conversion>label{margin-top:12px;}
.rh-cash-profit{border:1px solid var(--line);border-radius:8px;padding:12px;}

body.v52-app .rh-cash-detail.grid-form{grid-template-columns:repeat(4,minmax(0,1fr));}
body.v52-app .rh-cash-detail>.metric{display:flex;flex-direction:column;align-items:flex-start;gap:8px;min-height:0;padding:14px;}
body.v52-app .rh-cash-detail>.metric .value{font-size:20px;line-height:1.3;}
@media(max-width:700px){body.v52-app .rh-cash-detail.grid-form{grid-template-columns:repeat(2,minmax(0,1fr));}}

body.v52-app .rh-cash-receipt-review{padding:14px;margin:12px 0;border:1px solid var(--rf-line);border-radius:12px;}
body.v52-app .rh-cash-receipt-choice{display:block;margin:12px 0;overflow-wrap:anywhere;}
body.v52-app .rh-cash-receipt-choice select{display:block;width:100%;max-width:100%;min-width:0;margin-top:6px;}
