/* Copyright (c) 2026 Bang Technology. All rights reserved.
Part of Vineyard Console, built by Bang Technology for Vineyard Church Greenwood. See NOTICE. */
/* The right panel (static/rpanel.js): the mark's own box, a side card's dock mirrored
   on the right of the chat column, and the live work flow inside it. Inside
   #stage at a side card's level (z 5): under the header/footer and the drawer. */
#rpanel{position: absolute;z-index: 5;top: 8px;bottom: 8px;overflow: hidden;border-radius: 16px;color: var(--text);
  background: radial-gradient(ellipse at 50% 38%, var(--rp-bg-1, #15193a) 0%, var(--rp-bg-2, #0c0d22) 55%, var(--rp-bg-3, #07070f) 100%);
  border: 1px solid var(--surface-border);box-shadow: 0 6px 28px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(0, 0, 0, .4);}
#rpanel[hidden]{display: none;}
/* the mark, centred and sized to fit; dimmed once there is something to read over it */
#rpanel .rpart{position: absolute;inset: 0 0 44px;background: url("/static/brand/mark.png") center / min(92%, 88vh) no-repeat;transition: opacity .4s;}
#rpanel.content .rpart{opacity: .13;}
/* no previews: the bottom half is empty, and the mark is there to be seen in it */
#rpanel.content:not(.hasthumbs) .rpart{opacity: var(--rp-art-a, .35);}
#rpanel .rpbody{position: absolute;inset: 0;transition: opacity .4s;}
#rpanel.faded .rpbody{opacity: .78;}
#rpanel.faded .rpbody:hover{opacity: 1;}
#rpanel section{min-height: 0;border-radius: 12px;padding: 10px 12px;background: rgba(var(--ink-rgb), .72);border: 1px solid var(--surface-border);overflow-y: auto;overscroll-behavior: contain;scrollbar-width: thin;scrollbar-color: var(--scrollbar-thumb) transparent;}
#rpanel section[hidden]{display: none;}
#rpanel h4{margin: 0 0 8px;font-size: 11px;font-weight: 600;letter-spacing: .1em;text-transform: uppercase;color: var(--text-caption);display: flex;justify-content: space-between;gap: 8px;}
#rpanel .rpcount{color: var(--text-caption);font-variant-numeric: tabular-nums;letter-spacing: .04em;}
#rpanel ol{list-style: none;margin: 0;padding: 0;display: flex;flex-direction: column;gap: 4px;}
#rpanel li{display: flex;align-items: baseline;gap: 8px;font-size: 13px;line-height: 1.4;min-width: 0;}
/* status marks, drawn here rather than as emoji: done ✓, running (pulsing dot), to do □, paused ‖, waiting ○, failed ✕ */
#rpanel .rpi{flex: none;position: relative;align-self: flex-start;width: 14px;height: 14px;margin-top: 2px;border-radius: 4px;box-sizing: border-box;}
#rpanel li.completed > .rpi{background: rgba(76, 175, 130, .9);}
#rpanel li.completed > .rpi::after{content: "";position: absolute;left: 4.5px;top: 1.5px;width: 4px;height: 7.5px;border: solid #08140e;border-width: 0 2px 2px 0;transform: rotate(45deg);}
#rpanel li.in_progress > .rpi{border-radius: 50%;border: 2px solid var(--accent);}
#rpanel li.in_progress > .rpi::after{content: "";position: absolute;inset: 2px;border-radius: 50%;background: var(--accent-text);animation: rppulse 1.1s ease-in-out infinite;}
#rpanel li.pending > .rpi{border: 1.5px solid #6E6E8C;}
#rpanel li.paused > .rpi{border: 1.5px solid var(--amber);}
#rpanel li.paused > .rpi::after{content: "";position: absolute;left: 3.5px;top: 3px;width: 1.5px;height: 5px;border: solid var(--amber);border-width: 0 1.5px;padding: 0 1px;}
#rpanel li.idle > .rpi{border-radius: 50%;border: 1.5px dashed #6E6E8C;}
#rpanel li.failed > .rpi{background: rgba(229, 57, 53, .85);}
#rpanel li.failed > .rpi::before, #rpanel li.failed > .rpi::after{content: "";position: absolute;left: 6px;top: 2.5px;width: 2px;height: 9px;background: #fff;transform: rotate(45deg);}
#rpanel li.failed > .rpi::before{transform: rotate(-45deg);}
#rpanel .rpt{flex: 1 1 auto;min-width: 0;overflow-wrap: anywhere;}
#rpanel .rpsteps li.completed .rpt{color: var(--text-caption);}
#rpanel .rpsteps li.in_progress .rpt{color: var(--text);font-weight: 600;}
#rpanel .rpsteps li.pending .rpt, #rpanel .rpsteps li.paused .rpt, #rpanel .rpsteps li.idle .rpt{color: #9C9CB8;}
#rpanel .rprows li{padding: 3px 0;border-top: 1px solid var(--surface-border);}
#rpanel .rprows li:first-child{border-top: 0;}
#rpanel .rprows b{display: block;font-weight: 500;color: var(--text);}
#rpanel .rprows small{display: block;font-size: 11.5px;color: var(--text-caption);white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}
#rpanel .rprows small:empty{display: none;}
#rpanel .rprows time{flex: none;font-size: 11px;color: var(--text-caption);font-variant-numeric: tabular-nums;}
#rpanel .rprows li.in_progress b{color: var(--accent-text);}
#rpanel .rprows li.failed b{color: var(--danger-text);}
#rpanel .rpnow{display: flex;align-items: center;gap: 8px;margin: -2px 0 8px;font-size: 12px;color: var(--accent-text);overflow-wrap: anywhere;}
#rpanel .rpnow[hidden], #rpanel .rpnow:empty{display: none;}
#rpanel .rpnow::before{content: "";flex: none;width: 7px;height: 7px;border-radius: 50%;background: var(--accent);animation: rppulse 1.1s ease-in-out infinite;}
@keyframes rppulse { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
#rpanel .rpprog{margin: 0 0 8px;font-size: 11.5px;color: var(--text-caption);}
#rpanel .rpprog[hidden]{display: none;}
#rpanel .rpprogt{height: 6px;margin-top: 4px;border-radius: 3px;background: rgba(255, 255, 255, .1);overflow: hidden;}
#rpanel .rpprogt i{display: block;height: 100%;border-radius: 3px;background: var(--amber);}
#rpanel .rpmd{margin-top: 8px;font-size: 12.5px;color: var(--text);}
#rpanel .rpmd[hidden], #rpanel .rpmd:empty{display: none;}
#rpanel .rpmd > :first-child{margin-top: 0;}
#rpanel .rpmd > :last-child{margin-bottom: 0;}
#rpanel .rpmd p{margin: 0 0 8px;}
#rpanel .rpmd .tw{overflow-x: auto;margin: 0 0 6px;max-width: 100%;}
#rpanel .rpmd table{border-collapse: collapse;font-size: 12px;}
#rpanel .rpmd th, #rpanel .rpmd td{border: 1px solid var(--surface-border);padding: 3px 7px;text-align: left;vertical-align: top;white-space: nowrap;}
#rpanel .rpmd th{background: rgba(var(--surface-rgb), .6);font-weight: 600;}
#rpanel .rpmd code{font-family: ui-monospace, SFMono-Regular, Menlo, monospace;font-size: .9em;}
#rpanel .rpsrc{margin-top: 8px;font-size: 10.5px;letter-spacing: .03em;color: #8A8AA6;}
/* the name bar, as a side card's: at the bottom, name + state */
#rpanel .rpbar{position: absolute;left: 0;right: 0;bottom: 0;height: 44px;display: flex;align-items: center;gap: 8px;padding: 0 16px;font-size: 12px;line-height: 1;background: linear-gradient(transparent, rgba(var(--nav-rgb), .82) 40%);}
#rpanel .rpname{font-weight: 600;letter-spacing: .08em;text-transform: uppercase;color: var(--text-caption);font-size: 11px;}
#rpanel .rpstate{color: var(--text-caption);min-width: 0;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;font-variant-numeric: tabular-nums;}
#rpanel.busy .rpname::after{content: "";display: inline-block;width: 6px;height: 6px;margin-left: 8px;border-radius: 50%;background: var(--accent);vertical-align: 1px;animation: rppulse 1.1s ease-in-out infinite;}
/* moving and resizing: the same control as a side card's floating card . The content
   keeps its scrolling and selection; everything else in the box is the drag handle. */
#rpanel{cursor: grab;touch-action: none;user-select: none;-webkit-user-select: none;}
#rpanel section{cursor: auto;touch-action: auto;user-select: text;-webkit-user-select: text;}
/* a title stays in view while its section scrolls, so a full box always has a handle at the top */
#rpanel h4{cursor: grab;touch-action: none;user-select: none;-webkit-user-select: none;position: sticky;top: -10px;z-index: 1;margin: -10px -12px 4px;padding: 10px 12px 4px;background: var(--rp-head, #0b0b1e);}
#rpanel.float{z-index: 6;bottom: auto;}
#rpanel.front{z-index: 11;}
/* touch screens: the dashboard's pull-up strip (z 10) spans the stage; with the box up it keeps to the chat column, clear of the bar and grip */
body.rp #sheetpeek{left: max(0px, calc(50% - 360px));right: max(0px, calc(50% - 360px));}
#rpanel.dragging, #rpanel.dragging h4{cursor: grabbing;}
#rpanel.dragging{box-shadow: 0 16px 44px rgba(0, 0, 0, .6);}
#rpanel.dragging section, #rpanel.sizing section{user-select: none;-webkit-user-select: none;}
#rpanel .rpbar{padding-right: 30px;}
#rpanel .rppop{flex: none;display: grid;place-items: center;width: 30px;height: 30px;margin-left: auto;padding: 0;border: 0;border-radius: 9px;font: inherit;color: var(--text-secondary);background: rgba(var(--ink-rgb), .55);cursor: pointer;touch-action: manipulation;}
#rpanel .rppop svg{display: block;}
#rpanel .rppop:hover, #rpanel .rppop:focus-visible{color: var(--text);background: rgba(var(--ink-rgb), .8);}
#rpanel .rppop[aria-pressed="true"]{color: var(--text);}
/* the pop-out / dock button: a tile to the right of the conversation tabs, a header tile
   (38 px, 6 px off the tabs) in dark glass with a hairline edge, the site's mark on it.
   No tabs to sit by (short landscape phones): the stage's top-right. */
#rpctl{position: absolute;z-index: 12;right: 10px;top: 10px;width: 38px;height: 38px;padding: 0;border-radius: 11px;overflow: hidden;cursor: pointer;touch-action: manipulation;transition: background-color .15s, border-color .15s;
  background: rgba(var(--ink-rgb), .62);border: 1px solid var(--input-border);backdrop-filter: blur(6px);-webkit-backdrop-filter: blur(6px);}
#rpctl[hidden]{display: none;}
#rpctl::before{content: "";position: absolute;inset: 0;background: url("/static/brand/mark.png") center / 28px 28px no-repeat;}
#rpctl.attabs{position: fixed;z-index: 33;right: auto;}
#rpctl:hover, #rpctl:focus-visible{background: rgba(var(--surface-rgb), .9);border-color: var(--text-secondary);}
#rpctl[aria-pressed="true"]{background: var(--accent-muted);border-color: var(--accent-border);}
/* too narrow for the tile beside the centred tabs: they give up its 44 px. nav#: the page's
   own #convtabs rule comes after this file and would win a tie. */
@media (max-width: 823px) {nav#convtabs{width: calc(100% - 44px);margin: 0;}}
#rpanel .rpgrip{position: absolute;right: 0;bottom: 0;z-index: 2;width: 26px;height: 26px;cursor: nwse-resize;touch-action: none;}
#rpanel .rpgrip::after{content: "";position: absolute;right: 6px;bottom: 6px;width: 10px;height: 10px;border-right: 2px solid var(--scrollbar-thumb);border-bottom: 2px solid var(--scrollbar-thumb);border-radius: 0 0 3px 0;}
#rpanel .rpgrip:focus-visible{outline: 2px solid var(--accent);outline-offset: -4px;border-radius: 6px;}
@media (pointer: coarse) {#rpanel .rppop{width: 40px;height: 40px;}#rpanel .rpbar{padding-right: 38px;}#rpanel .rpgrip{width: 36px;height: 36px;}}
/* The H's neon glow (rpanel.js glow()): blue glass, the orange frame, the equations
   brightest, the floor, a slight tilt and a light sweep, then rest. One timeline of
   GLOW_MS, compositor properties only; the layers exist only while it plays. */
#rpanel.glow .rpart{animation: rpgtilt 3.8s linear both;}
#rpanel.glowlift .rpart{opacity: 1;}
#rpanel.glowlift .rpbody{opacity: .1;}
#rpanel.glowlift .rpbody:hover{opacity: 1;}
#rpanel .rpglow{position: absolute;inset: 0;transition: opacity .25s;}
#rpanel.glowhurry .rpglow{opacity: 0;}
/* each layer lies exactly over the .rpart background */
#rpanel .rpg{position: absolute;inset: 0;margin: auto;width: min(92%, 88vh);height: auto;aspect-ratio: 787 / 788;animation: 3.8s linear both;mix-blend-mode: plus-lighter;opacity: 0;}
#rpanel .rpg-amb{width: 100%;height: 100%;aspect-ratio: auto;background: radial-gradient(ellipse 46% 34% at 50% 44%, rgba(46, 110, 255, .34), transparent 70%), radial-gradient(ellipse 46% 7% at 50% 67%, rgba(255, 128, 30, .3), transparent 72%);animation-name: rpgamb;}
#rpanel .rpg-dim{background: #03030a;mix-blend-mode: normal;-webkit-mask: url("/static/brand/mark.png") center / 100% 100% no-repeat;mask: url("/static/brand/mark.png") center / 100% 100% no-repeat;animation-name: rpgdim;}
#rpanel .rpg-glass{animation-name: rpgglass;}
#rpanel .rpg-frame{animation-name: rpgframe;}
#rpanel .rpg-eq{animation-name: rpgeq;}
#rpanel .rpg-floor{animation-name: rpgfloor;}
#rpanel .rpg-sweep{overflow: hidden;-webkit-mask: url("/static/brand/mark.png") center / 100% 100% no-repeat;mask: url("/static/brand/mark.png") center / 100% 100% no-repeat;animation-name: rpgshow;}
#rpanel .rpg-sweep i{position: absolute;top: 0;bottom: 0;left: 0;width: 42%;background: linear-gradient(100deg, transparent 8%, rgba(255, 255, 255, .14) 36%, rgba(255, 255, 255, .42) 50%, rgba(255, 255, 255, .14) 64%, transparent 92%);animation: rpgsweep 3.8s linear both;}
@keyframes rpgtilt {
0%{transform: perspective(900px);animation-timing-function: ease-in-out;}
32%{transform: perspective(900px) rotateY(-6deg) rotateX(1.6deg);animation-timing-function: ease-in-out;}
68%{transform: perspective(900px) rotateY(5deg) rotateX(-1.2deg);animation-timing-function: ease-in-out;}
100%{transform: perspective(900px);}
}
@keyframes rpgamb { 0%, 8%{opacity: 0;} 50%{opacity: 1;} 72%{opacity: .85;} 100%{opacity: 0;} }
@keyframes rpgdim { 0%{opacity: 0;} 7%{opacity: .62;} 30%{opacity: .5;} 76%{opacity: .34;} 100%{opacity: 0;} }
@keyframes rpgglass { 0%, 5%{opacity: 0;} 8%{opacity: .75;} 10%{opacity: .2;} 13%{opacity: .9;} 15%{opacity: .45;} 24%{opacity: 1;} 58%{opacity: .85;} 90%, 100%{opacity: 0;} }
@keyframes rpgframe { 0%, 19%{opacity: 0;} 22%{opacity: .6;} 24%{opacity: .2;} 36%{opacity: 1;} 64%{opacity: .85;} 93%, 100%{opacity: 0;} }
@keyframes rpgeq { 0%, 30%{opacity: 0;} 33%{opacity: .7;} 35%{opacity: .25;} 46%{opacity: 1;} 72%{opacity: 1;} 96%, 100%{opacity: 0;} }
@keyframes rpgfloor { 0%, 42%{opacity: 0;} 58%{opacity: 1;} 74%{opacity: .85;} 98%, 100%{opacity: 0;} }
@keyframes rpgshow { 0%, 36%{opacity: 0;} 40%, 64%{opacity: 1;} 70%, 100%{opacity: 0;} }
@keyframes rpgsweep { 0%, 36%{transform: translateX(-110%);} 70%, 100%{transform: translateX(250%);} }
/* the jump-to-latest button stays over the chat, not over the box */
body.rp #jump{right: calc(16px + var(--rp-w, 0px));}
@media (prefers-reduced-motion: reduce) {#rpanel .rpart, #rpanel .rpbody{transition: none;}
#rpanel li.in_progress > .rpi::after, #rpanel .rpnow::before, #rpanel.busy .rpname::after{animation: none;}
#rpanel.glow .rpart, #rpanel .rpg, #rpanel .rpg-sweep i{animation: none;}}
/* The work above; the thumbnails (imagepeek.py) in the bottom quarter when there are any. */
/* The box in two parts split 3/4 of the way down, each scrolling on its own, so a long
   plan cannot push the previews out of view and the layout never moves when they come. */
/* A short box moves the line up (never past the middle) so a row of previews still fits. */
#rpanel{--rpsplit: max(50%, min(75%, 100% - 190px));}
#rpanel .rptop{position: absolute;left: 16px;right: 14px;top: 14px;bottom: calc(100% - var(--rpsplit) + 7px);overflow-y: auto;overscroll-behavior: contain;scrollbar-width: thin;scrollbar-color: var(--scrollbar-thumb) transparent;touch-action: pan-y;}
#rpanel .rptop > section{overflow: visible;}
#rpanel .rptop h4{top: 0;}
/* A long turn scrolls in its own list, following the newest, so the other chats stay close below it. */
#rpanel .rprows{max-height: 150px;overflow-y: auto;scrollbar-width: thin;scrollbar-color: var(--scrollbar-thumb) transparent;}
#rpanel .rptop > * + *{margin-top: 10px;}
#rpanel .rptop > [hidden] + *{margin-top: 0;}
#rpanel .rpthumbs{position: absolute;left: 16px;right: 14px;top: calc(var(--rpsplit) + 7px);bottom: 54px;display: flex;flex-direction: column;overflow: hidden;}
#rpanel .rpdiv{position: absolute;left: 10px;right: 10px;top: calc(var(--rpsplit) - .5px);height: 1px;pointer-events: none;background: linear-gradient(90deg, transparent, var(--surface-border) 22%, var(--text-muted) 50%, var(--surface-border) 78%, transparent);transition: opacity .4s;}
#rpanel:not(.content) .rpdiv{opacity: 0;}
/* Each line's text in its chat's colour (--chat, from the chat it belongs to); the marks keep their own. */
#rpanel .rpchatname{margin: 0;padding: 5px 12px;border-radius: 10px;background: rgba(var(--ink-rgb), .72);font-size: 12px;font-weight: 600;color: var(--chat, var(--text));display: flex;justify-content: space-between;gap: 8px;}
#rpanel .rpchatname[hidden]{display: none;}
#rpanel .rpchatname small{flex: none;font-weight: 400;color: var(--text-caption);}
#rpanel .rpsteps li .rpt, #rpanel .rpsteps li.completed .rpt, #rpanel .rpsteps li.in_progress .rpt, #rpanel .rpsteps li.pending .rpt, #rpanel .rpsteps li.paused .rpt, #rpanel .rpsteps li.idle .rpt{color: var(--chat, var(--text));}
#rpanel .rprows li b, #rpanel .rprows li.in_progress b, #rpanel .rprows li.failed b, #rpanel .rprows small, #rpanel .rpnow{color: var(--chat, var(--text));}
#rpanel .rpnow::before{background: var(--chat, var(--accent));}
#rpanel .rpthumbs h4{flex: none;}
#rpanel .rpgrid{flex: 1 1 auto;min-height: 0;overflow-y: auto;overscroll-behavior: contain;scrollbar-width: thin;scrollbar-color: var(--scrollbar-thumb) transparent;display: grid;grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));grid-auto-rows: min-content;gap: 8px;align-content: start;}
#rpanel .rptile{display: flex;flex-direction: column;gap: 3px;min-width: 0;}
#rpanel .rptopen{all: unset;display: block;cursor: zoom-in;border-radius: 8px;touch-action: manipulation;}
#rpanel .rptopen:focus-visible{outline: 2px solid var(--accent);outline-offset: 1px;}
#rpanel .rptimg{position: relative;display: block;aspect-ratio: 1;border-radius: 7px;overflow: hidden;background: rgba(0, 0, 0, .35);border: 2px solid var(--chat, var(--surface-border));}
#rpanel .rptimg img{position: absolute;inset: 0;width: 100%;height: 100%;object-fit: cover;}
#rpanel .rptimg img.fresh{animation: rppeekin .4s ease-out;}
@keyframes rppeekin { from { opacity: 0; } to { opacity: 1; } }
#rpanel .rptimg.waiting::after{content: "";position: absolute;left: 50%;top: 50%;width: 10px;height: 10px;margin: -5px;border-radius: 50%;background: var(--accent);animation: rppulse 1.1s ease-in-out infinite;}
/* Whole and selectable: a long name wraps, a long prompt scrolls in its own few lines. */
#rpanel .rptl{font-size: 11px;line-height: 1.25;color: var(--text-caption);overflow-wrap: anywhere;}
#rpanel .rptp{font-size: 11px;line-height: 1.25;max-height: 5em;overflow-y: auto;overscroll-behavior: contain;color: var(--text-caption);overflow-wrap: anywhere;scrollbar-width: thin;scrollbar-color: var(--scrollbar-thumb) transparent;}
#rpanel .rptp:empty{display: none;}
#rpanel .rpcopy{all: unset;align-self: flex-start;font-size: 11px;color: var(--accent-text);cursor: pointer;}
#rpanel .rpcopy[hidden]{display: none;}
#rpanel .rpcopy:focus-visible{outline: 2px solid var(--accent);outline-offset: 1px;}
#rpanel .rptile.gen .rptl{color: var(--accent-text);}
#rpanel .rpchat + .rpchat{margin-top: 8px;padding-top: 8px;border-top: 1px solid var(--surface-border);}
#rpanel .rpchat h5{margin: 0 0 4px;font-size: 12px;font-weight: 600;color: var(--chat, var(--text));display: flex;justify-content: space-between;gap: 8px;}
#rpanel .rpchat h5 small{flex: none;font-weight: 400;color: var(--text-caption);}
#rpanel .rpchat li{font-size: 12px;color: var(--chat, var(--text));}
#rpanel .rpchat b{display: block;font-weight: 500;}
#rpanel .rpchat small{display: block;font-size: 11px;color: var(--chat, var(--text-caption));white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}
#rpanel .rpchat small:empty{display: none;}
/* The big version: above everything, and never a target for the pointer. */
#rpbig{position: fixed;z-index: 900;pointer-events: none;display: flex;flex-direction: column;border-radius: 12px;overflow: hidden;background: var(--rp-bg-3, #07070f);border: 2px solid var(--chat, var(--surface-border));box-shadow: 0 12px 44px rgba(0, 0, 0, .6);}
#rpbig[hidden]{display: none;}
#rpbig img{flex: 1 1 auto;min-height: 0;width: 100%;object-fit: contain;display: block;}
#rpbig.noimg img{display: none;}
#rpbig .rpbigtext{display: none;}
#rpbig.noimg .rpbigtext{display: block;flex: 1 1 auto;min-height: 0;overflow: hidden;padding: 14px;font-size: 13px;color: var(--text);overflow-wrap: anywhere;}
#rpbig .rpbigcap{flex: none;height: 34px;line-height: 34px;padding: 0 10px;font-size: 12px;color: var(--text-caption);white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}
@media (prefers-reduced-motion: reduce){#rpanel .rptimg img.fresh{animation: none;}}
