/* OG — Round 43: takeover input chrome (still-view keyboard +
   pointer) and the true full-screen driving state. Loaded by
   index_epic.html next to the other round assets; the panel's
   own styles live inline in the page — this file only ADDS the
   Round 43 pieces, in the panel's black-and-gold language. */

/* Driving = the panel owns the whole viewport. The JS also pins
   these as inline styles and reparents the panel to <body>, so
   no page chrome or transformed ancestor can shrink it. */
#browserPanel.og-r43-full{border:none;border-radius:0}
body.og-r43-lock{overflow:hidden}

/* Round 61 forensic fix (Brent's 2026-10-10 photo: the full-
   screen bar carried ONLY "End task"): the full state is
   entered on the Take control CLICK (the page's CSS hides Take
   control instantly), but Hand back's visibility is written by
   the page script from its server-CONFIRMED driving flag — so
   any confirmation that is late, lost, or never lands leaves
   a permanent one-button bar with no way back. In the full
   state Hand back is the bar's exit and must ALWAYS be there:
   this rule (author !important, two ids) outranks the page's
   own [hidden] rule exactly while the panel is full; outside
   the full state the attribute governs as before. */
#browserPanel.og-panel-full #browserHandBtn{
  display:inline-block!important}

/* Round 61 forensic fix, the letterbox half of the photo: the
   still is a 1280x800 frame; object-fit:contain inside the
   tall phone viewport paints it as a mid-screen band with
   black above and below. In the full state the still COVERS
   (crops the sides, fills the screen); the pointer mapper in
   og_browser_input.js reads the computed fit, so its
   coordinate math follows. The docked panel keeps contain.
   Ticket A4e (2026-10-20): INVERTED by Brent's drill verdict
   — cover CROPS the page (his Facebook login form's right
   edge, most of the Log in button, off-screen), and his
   requirement is the whole page fitted on screen. Contain
   is now the default in every full state; cover survives
   only as the Fit button's explicit opt-in (og-win-fill). */
#browserPanel.og-panel-full #browserShot{object-fit:contain}
#browserPanel.og-panel-full.og-win-fill #browserShot{object-fit:cover}

/* Live panel Phase 1: the stream canvas in the view stack,
   on the still's own letterbox rules (contain everywhere;
   cover only as the Fit button's opt-in, exactly like the
   still). Watch-only this phase — pointer-events:none keeps
   every tap on the paths Phase 1 leaves untouched (the tap
   veil, the still input layer); Phase 2 flips it when input
   rides the stream socket. The [hidden] rule is explicit:
   the base rule's display:block would otherwise outrank the
   attribute. */
#browserStream{position:absolute;inset:0;width:100%;height:100%;
  object-fit:contain;display:block;background:transparent;
  pointer-events:none}
#browserStream[hidden]{display:none!important}
#browserPanel.og-panel-full #browserStream{object-fit:contain}
#browserPanel.og-panel-full.og-win-fill #browserStream{object-fit:cover}
#browserPanel.og-r43-full #browserStream{object-fit:contain}
#browserPanel.og-r43-full.og-win-fill #browserStream{object-fit:cover}

/* Faster stills: the optimistic tap marker (og_browser_stills.js).
   A ring at the tap point, painted the instant the pointer
   goes down — the zero-ms answer that the tap landed HERE,
   while the follow-up frame is still being captured. It is
   positioned in % of the view box (where the finger touched
   the glass), centred on the point, and never takes events
   itself. Fades out on the .on class removal (next painted
   frame, or the client's 900 ms timer). */
.og-stills-tapmark{position:absolute;width:34px;height:34px;
  margin:-17px 0 0 -17px;border:2px solid rgba(255,193,7,.95);
  border-radius:50%;background:rgba(255,193,7,.18);
  pointer-events:none;z-index:4;opacity:0;
  transition:opacity .25s ease}
.og-stills-tapmark.on{opacity:1;transition:opacity .05s ease}
.og-stills-tapmark[hidden]{display:none!important}

/* The two toggle icons: small, icon-only. Dim = off; gold = on. */
#browserActions .og-icon-btn{font-size:19px;line-height:1;
  min-width:42px;padding:7px 0;text-align:center}
#browserActions .og-icon-btn.og-on{background:#ffc107;
  border-color:#ffc107;color:#111}

/* Ticket A5: the keyboard CAPTURE — the strip is gone.
   One invisible field on the panel: while the visitor
   drives it holds focus and the phone keyboard types
   into it; its words flush straight into the page (the
   JS). It keeps a real box (so focus can land on it)
   but no face at all — opacity 0, no border, transparent
   text and caret, pointer-events none (it never eats a
   tap meant for the page; focus is raised by the
   verified field taps in the JS).
   font-size 16px keeps iOS from auto-zooming on focus.
   KEYBOARD UP = page + keyboard ONLY: while the capture
   holds focus the panel carries og-kb-up and the
   header, the note, the input line and the bottom bar
   all step off screen until the keyboard goes down. */
#ogKbText{position:absolute;left:50%;bottom:6px;z-index:8;
  width:min(92%,430px);height:44px;transform:translateX(-50%);
  opacity:0;border:none;background:transparent;
  color:transparent;caret-color:transparent;
  font-size:16px;pointer-events:none}
#browserPanel.og-kb-up #ogWinHead,
#browserPanel.og-kb-up #ogWinBar,
#browserPanel.og-kb-up #ogInputMsg:not(.og-sticky-err),
#browserPanel.og-kb-up .og-browser-note,
#browserPanel.og-kb-up #ogTaskPillTop{display:none!important}

/* Browser drill fix (2026-11-27): a STICKY error is
   exempt from the step-off — while the keyboard is up
   it overlays the still's bottom edge and stays
   readable. The still is a picture; the refusal is
   the information. */
#browserPanel.og-kb-up #ogInputMsg.og-sticky-err{
  position:absolute;left:8px;right:8px;bottom:8px;z-index:14}

/* Input feedback line (errors/hints), under the view. */
#ogInputMsg{margin:0;padding:6px 12px;font-size:12px;color:#ffc107;
  background:#111}
#ogInputMsg[hidden]{display:none}

/* Pointer mode on the still: own the gesture (no scroll/zoom
   stealing) and show it's live. */
#browserShot.og-ptr-on{touch-action:none;cursor:default}


/* The task bubble while it rides inside the full-screen panel:
   top center, just under the slim control bar. Same element the
   page's own updater paints in every state — this only places
   it while the takeover owns the screen. */
#ogTaskPillTop.og-r43-pill{position:absolute;top:56px;left:50%;
  transform:translateX(-50%);z-index:6;margin:0;pointer-events:none;
  box-shadow:0 4px 18px rgba(0,0,0,.55)}
/* --- Round 79: the still zooms; the chrome never does -------
   In the full (driving) state the still's zoom is an app
   transform on #browserShot alone (og_browser_input.js):
   the view clips the transformed still and owns every
   touch (touch-action:none hands pinches/pans to the JS
   handlers instead of the browser's page zoom, which used
   to scale and clip the whole control bar). The bar
   itself stays ordinary, untransformed layout —
   manipulation only, so buttons never double-tap-zoom. */
#browserPanel.og-panel-full #browserView{overflow:hidden;touch-action:none}
#browserPanel.og-panel-full #browserShot{transform-origin:50% 50%}
#browserPanel.og-panel-full #browserActions{touch-action:manipulation}

/* --- Round 321 Ticket A: THE BROWSER WINDOW ---------------
   ONE window state: the og-r43-full class (owned by
   og_browser_input.js) carries ALL the geometry here —
   the Round 61 cover fix was keyed to the page's
   og-panel-full class while the input layer ran its own
   full state, so the still kept falling back to a
   letterboxed band mid-screen (Brent's 2026-10-18 drill
   video). In the window state:
   - the panel owns the whole screen as a flex column:
     header (state + site) / page view / note / keyboard
     strip / input message / bottom bar (Stop task ·
     toggles · Fit · Take control / Hand back);
   - the STILL is the surface — the live-player iframe is
     display:none, so the picture the visitor sees is the
     picture their taps drive (the CDP input layer has
     only ever lived on the still);
   - the still shows the WHOLE PAGE by default
     (object-fit:contain — Ticket A4e: Brent's requirement
     after his drill showed cover cropping the login form's
     right edge off-screen); Fit: Fill switches it to cover
     as an explicit gesture (the og-win-fill class), the
     window opens and every confirmed take-control return
     to Width, and the pointer mapper reads the computed
     fit either way;
   - the legacy actions row, Open button and floating ✕
     are hidden — the window's own bar replaces them.
   JS sizes the panel to the visual viewport while the
   phone keyboard is up (height/top inline), so this
   column reflows ABOVE the keyboard. */
#ogWinHead,#ogWinBar{display:none}
#browserPanel.og-r43-full{position:fixed;inset:0;width:100dvw;
  height:100vh;height:100dvh;min-width:0;max-width:none;
  margin:0;border:0;border-radius:0;z-index:9000;
  display:flex;flex-direction:column;background:#0b0b0b;
  /* Ticket A follow-up (drift-state leaks): the og_shell.css
     Round 70 "Browser small bar" block keys ONLY on the
     page's og-panel-open / og-panel-full classes. When the
     window goes full on og-r43-full ALONE (the status-driven
     driving state — control already "visitor" before the
     page ever ran its full-screen path), its declarations
     leak into the full state: transform:translate(-50%,-50%)
     shifted the whole window half off-screen, and
     align-items:center / gap / padding shrank and offset
     the header, view and bar. The full window pins all
     four to the whole-screen geometry. */
  transform:none;align-items:stretch;gap:0;padding:0}
#browserPanel.og-r43-full #ogWinHead{display:flex;order:1;
  flex:0 0 auto;align-items:center;gap:6px;padding:8px 10px;
  background:#101010;border-bottom:1px solid rgba(255,193,7,.35);
  color:#f2f2f2}
#browserPanel.og-r43-full .og-browser-view{order:2;flex:1 1 auto;
  min-height:0;aspect-ratio:auto;max-height:none;
  overflow:hidden;touch-action:none;
  /* Ticket A follow-up: the same Round 70 block sets
     .og-browser-view{display:none!important} under its
     page-class guard — on the og-r43-full-only path that
     blanked the page picture outright. The id-anchored
     selector outranks it among !important declarations. */
  display:block !important}
#browserPanel.og-r43-full #browserShot{object-fit:contain;
  display:block!important;transform-origin:50% 50%}
#browserPanel.og-r43-full.og-win-fill #browserShot{object-fit:cover}
#browserPanel.og-r43-full #browserFrame{display:none!important}
#browserPanel.og-r43-full #browserTapVeil{display:none!important}
#browserPanel.og-panel-full #browserTapVeil{display:none!important}
#browserPanel.og-r43-full .og-browser-note{order:3;flex:0 0 auto}
#browserPanel.og-r43-full #ogInputMsg{order:5;flex:0 0 auto}
#browserPanel.og-r43-full #ogWinBar{display:flex;order:6;
  flex:0 0 auto;align-items:center;gap:6px;flex-wrap:wrap;
  padding:8px;background:#101010;
  border-top:1px solid rgba(255,193,7,.35);
  touch-action:manipulation}
#browserPanel.og-r43-full #browserActions{display:none!important}
#browserPanel.og-r43-full #browserOpenBtn{display:none!important}
#browserPanel.og-r43-full .og-browser-x{display:none!important}
.og-win-state{font-weight:700;color:#ffc107;font-size:.92rem;
  white-space:nowrap}
.og-win-site{color:#e8e8e8;font-size:.92rem;white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis}
.og-win-meta{margin-left:auto;color:#bbb;font-size:.78rem;
  white-space:nowrap}
#ogWinClose{flex:0 0 auto;width:38px;height:38px;border-radius:50%;
  border:1px solid #333;background:#1b1b1b;color:#e8e8e8;
  font-size:15px;cursor:pointer;font-family:inherit}
/* Ticket N: the window's bottom bar buttons are real
   icon+label buttons — tall, rounded, obviously
   tappable, never bare text. */
#ogWinBar button{border:1px solid rgba(255,193,7,.5);
  background:#1d1d1d;color:#ffc107;border-radius:16px;
  padding:10px 16px;font-size:.9rem;font-weight:700;cursor:pointer;
  font-family:inherit;white-space:nowrap;min-height:50px}
#ogWinBar button:hover{background:rgba(255,193,7,.18)}
#ogWinBar .og-win-stop{border-color:rgba(255,110,110,.55);
  color:#ff9d9d}
#ogWinBar .og-win-take{margin-left:auto;background:#ffc107;
  border-color:#ffc107;color:#151515;font-weight:800}

/* --- Round 321 Ticket A4: the pointer marker -------------
   The stills carry no OS pointer, so og_browser_input.js
   renders this arrow OVER the still at the last known
   pointer position (the visitor's own taps/drags, mapped
   through the same frame math as the input path). It is
   a child of the view, so the view clips it at the page
   edges; pointer-events:none — it never eats a tap. Its
   left/top IS the arrow's tip (the SVG path starts at
   1,1), which is the point the gate measures. Visibility
   is the JS staleness rule (hidden attribute); this block
   only paints it. */
#ogPtrMark{position:absolute;z-index:7;width:20px;height:20px;
  margin:0;padding:0;pointer-events:none;
  filter:drop-shadow(0 1px 2px rgba(0,0,0,.65))}
#ogPtrMark[hidden]{display:none}
#ogPtrMark svg{display:block}


/* Neutral browser chrome. Scoped: OG chat and dashboards keep their theme. */
body.og-brpage-open,body.og-r43-lock{overscroll-behavior-x:none}
body #ogBrowserPage{background:#fff;color:#202124;overscroll-behavior-x:none}
body #ogBrowserPage .og-brp-head,body #ogBrowserPage .og-brp-tabbar,
body #ogBrowserPage .og-brp-addrbar{background:#f1f3f4;border-color:#dadce0}
body #ogBrowserPage .og-brp-face,body #ogBrowserPage .og-brp-home-mark{display:none}
body #ogBrowserPage .og-brp-home{background:#fff}
body #ogBrowserPage .og-brp-state,body #ogBrowserPage .og-brp-home-msg,
body #ogBrowserPage .og-brp-home-meta{color:#5f6368}
body #ogBrowserPage .og-brp-tab{background:#e8eaed;border-color:#dadce0}
body #ogBrowserPage .og-brp-tab-cur{background:#fff;border-color:#dadce0}
body #ogBrowserPage .og-brp-tab-dot{color:#5f6368}
body #ogBrowserPage .og-brp-tab-label,body #ogBrowserPage .og-brp-tab-x{color:#202124}
body #ogBrowserPage .og-brp-addr,body #ogBrowserPage .og-brp-start-input{
 background:#fff;color:#202124;border-color:#dadce0;font-size:16px}
body #ogBrowserPage button,body #ogBrowserPage .og-brp-pending button{
 background:#fff;color:#202124;border:1px solid #dadce0}
body #ogBrowserPage button:hover{background:#e8eaed;border-color:#9aa0a6;color:#202124}
body #ogBrowserPage .og-brp-go,body #ogBrowserPage .og-brp-start-btn{
 background:#1a73e8;color:#fff;border-color:#1a73e8}
body #ogBrowserPage .og-brp-pending{background:#f1f3f4;color:#202124;border-color:#dadce0}
body #ogBrowserPage #browserPanel,#browserPanel.og-r43-full{background:#fff;color:#202124}
#browserPanel.og-r43-full #ogWinHead,#browserPanel.og-r43-full #ogWinBar{
 background:#f1f3f4;border-color:#dadce0;color:#202124}
#browserPanel .og-win-state,#browserPanel .og-win-site{color:#202124}
#browserPanel .og-win-meta{color:#5f6368}
#browserPanel #ogWinClose,#browserPanel #ogWinBar button{
 background:#fff;color:#202124;border-color:#dadce0;border-radius:8px}
#browserPanel #ogWinBar button:hover{background:#e8eaed}
#browserPanel #ogWinBar .og-win-take{background:#1a73e8;color:#fff;border-color:#1a73e8}
#browserPanel #ogWinBar .og-win-stop{color:#b3261e}
#browserPanel #ogInputMsg,#browserPanel .og-browser-note{
 background:#f1f3f4;color:#5f6368;border-color:#dadce0}
body #ogBrowserPage :focus-visible,#browserPanel :focus-visible{
 outline:2px solid #1a73e8;outline-offset:2px}

/* Trusted-gesture recovery when a mobile browser blocks async keyboard focus. */
#browserPanel #ogTypeField{position:absolute;z-index:12;left:50%;bottom:12px;
 transform:translateX(-50%);max-width:calc(100% - 24px);min-height:44px;padding:12px 18px;
 border:1px solid #dadce0;border-radius:24px;background:#fff;color:#202124;
 font:inherit;font-size:16px;box-shadow:0 2px 8px #0002;touch-action:manipulation}
#browserPanel #ogTypeField[hidden]{display:none!important}
