/* TRP Pulse — Collections Workbench v2 (PR 2)
   Mostly-white, colour reserved for material misses and wins.
   Mobile-first; every primary control is >= 44x44 CSS px (WCAG 2.5.5).
   State is never signalled by colour alone — text or shape always carries it. */

#trpWorkbench { display: none; }
body.wb-v2 #trpWorkbench {
  display: block; background: #fff; color: #16202e;
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding-bottom: 72px;
}
.wb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Sticky segment header — capped so it never dominates a 375x812 screen. */
.wb-head { position: sticky; top: 0; z-index: 20; background: #fff;
  border-bottom: 1px solid #e6ebf1; padding: 8px 12px; max-height: 30vh; }
.wb-segs { display: flex; gap: 6px; }
.wb-segbtn { min-height: 44px; padding: 0 14px; border: 1px solid #d7dee7; background: #fff;
  border-radius: 22px; font-size: 14px; font-weight: 600; color: #43506214; color: #435062; cursor: pointer; }
.wb-segbtn.on { background: #0f2340; border-color: #0f2340; color: #fff; }
.wb-segbtn:focus-visible, .wb-primary:focus-visible, .wb-nav button:focus-visible,
.wb-kebab:focus-visible, .wb-save:focus-visible { outline: 3px solid #1a8f8f; outline-offset: 2px; }

.wb-fresh { font-size: 12.5px; color: #5b6b7f; padding: 8px 12px; background: #f6f8fa;
  border-bottom: 1px solid #eef2f6; }
.wb-fresh.wb-stale { background: #fdf3df; color: #8a6100; font-weight: 600; }

.wb-strip { display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px; }
.wb-chip { min-width: 74px; border: 1px solid #e6ebf1; border-radius: 10px; padding: 8px 10px; text-align: center; }
.wb-chip b { display: block; font-size: 19px; line-height: 1.1; }
.wb-chip span { font-size: 11px; color: #5b6b7f; text-transform: uppercase; letter-spacing: .5px; }

.wb-lane { padding: 4px 12px 10px; }
.wb-lane h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .7px; color: #5b6b7f; margin: 12px 0 6px; }
.wb-lane h3 span { color: #16202e; }
.wb-list { list-style: none; margin: 0; padding: 0; }

.wb-row { display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid #eef2f6; }
.wb-row-main { flex: 1; min-width: 0; }
.wb-row-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wb-case { font-weight: 650; }
.wb-seg { font-size: 9.5px; font-weight: 700; letter-spacing: .5px; padding: 1px 5px;
  border-radius: 4px; background: #eef2f6; color: #435062; }
.wb-seg-adler { background: #ede7f6; color: #4527a0; }
.wb-seg-contract { background: #e8f5ee; color: #1e7a4d; }
.wb-seg-review { background: #fdf3df; color: #8a6100; }
.wb-badge { font-size: 9.5px; font-weight: 700; padding: 1px 5px; border-radius: 4px; }
.wb-broken { background: #fbeae9; color: #8f2b25; }
.wb-reason { font-size: 13px; color: #5b6b7f; margin-top: 2px; }
.wb-meta { font-size: 12px; color: #7b8794; }

.wb-row-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.wb-primary { min-height: 44px; min-width: 44px; padding: 0 14px; border: none; border-radius: 8px;
  background: #0f766e; color: #fff; font-size: 13.5px; font-weight: 650; cursor: pointer; }
.wb-primary[disabled] { background: #9fb3ad; cursor: default; }
.wb-secondary { min-height: 44px; padding: 0 14px; border: 1px solid #d7dee7; background: #fff;
  border-radius: 8px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.wb-kebab { min-height: 44px; min-width: 44px; border: 1px solid #e6ebf1; background: #fff;
  border-radius: 8px; font-size: 17px; line-height: 1; cursor: pointer; color: #5b6b7f; }
.wb-more { display: block; width: calc(100% - 24px); margin: 12px; min-height: 44px;
  border: 1px solid #d7dee7; background: #fff; border-radius: 8px; font-weight: 600; cursor: pointer; }
.wb-empty, .wb-count { padding: 16px 12px; color: #5b6b7f; font-size: 13.5px; }

/* Bottom nav. No FAB: a floating button collides with this bar at 375px. */
.wb-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex;
  background: #fff; border-top: 1px solid #e6ebf1; }
.wb-nav button { flex: 1; min-height: 56px; border: none; background: none; font-size: 13px;
  font-weight: 600; color: #5b6b7f; cursor: pointer; }
.wb-nav button.on { color: #0f766e; box-shadow: inset 0 2px 0 #0f766e; }

/* Bottom sheet */
.wb-sheet-wrap { position: fixed; inset: 0; z-index: 2147482000; background: rgba(15,23,42,.45);
  display: flex; align-items: flex-end; }
.wb-sheet { background: #fff; width: 100%; max-height: 88vh; overflow-y: auto;
  border-radius: 14px 14px 0 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); }
@media (min-width: 720px) { .wb-sheet-wrap { align-items: center; justify-content: center; }
  .wb-sheet { max-width: 460px; border-radius: 14px; } }
.wb-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wb-sheet-head h4 { margin: 0; font-size: 15.5px; }
.wb-close { min-height: 44px; min-width: 44px; border: none; background: none; font-size: 17px; cursor: pointer; }
.wb-sheet-body { padding: 6px 0 2px; }
.wb-sheet-body label { display: block; font-size: 12.5px; font-weight: 600; color: #435062; margin: 10px 0 4px; }
.wb-sheet-body input, .wb-sheet-body textarea, .wb-sheet-body select {
  width: 100%; min-height: 44px; border: 1px solid #d7dee7; border-radius: 8px;
  padding: 8px 10px; font-size: 16px; /* 16px stops iOS zoom-on-focus */ }
.wb-sheet-body fieldset { border: 1px solid #e6ebf1; border-radius: 10px; padding: 8px 10px; margin: 8px 0 0; }
.wb-sheet-body legend { font-size: 12.5px; font-weight: 600; color: #435062; padding: 0 4px; }
.wb-opt { display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 500; }
.wb-opt kbd { font: 11px ui-monospace, Menlo, monospace; background: #eef2f6; border-radius: 3px; padding: 1px 4px; }
.wb-err { color: #8f2b25; font-size: 13px; font-weight: 600; min-height: 18px; margin: 8px 0 0; }
.wb-sheet-foot { display: flex; gap: 8px; justify-content: flex-end; padding-top: 12px;
  border-top: 1px solid #eef2f6; margin-top: 10px; }
.wb-cancel { min-height: 44px; padding: 0 16px; border: 1px solid #d7dee7; background: #fff;
  border-radius: 8px; font-weight: 600; cursor: pointer; }
.wb-save { min-height: 44px; padding: 0 20px; border: none; background: #0f766e; color: #fff;
  border-radius: 8px; font-weight: 700; cursor: pointer; }
body.wb-sheet-open { overflow: hidden; }

.wb-focus { padding: 14px 12px; }
.wb-focus-actions { display: grid; gap: 8px; margin-top: 12px; }

@media (prefers-reduced-motion: reduce) { #trpWorkbench * { transition: none !important; animation: none !important; } }
@media (max-width: 360px) { .wb-primary { padding: 0 10px; font-size: 13px; } }
