/* 2.20.2 polish layer, loaded last. Presentation only: delete the <link> in
   index.html and every screen looks exactly as it did in 2.20.1.

   Measured on every screen at 1093x614 (a 1366x768 shop PC at 125% Windows
   scaling), 1366x768, 1920x1080, 768x1024 and 375x812, light and dark.
   Each block says what was wrong. tests/layout.js checks every one. */

/* 1. The back-office side panel covered the page on smaller screens.
   rail.css always showed the panel, so on screens narrower than 1181px the
   236px panel sat on top of the left of every page (the title, the first
   dashboard cards, the first table columns), and on a phone it covered two
   thirds of the screen. Now: 821px and wider, the page moves over so the
   panel and the page sit side by side, as on a bigger screen. Narrower than
   that, the panel is hidden and the menu button (top left) opens it. */
@media (min-width: 821px) and (max-width: 1180px) {
  body.has-rail .shell { padding-left: 236px; }
  body.has-rail .topbar .hamburger { display: none; }
}
@media (max-width: 820px) {
  body.has-rail .app-rail.rail-lh,
  :root[data-theme="dark"] body.has-rail .app-rail.rail-lh { display: none; }
}

/* 2. Dark mode: text kept its light-mode colour (dark blue or brown on dark
   grey, as low as 1.5:1). Each now uses the dark theme's own lighter tone. */
:root[data-theme="dark"] .qb-totals .qb-trow.grand span:last-child { color: var(--t-blue); }
:root[data-theme="dark"] .sx-other,
:root[data-theme="dark"] .panel-link { color: var(--t-blue); }
:root[data-theme="dark"] .qb-blank-line { color: var(--ink-2); }
:root[data-theme="dark"] .qb-status .open-shift,
:root[data-theme="dark"] body.has-rail .topbar .pill.warn { color: var(--t-amber); }
:root[data-theme="dark"] .dash-chip.ok { color: var(--t-green); }
:root[data-theme="dark"] .panel > header .tiny.muted { color: var(--ink-2); }
:root[data-theme="dark"] .page-nav-item[aria-current="true"] .page-nav-label { color: var(--t-blue); }
:root[data-theme="dark"] .note-detail { color: var(--ink-2); }
:root[data-theme="dark"] .signin-main p.tiny.muted { color: var(--ink-2); }
/* Sign-in, both themes: grey text on the navy panel was 2.3:1. */
.signin-trust p.tiny.muted { color: rgba(255, 255, 255, .8); }

/* 3. Light mode: small grey labels and messages were too pale (about 3:1).
   One shade darker clears 4.5:1 on white and on the page grey. Greyed-out
   (unavailable) buttons are not touched: they stay greyed on purpose. */
:root:not([data-theme="dark"]) .kcard-label,
:root:not([data-theme="dark"]) .stat .k,
:root:not([data-theme="dark"]) .empty,
:root:not([data-theme="dark"]) .empty-note p,
:root:not([data-theme="dark"]) .donut-empty p,
:root:not([data-theme="dark"]) .lh-title,
:root:not([data-theme="dark"]) .note-detail,
:root:not([data-theme="dark"]) .signin-ver { color: #5F7289; }
:root:not([data-theme="dark"]) .page-sub,
:root:not([data-theme="dark"]) main p.muted { color: #536B85; }
:root:not([data-theme="dark"]) .note-warn .note-title { color: #8A5A08; }
.sx-pill { opacity: 1; }
:root:not([data-theme="dark"]) .qb-stat-hint { color: #7A5007; }
:root[data-theme="dark"] .qb-stat-hint { color: var(--t-amber); }
/* The initials badge (top right): white letters on light blue were 2.8:1. */
.qb-userava, .user-ava { background-color: #2563EB; }

/* The "Use the classic layout" button sat on top of the "A new version of the
   till is ready" bar and hid its "Restart now" button. It moves up while the
   bar is showing. */
body:has(> div[style*="bottom:0"][style*="z-index:80"]) .sx-pill { bottom: 76px; }

/* 4. Dashboard notices were cut off mid-sentence ("...until a shift is ope...").
   They now wrap onto a second line instead. */
.note-card .note-detail { white-space: normal; overflow: visible; text-overflow: clip; }
