/* The replica's behaviour: tabs, panes, the terminal view, the Tree sidebar, the view menu, motion.
 * Loaded after hero.css (which is the still picture, checked against the real window). */

.hz-pane[hidden], .div-v[hidden], .div-h[hidden] { display: none; }
.no-sidebar { --sidebar-w: 0px; }
.no-sidebar .sidebar, .no-sidebar .tb-opts { display: none; }
.no-sidebar .sb-tone { border-right: 0; }
.no-sidebar .tabs { left: 134px; }

/* the pane that has the focus carries the accent tag; a running agent's tag breathes */
.hz-pane.sel .tag-in { background: var(--c-accent); color: var(--c-on-accent); }
.hz-pane.sel.run .tag-in { opacity: var(--breath, .68); }
:root[data-theme="dark"] .hz-app { --breath: .68; }
:root[data-theme="light"] .hz-app { --breath: .93; }

/* dividers: a hairline, a wider hit area, the accent while hovered or dragged */
.div-v, .div-h { z-index: 3; }
.div-v { width: 9px; margin-left: -4px; cursor: col-resize; background: linear-gradient(rgb(var(--hairline-rgb) / .10), rgb(var(--hairline-rgb) / .10)) center / 1px 100% no-repeat; }
.div-h { height: 9px; margin-top: -4px; cursor: row-resize; background: linear-gradient(rgb(var(--hairline-rgb) / .10), rgb(var(--hairline-rgb) / .10)) center / 100% 1px no-repeat; }
.div-v:hover, .dragging .div-v { background: linear-gradient(var(--c-accent), var(--c-accent)) center / 1px 100% no-repeat; }
.div-h:hover, .dragging .div-h { background: linear-gradient(var(--c-accent), var(--c-accent)) center / 100% 1px no-repeat; }
.dragging { cursor: grabbing; }

/* the terminal view of a pane: Herdr's own pane, as xterm.js plays it */
.termv { display: none; position: absolute; inset: 26px 0 0 0; background: var(--c-terminal-background); }
.hz-pane.term-on .p-body { display: none; }
.hz-pane.term-on .termv { display: block; }
.termhost { padding: 6px 8px; height: 100%; overflow: hidden; }
.termhost .xterm { height: 100%; }
.xterm .xterm-viewport { background: transparent !important; overflow: hidden !important; }
.tchip-ic { display: inline-flex; cursor: pointer; }

/* the composers and the answer card take typing */
.ph-in { position: relative; top: -1px; flex: 1 1 0; min-width: 0; height: 28px; padding: 0 8px; border: 0; outline: 0; background: transparent; color: var(--c-text); font: 400 var(--composer-input-text-size) / var(--composer-input-line-height) "Geist", sans-serif; user-select: text; }
.ph-in::placeholder { color: var(--c-text-faint); opacity: 1; }
.pill-in:focus-within { border-color: var(--c-border-strong); }
.pill-in .send { cursor: pointer; }
.wait-in { display: block; width: 100%; height: 42.65px; border: 0; outline: 0; background: transparent; padding: 12px 4px 8px; color: var(--c-text); font: 400 14.4px/22.65px "Geist", sans-serif; user-select: text; }
.wait-in::placeholder { color: var(--c-text-faint); opacity: 1; }
.wait-btn { cursor: pointer; }
.wait.ready .wait-btn { background: var(--c-solid); color: var(--c-on-solid); }
.wait.answered .wait-q { color: var(--c-text-muted); }
.ubub.sent { margin-top: 24px; width: auto; max-width: 468px; }
.md.reply { margin-top: 24px; margin-bottom: 14px; min-height: 22px; }
.transcript.fade { -webkit-mask-image: linear-gradient(to bottom, transparent 24px, #000 42px); mask-image: linear-gradient(to bottom, transparent 24px, #000 42px); }
.stamp.inline { margin: 12px 0 0; }
/* a wide pane keeps its conversation to a readable column (composer_target_width) */
.hz-pane.wide .tr-col { width: min(100%, 832px); margin: 0 auto; padding-bottom: 12px; }
.hz-pane.wide .composer { width: min(100%, 768px); margin: 0 auto; }
.hz-pane.wide .transcript { padding-bottom: 8px; }
.hz-pane.wide.pn-healthz .transcript { padding-bottom: 38px; }

/* the Tree sidebar (hz_tabs.rs, WorkspaceStyle::Tree): fold arrow, panes as rows with a connector */
.ws-list.tree { padding-left: 14px; }
.ws-row.tree { height: 30px; padding: 0 8px; align-items: center; margin-bottom: 1px; }
.ws-row.tree .fold { width: 16px; height: 16px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 4px; }
.ws-row.tree.current { background: rgb(var(--wash-rgb) / .04); }
.ws-row.tree .ws-name { font-weight: 500; }
.pane-row { display: flex; align-items: flex-start; height: 27px; }
.pane-row .conn { flex: none; position: relative; width: 24px; height: 100%; }
.pane-row .conn i:first-child { position: absolute; left: 15.5px; top: 0; bottom: 0; width: 1px; background: color-mix(in srgb, var(--c-text-faint) 45%, transparent); }
.pane-row.last .conn i:first-child { bottom: auto; height: 13px; }
.pane-row .conn i:last-child { position: absolute; left: 16px; top: 13px; width: 8px; height: 1px; background: color-mix(in srgb, var(--c-text-faint) 45%, transparent); }
.pane-row .row { flex: 1 1 0; min-width: 0; height: 26px; padding: 0 8px; display: flex; align-items: center; gap: 8px; border-radius: 7px; font-size: 13px; cursor: pointer; }
.pane-row .row.current { background: rgb(var(--wash-rgb) / .09); }
.pane-row .row:hover { background: rgb(var(--wash-rgb) / .05); }
.pane-row .hz-num { flex: none; width: 12px; text-align: center; font-size: 11px; color: var(--c-text-faint); }
.ag-row { cursor: pointer; }
.ag-row:hover:not(.current) { background: rgb(var(--wash-rgb) / .05); }

/* the sidebar's view menu (popover.rs: card radius 12, inset 4, rows 8/6 px, 13 px) */
.tb-opts { z-index: 20; }
.wc[data-act] { cursor: pointer; }
.wc.open { background: var(--c-fn-glass-hover); }
.pop { background: var(--c-fn-glass-overlay); border: 1px solid var(--c-border); border-radius: var(--popover-card-radius); padding: var(--popover-card-inset); box-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1); font-size: 13px; color: var(--c-text); }
/* anchored_menu_right: the card opens 6 px past the trigger, at its top */
.pop.menu { position: absolute; top: 9px; left: 30px; width: calc(var(--sidebar-w) - 2 * var(--ui-space-sm)); display: flex; flex-direction: column; gap: var(--popover-menu-gap); }
.mgroup { position: relative; }
.mrow { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--popover-menu-item-radius); cursor: pointer; }
.mrow.hz-nav { height: 30px; padding-top: 0; padding-bottom: 0; }
.mrow:hover, .mgroup.open > .mrow.hz-nav, .mrow.on { background: rgb(var(--wash-rgb) / .11); }
.mval { color: var(--c-text-muted); }
.cslot { width: 14px; flex: none; }
.pop.hz-sub { display: none; position: absolute; left: calc(100% + 6px); top: 0; width: 232px; flex-direction: column; gap: var(--popover-menu-gap); }
.mgroup.open > .pop.hz-sub { display: flex; }
.mhead { padding: 6px 8px 4px; font-size: 10px; font-weight: 500; letter-spacing: .1em; color: var(--c-text-muted); }

/* motion (not in a still frame) */
@keyframes hz-breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes hz-dot { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.hz-app:not([data-still]) .hz-pane.sel.run .tag-in { animation: hz-breathe 2.4s ease-in-out infinite; }
.hz-app:not([data-still]) .glyph-spin b { animation: hz-dot 1.2s ease-in-out infinite; }
.hz-app:not([data-still]) .glyph-spin b:nth-child(2) { animation-delay: .1s; }
.hz-app:not([data-still]) .glyph-spin b:nth-child(3) { animation-delay: .2s; }
.hz-app:not([data-still]) .glyph-spin b:nth-child(4) { animation-delay: .3s; }
.hz-app:not([data-still]) .glyph-spin b:nth-child(5) { animation-delay: .4s; }
.hz-app:not([data-still]) .glyph-spin b:nth-child(6) { animation-delay: .5s; }
.hz-app:not([data-still]) .glyph-spin b:nth-child(7) { animation-delay: .6s; }
.hz-app:not([data-still]) .glyph-spin b:nth-child(8) { animation-delay: .7s; }
.hz-app:not([data-still]) .glyph-spin b:nth-child(9) { animation-delay: .8s; }

/* the page: the replica takes the hero's place once it is mounted and the screen is wide enough; the picture is the fallback */
.hero-live { margin-top: 64px; }
.hero-live .hero-shot { margin-top: 0; }
.hero-live .hz-fallback { display: block; }
.hero-live.on .hz-fallback { display: none; }
.hero-frame { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--c-surface); }
.hero-live:not(.on) .hero-frame { position: absolute; visibility: hidden; height: 0; width: 100%; border: 0; }
.hz-narrow .hz-app { display: none; }
@media (prefers-reduced-motion: reduce) { .hz-app *, .hz-app *::before, .hz-app *::after { animation: none !important; } }
