/* Online programming (phase 4 UI). Brand: white / yellow / navy. */
.op-popup-bg { position: fixed; inset: 0; background: rgba(8,33,134,.45); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; }
.op-popup { background: #fff; border-radius: 16px; max-width: 440px; width: 100%; padding: 22px; box-shadow: 0 18px 50px rgba(8,33,134,.25); color: #082186; }
.op-popup h2 { margin: 0 0 8px; font-size: 20px; }
.op-popup p, .op-popup li { color: #5B6B86; font-size: 14px; line-height: 1.45; }
.op-popup ol { padding-left: 20px; margin: 10px 0 16px; }
/* Install popup actions — keep left-aligned row. */
.op-popup .row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-start; }
/* Yes/No confirms (admin+user): close, large, equal — override global .row space-between. */
.op-popup .op-yn {
  display: flex; justify-content: center; align-items: stretch; gap: 12px;
  flex-wrap: nowrap; margin-top: 18px;
}
.op-popup .btn { background: #FBE500; color: #082186; border: 0; border-radius: 10px; font-weight: 800; padding: 10px 16px; cursor: pointer; }
.op-popup .op-yn .btn {
  min-width: 132px; padding: 14px 28px; font-size: 16px; line-height: 1.2; flex: 0 0 auto;
}
.op-popup .btn.ghost { background: #fff; border: 1px solid #C9D2E0; }
.op-dot { width: 10px; height: 10px; border-radius: 50%; background: #8A97AB; display: inline-block; }
.op-dot.on { background: #187A4A; box-shadow: 0 0 0 3px #E6F6EE; }
.op-dot.wait { background: #FBE500; box-shadow: 0 0 0 3px rgba(251,229,0,.25); }
.op-badge { font-size: 11px; font-weight: 800; background: #082186; color: #fff; border-radius: 999px; padding: 3px 8px; }
.op-chat { border: 1px solid #E2E7F0; border-radius: 14px; background: #fff; margin-top: 12px; overflow: hidden; }
.op-chat-h { position: relative; display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: #082186; color: #fff; font-weight: 800; cursor: pointer; overflow: hidden; }
/* User: indeterminate progress on Private chat title only when server signals programming progress */
.op-chat-ibar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; overflow: hidden; background: rgba(255,255,255,.15); }
.op-chat-ibar .op-ibar-fill { position: absolute; top: 0; bottom: 0; left: -40%; width: 40%;
  background: linear-gradient(90deg, rgba(251,229,0,0), #FBE500 40%, #FBE500 60%, rgba(251,229,0,0)); animation: opIbar 1.4s linear infinite; }
.op-chat-ibar.hidden { display: none !important; }
.op-chat-b { padding: 10px 12px; max-height: 220px; overflow: auto; }
.op-chat-b.hidden, .op-chat-tools.hidden { display: none !important; }
.op-bubble { max-width: 88%; padding: 8px 10px; border-radius: 12px; margin: 6px 0; font-size: 13.5px; }
.op-bubble.me { background: #082186; color: #fff; margin-left: auto; }
.op-bubble.them { background: #F1F3F5; color: #082186; }
.op-chat-tools { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #E2E7F0; flex-wrap: wrap; align-items: center; }
.op-chat-tools input[type=text] { flex: 1; min-width: 120px; border: 1px solid #E2E7F0; border-radius: 8px; padding: 8px 10px; }
.op-chat-tools button, .op-tools button { border: 0; border-radius: 8px; padding: 8px 12px; font-weight: 800; cursor: pointer; background: #FBE500; color: #082186; }
.op-progress { font-weight: 700; color: #082186; margin-top: 8px; }
.op-contact { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.op-contact input { border: 1px solid #E2E7F0; border-radius: 8px; padding: 10px 12px; flex: 1; min-width: 140px; }
.hidden { display: none !important; }

.op-contact input { flex: 1; min-width: 160px; border: 1px solid #E2E7F0; border-radius: 8px; padding: 8px 10px; }
.op-contact button, #opPayBtn { border: 0; border-radius: 8px; padding: 8px 14px; font-weight: 800; cursor: pointer; background: #FBE500; color: #082186; }

/* ---- IDcode two-pane area (phase 3 UI) ---------------------------------------------------- */
.op-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; margin-top: 14px; }
.op-grid.hidden { display: none; }
@media (max-width: 860px) { .op-grid { grid-template-columns: 1fr; } }
.op-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.op-panel { background: #fff; border: 1px solid #D9E0F2; border-radius: 12px; padding: 14px 16px; }
.op-panel.hidden, .op-chat.hidden { display: none; }
.op-panel h3 { margin: 0 0 4px; color: #082186; font-size: 16px; }
.op-panel h4 { margin: 14px 0 6px; color: #082186; font-size: 14px; }
.op-sub { color: #5B6B86; font-size: 12.5px; margin: 0 0 8px; }
.op-note { margin-top: 8px; color: #082186; font-weight: 600; }
.op-feed { display: flex; flex-direction: column; gap: 8px; max-height: 460px; overflow-y: auto; }
.op-feed-item { border: 1px solid #E5EAF6; border-left: 4px solid #FBE500; border-radius: 8px; padding: 8px 10px; background: #FBFCFF; }
.op-feed-h { display: flex; justify-content: space-between; align-items: center; color: #082186; }
.op-feed-v { font-weight: 600; color: #14213D; font-size: 13.5px; margin: 2px 0; }
.op-feed-s { color: #33415C; font-size: 13px; margin: 2px 0 4px; }
.op-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #E8ECF8; color: #082186; }
.op-tag.op-st-open { background: #FBE500; color: #082186; }
.op-mini { margin-top: 6px; background: #082186; color: #fff; border: 0; border-radius: 6px; padding: 5px 12px; font-weight: 700; cursor: pointer; }
.op-mini.ghost { background: #fff; color: #082186; border: 1px solid #082186; }
.op-form { display: flex; flex-direction: column; gap: 9px; }
.op-form label { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; font-weight: 600; color: #082186; flex: 1; min-width: 0; }
.op-form input, .op-form select, .op-form textarea { font: inherit; font-weight: 400; color: #14213D; border: 1px solid #C7D0E8; border-radius: 7px; padding: 7px 9px; background: #fff; }
.op-form textarea { resize: vertical; }
.op-row { display: flex; gap: 10px; flex-wrap: wrap; }
.op-radios { border: 1px solid #C7D0E8; border-radius: 7px; padding: 6px 10px 8px; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.op-radios legend { font-size: 12.5px; font-weight: 600; color: #082186; padding: 0 4px; }
.op-form .op-radio { flex-direction: row; align-items: center; font-weight: 500; color: #14213D; }
.op-actions { align-items: center; }
.op-actions button { background: #FBE500; color: #082186; border: 0; border-radius: 8px; padding: 9px 20px; font-weight: 800; cursor: pointer; }
.op-msg { font-size: 12.5px; color: #082186; }
.op-steps { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 6px; }
.op-steps li { padding: 6px 10px; border-radius: 7px; background: #F1F4FB; color: #5B6B86; font-size: 13px; }
.op-steps li.done { background: #E3E9FA; color: #082186; }
.op-steps li.done::before { content: "✓ "; }
.op-steps li.now { background: #082186; color: #FBE500; font-weight: 700; }
.op-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.op-tools button { background: #082186; color: #fff; border: 0; border-radius: 7px; padding: 7px 14px; font-weight: 700; cursor: pointer; }
/* Live: chat fills the left column (requests list is hidden). */
.op-grid[data-mode="live"] .op-left .op-chat { display: flex; flex-direction: column; flex: 1; min-height: 320px; }
.op-grid[data-mode="live"] .op-chat-b { flex: 1; max-height: none; min-height: 220px; }
#opLiveProgress:empty { display: none; }
.op-grid .op-chat { margin-top: 0; }
.op-grid .op-chat.hidden, .op-grid .hidden { display: none !important; }

/* Signed-out home = the existing r46 landing, unchanged. Its hero CTA #heroLogin ("Start", under "15 minutes") is the Start. */

/* ---- Phase 4: signed-in tabs ----------------------------------------------------------------- */
.op-tabs { max-width: 1180px; width: calc(100% - 48px); box-sizing: border-box; margin: 16px auto 0; display: flex; align-items: flex-end; gap: 6px;
  border-bottom: 2px solid #082186; }
.op-tab { background: #fff; color: #082186; border: 1px solid #D9E0F2; border-bottom: 0; border-radius: 10px 10px 0 0; padding: 10px 22px;
  font-weight: 800; font-size: 15px; cursor: pointer; }
.op-tab.active { background: #082186; color: #FBE500; border-color: #082186; }
.op-conn { margin-left: auto; align-self: center; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #5B6B86; font-weight: 600; }
.op-conn.hidden { display: none !important; }
.op-pane { max-width: 1180px; width: calc(100% - 48px); box-sizing: border-box; margin: 0 auto 32px; }
.op-pane.hidden, #layout.hidden { display: none !important; }

/* ---- Status bar: navy track; yellow sweep inverts glyphs to navy where it covers ---- */
.op-ibar { position: relative; min-height: 44px; border-radius: 9px; background: #082186; overflow: hidden; margin-top: 10px; border: 1px solid #082186;
  isolation: isolate; }
.op-ibar .op-ibar-fill { display: none; position: absolute; top: 0; bottom: 0; left: 0; width: 0; background: #FBE500; will-change: left; z-index: 0; }
.op-ibar.busy .op-ibar-fill { display: block; width: 45%; left: -45%; animation: opIbar 1.05s linear infinite; }
.op-ibar.busy.determinate .op-ibar-fill { animation: none; left: 0; width: var(--op-pct, 0%); }
.op-ibar span { position: relative; z-index: 1; display: flex; min-height: 44px; align-items: center; justify-content: center; font-weight: 800;
  color: #FBE500; font-size: 14px; line-height: 1.25; padding: 8px 12px; text-align: center; letter-spacing: 0.02em;
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  text-shadow: 0 1px 0 #082186, 0 -1px 0 #082186, 1px 0 0 #082186, -1px 0 0 #082186; }
/* Invert glyphs over the yellow sweep: light yellow on navy, dark blue on yellow. */
.op-ibar.busy span {
  color: #fff;
  text-shadow: none;
  mix-blend-mode: difference;
}
@keyframes opIbar { from { left: -45%; } to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .op-ibar.busy .op-ibar-fill { animation-duration: 4s; } }
.op-tech-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 12px; position: relative; }
.op-tech-btns { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; width: 100%; }
.op-tech-actions button { border: 0; border-radius: 9px; padding: 10px 18px; font-weight: 800; cursor: pointer; font-size: 14px; }
#opIdentify { background: #082186; color: #fff; }
#opComplete { background: #FBE500; color: #082186; }
.op-chat-hint { font-weight: 600; opacity: .8; }
/* Live tech: left = chat (Requests hidden); right = VIN strip + Connect/Complete. */
.op-tech[data-mode="live"] .op-left .op-chat { display: flex; flex-direction: column; flex: 1; min-height: 300px; margin-top: 0; }
.op-tech[data-mode="live"] .op-right #opTechBox { flex: 0 0 auto; }
.op-tech .op-chat.hidden { display: none !important; }
.op-tech .op-chat-b { flex: 1; min-height: 200px; max-height: 360px; }
.op-contact button { padding: 10px 20px; }

/* t256: the tab bar is always centred (user and admin); the status dot sits at the right edge. */
.op-tabs { justify-content: center; position: relative; }
.op-conn { position: absolute; right: 0; bottom: 8px; margin-left: 0; }
.op-tabs .op-conn.hidden { display: none !important; }
@media (max-width: 640px) { .op-conn { position: static; } .op-tab { padding: 10px 14px; font-size: 14px; } }
.op-who { position: absolute; left: 0; bottom: 8px; font-size: 12px; color: #5B6B86; font-weight: 600; }
.op-who.hidden { display: none; }
@media (max-width: 640px) { .op-who { position: static; display: none; } }
