/* Panels (panels.js, docs/CONSOLE-REDESIGN.md §3.3): list, detail and context side by side on the content surface,
   1 px dividers, no boxed cards. Tokens only (docs/THEMES.md). Three columns at 1180 px and over; two from 781 px, the
   context then a sheet on the right; one at a time on a phone (780 px and under), with Back in the pane's header. */

/* A page built of panels fills the surface; its panes scroll, not the page. */
.view:has(> .pn), .view:has(> .pn-host) { overflow: hidden; display: flex; flex-direction: column; }
.pn-host { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pn { display: flex; flex: 1; min-width: 0; min-height: 0; position: relative; }
.pn-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; position: relative; background: var(--content-bg); }
.pn-pane[hidden], .pn-div[hidden] { display: none !important; }
.pn-h { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 12px 6px 16px; border-bottom: 1px solid var(--line); flex: none; min-width: 0; }
.pn-h:empty { display: none; }
.pn-h h1, .pn-h h2 { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.pn-h .grow { flex: 1; }
/* A locked action in a pane's header keeps the title whole: the title never shrinks below its words, and the lock's
   note ("Needs the operator role…") wraps under the button, right-aligned, instead of squeezing "Tasks" to "Ta…"
   at phone width (seen 21 Nov 2026). */
.pn-h h1, .pn-h h2 { flex-shrink: 0; max-width: 60%; }
.pn-h .locked { display: inline-flex; flex-direction: column; align-items: flex-end; min-width: 0; flex: 0 1 auto; }
.pn-h .locked::after { max-width: 15rem; text-align: right; line-height: 1.35; margin-top: 4px; }
.pn-h .iconbtn { width: 34px; height: 34px; display: inline-grid; place-items: center; flex: none; padding: 0; }
.pn-h .iconbtn svg { width: 17px; height: 17px; }
.pn-title { min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.pn-title .mono { font: 12.5px var(--mono); color: var(--text-3); }
.pn-back { display: none !important; }
.pn-b { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }

/* the divider: 1 px drawn, 9 px to grab; focusable, and the focus shows on it */
.pn-div { width: 1px; flex: none; background: var(--panel-divider); position: relative; cursor: col-resize; z-index: var(--z-raise); touch-action: none; }
.pn-div::after { content: ""; position: absolute; inset: 0 -4px; }
.pn-div:hover, .pn-div.drag, .pn-div:focus-visible { background: var(--focus); outline: none; }
.pn-div:focus-visible { box-shadow: 0 0 0 1px var(--focus); }
.pn.pn-dragging { user-select: none; cursor: col-resize; }
.pn.pn-dragging iframe { pointer-events: none; }

/* tabs under a pane's header (the area's own: For you · All · Overview · Templates) */
.pn-tabs { display: flex; gap: 18px; padding: 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; flex: none; }
.pn-tabs::-webkit-scrollbar { display: none; }
.pn-tabs a, .pn-tabs button { height: 40px; display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  background: none; color: var(--text-3); font: 500 13.5px var(--sans); white-space: nowrap; text-decoration: none; cursor: pointer; }
.pn-tabs [aria-selected="true"] { color: var(--text); border-bottom-color: var(--canopy); font-weight: 600; }
.pn-tabs .c { color: var(--text-3); font-weight: 400; font-size: 12px; font-variant-numeric: tabular-nums; }
.pn-tabs .c.warn { color: var(--warn); }
/* an area's tabs on a page that is not panels yet (Agents · Now, Machines · Devices · IoT): flush with the page's text */
.page > .area-tabs { padding: 0; margin: -8px 0 22px; }
.ag-now { margin: 0 0 8px; }
/* a tab drawn inside a pane (Conversations › Figures): no title, the filters first */
.ac-embed .ac-head { margin-bottom: 14px; }

/* a section heading inside a pane: small capitals and a count */
.pn-sect { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); padding: 14px 16px 6px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin: 0; font-weight: 600; }
.pn-sect .c { letter-spacing: 0; text-transform: none; font-weight: 400; }
.pn-pad { padding: 12px 16px 24px; }

/* the context as a sheet over the detail (781–1179 px), the only floating thing here */
.pn-pane.pn-sheet { position: absolute; top: 0; right: 0; bottom: 0; width: min(360px, 92%); z-index: var(--z-float); box-shadow: var(--elev-2); }

/* a phone: one pane at a time, Back in its header */
@media (max-width: 780px) {
  .pn-pane { flex: 1 1 auto !important; width: auto !important; }
  .pn[data-mode="one"] .pn-pane:not([data-pane="list"]) .pn-back { display: inline-grid !important; }
  .pn[data-mode="one"] .pn-x { display: none; }
  .pn-h { padding-left: 10px; }
  .pn-tabs { gap: 16px; padding: 0 14px; }
}

/* ---------------------------------------------------------------- page introductions behind "?" (§3.3) */
.pg-help { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-2); background: none; color: var(--text-3); font: 600 12px/1 var(--sans);
  display: inline-grid; place-items: center; vertical-align: middle; margin-left: 6px; padding: 0; cursor: pointer; letter-spacing: 0; }
.pg-help:hover, .pg-help[aria-expanded="true"] { color: var(--text); border-color: var(--control); }
.pg-intro { font-size: 14px; }
