/* Lab routing layer: a shared "how requests are routed" drawer for the service-business playbooks.
   Self-contained and neutral so it sits on any demo's own palette. Button z-index 44 (under the lab bar),
   drawer z-index 70 (above app modals, since it is opened on purpose). */
.lr-btn, .lr-panel, .lr-panel * { box-sizing: border-box; }
.lr-btn {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 44; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border: 1px solid #111; border-radius: 999px; background: #fff; color: #111;
  font: 700 12.5px/1 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  box-shadow: 0 6px 24px rgba(0,0,0,.28); cursor: pointer;
}
.lr-btn:hover { background: #fde047; }
.lr-btn:focus-visible, .lr-panel button:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.lr-dots { display: inline-flex; gap: 3px; }
.lr-dots i { width: 7px; height: 7px; border-radius: 2px; display: block; }

.lr-t-local { --c: #15803d; --bg: #dcfce7; }
.lr-t-frontier { --c: #6d28d9; --bg: #ede9fe; }
.lr-t-person { --c: #c2410c; --bg: #ffedd5; }
.lr-dots i.lr-t-local, .lr-dots i.lr-t-frontier, .lr-dots i.lr-t-person { background: var(--c); }

.lr-scrim { position: fixed; inset: 0; z-index: 69; background: rgba(0,0,0,.35); opacity: 0; transition: opacity .2s ease; }
.lr-scrim.lr-open { opacity: 1; }
.lr-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 70; width: min(460px, 100vw);
  display: flex; flex-direction: column; background: #fff; color: #111;
  font: 400 13.5px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  box-shadow: -12px 0 40px rgba(0,0,0,.25); transform: translateX(100%); transition: transform .22s ease;
  text-align: left; letter-spacing: 0;
}
.lr-panel.lr-open { transform: none; }
@media (prefers-reduced-motion: reduce) { .lr-panel, .lr-scrim { transition: none; } }

.lr-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid #e5e5e5; }
.lr-head h2 { margin: 0; font: 700 16px/1.25 inherit; font-family: inherit; color: #111; }
.lr-head p { margin: 4px 0 0; color: #525252; font-size: 12.5px; }
.lr-x { margin-left: auto; flex: none; width: 32px; height: 32px; border: 1px solid #d4d4d4; border-radius: 8px; background: #fff; color: #111; font: 600 18px/1 inherit; cursor: pointer; }
.lr-x:hover { background: #f5f5f5; }
.lr-body { flex: 1; overflow-y: auto; padding: 4px 18px 24px; overscroll-behavior: contain; }
.lr-sec { padding: 14px 0; border-bottom: 1px solid #f0f0f0; }
.lr-sec:last-child { border-bottom: 0; }
.lr-sec h3 { margin: 0 0 8px; font: 700 11px/1.2 "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; text-transform: uppercase; color: #525252; }
.lr-note { margin: 6px 0 0; color: #737373; font-size: 11.5px; }

.lr-mix { display: flex; height: 12px; border-radius: 4px; overflow: hidden; background: #eee; }
.lr-mix span { display: block; background: var(--c); }
.lr-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.lr-legend div { padding: 8px; border-radius: 8px; background: var(--bg); }
.lr-legend b { display: block; color: var(--c); font-size: 18px; line-height: 1.1; }
.lr-legend small { display: block; color: #404040; font-size: 11px; line-height: 1.3; }
.lr-save { margin-top: 10px; padding: 8px 10px; border: 1px dashed #a3a3a3; border-radius: 8px; font-size: 12.5px; }

.lr-tiers { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.lr-tier { padding: 10px 12px; border-left: 4px solid var(--c); border-radius: 0 8px 8px 0; background: #fafafa; }
.lr-tier b { display: block; color: var(--c); font-size: 12.5px; }
.lr-tier span { display: block; margin-top: 2px; font-size: 12.5px; color: #262626; }
.lr-redact { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: #f5f5f5; font-size: 12px; color: #262626; }

.lr-reqs { display: grid; gap: 6px; }
.lr-req { width: 100%; padding: 9px 11px; border: 1px solid #d4d4d4; border-radius: 8px; background: #fff; color: #111; font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.lr-req:hover { border-color: #111; }
.lr-req[aria-pressed="true"] { border-color: #111; background: #fafafa; box-shadow: inset 3px 0 0 #111; }
.lr-path { margin: 10px 0 0; padding: 0; list-style: none; }
.lr-step { position: relative; padding: 0 0 12px 22px; opacity: 0; transform: translateY(4px); transition: opacity .25s ease, transform .25s ease; }
.lr-step.lr-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .lr-step { transition: none; } }
.lr-step::before { content: ""; position: absolute; left: 4px; top: 4px; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.lr-step::after { content: ""; position: absolute; left: 8px; top: 16px; bottom: 0; width: 2px; background: #e5e5e5; }
.lr-step:last-child::after { display: none; }
.lr-step b { color: var(--c); font-size: 12.5px; }
.lr-step .lr-conf { margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: var(--bg); color: var(--c); font: 600 11px/1.5 "JetBrains Mono", ui-monospace, monospace; }
.lr-step p { margin: 2px 0 0; font-size: 12.5px; color: #262626; }
.lr-out { margin-top: 2px; padding: 8px 10px; border-radius: 8px; background: #111; color: #fff; font-size: 12.5px; }

.lr-log { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.lr-log li { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; font-size: 12px; color: #262626; }
.lr-log i { margin-top: 4px; width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.lr-empty { color: #737373; font-size: 12.5px; }

html.lab-capture .lr-btn { display: none; }

/* A closed drawer stays hidden: .lr-panel sets display:flex, which would otherwise beat the hidden attribute and leave its shadow showing. */
.lr-panel[hidden], .lr-scrim[hidden] { display: none; }
