/* Browse > PPI network, one hub on one screen (ppi_modern.html). The band is the shared page band (discanvis-page-band.css), the rail the
   Summary sub-bar's own classes (summary_subbar.css); this file is the page's own: the viewport, the figure with the groups beside it,
   the partner tables, the chat frame. */
body { background-color: var(--bs-tertiary-bg); }

/* The viewport: the header, the menu, the band, the rail and the stage; nothing scrolls at page level (below 1280 px the page may). */
.ppi-hub-body { height: 100vh; overflow: hidden; }
.ppi-hub-main { display: flex; flex-direction: column; min-height: 0; padding: .5rem 1rem .6rem; }
.ppi-rail { flex: 0 0 auto; margin-bottom: .4rem; border: 1px solid var(--bs-border-color); border-radius: var(--dcv-radius); }
.ppi-rail .summary-subbar-select { max-width: 13rem; }
/* Top N: the number and its Apply are one joined control (the shared segmented look, .summary-visual-mode-group); it never wraps or slides
   out of the row: the number is a fixed width, the button as wide as its word. */
.ppi-topn { width: auto; flex: 0 0 auto; }
.ppi-topn input.form-control { flex: 0 0 3.2rem; min-width: 0; width: 3.2rem; padding-left: .4rem; padding-right: .2rem; border-radius: .4rem 0 0 .4rem; }
.ppi-topn > .btn { flex: 0 0 auto; border-radius: 0 .4rem .4rem 0; }
.ppi-more-menu { min-width: 16rem; }
/* "Show only focused" adds a group to the rail while a set is active: the Sources kicker gives its room, so the row stays one line at 1440 px. */
.ppi-rail:has(#ppi-only-group:not(.d-none)) .summary-subbar-group > .summary-cmdbar-kicker.d-xxl-inline { display: none !important; }
.ppi-hub-menu { min-width: 22rem; }
/* The band's lead is made of the neighbourhood's numbers; each stays whole, the line ends in an ellipsis. */
.ppi-band .dcv-band-lead strong { font-weight: 650; color: var(--bs-body-color); }
.ppi-band .dcv-band-lead .btn-link { font-size: inherit; font-weight: 650; text-decoration: none; vertical-align: baseline; }

/* The band's buttons are one joined group (the shared segmented look); their words show from 1200 px, below that icons only, so the lead
   (the neighbourhood's numbers) keeps the room. */
.ppi-band .dcv-band-lead { font-size: .8rem; }
.ppi-band .dcv-band-lead .btn-link { color: inherit; }

/* The stage: what is left. */
.ppi-results { position: relative; flex: 1 1 0; min-height: 0; }
.ppi-results > .tab-content, .ppi-results > .tab-content > .tab-pane { height: 100%; }
.ppi-results > .tab-content > #ppi-tables-pane { overflow: auto; }
.ppi-loading {
    position: absolute; inset: 0; z-index: 5; display: none; align-items: flex-start; justify-content: center; padding-top: 4rem;
    border-radius: var(--dcv-radius); background: rgba(var(--bs-body-bg-rgb, 255, 255, 255), 0.72);
}
.ppi-loading.is-active { display: flex; }
.ppi-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: .75rem; height: 100%; }
/* One card = one border: the figure's frame, and the side column's. */
.ppi-fig, .ppi-side, .ppi-card {
    background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: var(--dcv-radius);
}
.ppi-fig { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ppi-cy-wrap { position: relative; flex: 1 1 0; min-height: 0; }
.ppi-card { padding: 1rem 1.25rem; }
/* Cytoscape's canvas is transparent: let the surrounding theme colour show through. The container fills its wrap (browse_ppi.js asks
   the figure to read its height from it). */
.ppi-cy { position: absolute; inset: 0; overflow: hidden; }
.ppi-fig-count { position: absolute; top: .4rem; left: .6rem; z-index: 2; pointer-events: none; }
/* The group petals sit behind Cytoscape's canvas and move with its view. Each takes its group's colour (--ppi-group, set by
   ppi_cytoscape.js from ppi_groups.js: the evidence's token or the tumour type's / disease group's colour); two neighbours of one
   colour alternate the tint's strength. */
.ppi-sectors { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ppi-sector { fill: var(--ppi-group, var(--dcv-chart-neutral)); stroke: var(--ppi-group, var(--dcv-chart-neutral-strong)); stroke-width: 1.5; stroke-opacity: .45; vector-effect: non-scaling-stroke; }
.ppi-sector--0 { fill-opacity: .10; }
.ppi-sector--1 { fill-opacity: .18; }
/* No evidence (interaction only): no tint, a dashed outline. */
.ppi-sector--empty { fill-opacity: 0; stroke: var(--dcv-chart-neutral-strong); stroke-dasharray: 6 4; stroke-opacity: .7; }
.ppi-sector-label { fill: var(--dcv-chart-ink); font-size: 12px; font-weight: 650; dominant-baseline: middle; }

/* The legend: one line under the figure (its title holds the rest). */
.ppi-legend { flex: 0 0 auto; padding: .3rem .6rem; border-top: 1px solid var(--bs-border-color); font-size: .75rem; color: var(--bs-secondary-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ppi-legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin: 0 4px 0 0; vertical-align: middle; }
.ppi-legend-line { display: inline-block; width: 20px; margin: 0 4px 0 0; vertical-align: middle; }
.ppi-legend-sep { margin: 0 .45rem; }
.ppi-legend-ink { font-weight: 650; }

/* The side column: the group lines (one per group, its swatch the petal's tint), the selected partner under them. */
.ppi-side { min-height: 0; overflow: auto; padding: .75rem 1rem; }
.ppi-groups { list-style: none; margin: 0; padding: 0; font-size: .8125rem; display: grid; gap: .45rem; }
.ppi-groups li { display: flex; align-items: baseline; gap: .5rem; }
.ppi-groups strong { white-space: nowrap; }
.ppi-groups .ppi-groups-base { color: var(--bs-secondary-color); font-size: .75rem; }
.ppi-key { flex: none; width: .9rem; height: .9rem; border-radius: 3px; background: color-mix(in srgb, var(--ppi-group, var(--dcv-chart-neutral)) 22%, transparent); border: 1.5px solid var(--ppi-group, var(--dcv-chart-neutral-strong)); align-self: center; }
.ppi-key--1 { background: color-mix(in srgb, var(--ppi-group, var(--dcv-chart-neutral)) 38%, transparent); }
.ppi-key--empty { background: transparent; border: 1.5px dashed var(--dcv-chart-neutral-strong); }
.ppi-selection { border-top: 1px solid var(--bs-border-color); margin-top: .75rem; padding-top: .6rem; }

/* A source's line style, as its edges are drawn (the colour is the chart's neutral). */
.ppi-swatch { display: inline-block; width: 1.2rem; height: 0; border-top: 2px solid var(--dcv-chart-neutral-strong); margin-left: .35rem; vertical-align: .2rem; }
.ppi-swatch--dotted { border-top-style: dotted; }
.ppi-swatch--dashed { border-top-style: dashed; }

/* The hub chooser: its suggestions list over the page. */
.ppi-ac-wrap { position: relative; }
#ppi-ac-dd { position: absolute; left: 0; right: 0; top: 100%; z-index: 1055; max-height: 260px; overflow-y: auto; }

/* The Tables pane (behind the band's Tables button): one table at a time on a button row (only tables with rows get a button). */
.ppi-tables-nav { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .75rem; }
.ppi-tables-nav .btn-group { max-width: 100%; overflow-x: auto; }
.ppi-structure-empty { color: var(--bs-secondary-color); font-size: .875rem; }
.ppi-complex-choices { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-bottom: .6rem; }
#ppi-complex-card .dcv-cpanel-frame { border: 0; border-radius: 0; }
/* "What they share": the badges shrink to an ellipsis inside their pills so the +N never leaves the cell. */
.ppi-share-list { display: flex; gap: .25rem; min-width: 0; }
.ppi-share-list > .dcv-badge { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppi-share-list .ppi-share-more { flex: none; }
/* The PDB-entry picker is a control in a one-line row (the table clamps a cell to one line): it is as tall as the line. */
.ppi-complex-choice { min-width: 14rem; max-width: 100%; height: 1.15rem; padding: 0 1.4rem 0 .35rem; font-size: .75rem; line-height: 1; background-position: right .4rem center; background-size: 10px; }

/* Narrower than 1280 px the side column drops under the figure and the page scrolls. */
@media (max-width: 1279.98px) {
    .ppi-hub-body { height: auto; overflow: visible; }
    .ppi-results { flex: 0 0 auto; }
    .ppi-results > .tab-content, .ppi-results > .tab-content > .tab-pane { height: auto; }
    .ppi-main { grid-template-columns: minmax(0, 1fr); height: auto; }
    .ppi-cy-wrap { flex: 0 0 auto; height: 70vh; min-height: 24rem; }
}

/* Inside AI Chat (frame=chat): a pointer, not the page: the figure and its group lines only. The band, the rail, the "Partners drawn" line
   and the legend are said by the chat's caption above the frame; the tables and the links out stay on /browse/ppi. The chat sizes the frame
   from its content (fitFrame), so nothing here is as tall as the window: the figure is as high as it is wide (ppi_cytoscape.js). */
.ppi-frame .ppi-hub-main { padding: 0; display: block; }
.ppi-frame .ppi-rail, .ppi-frame .ppi-legend, .ppi-frame .ppi-fig-count, .ppi-frame #ppi-tables-pane { display: none !important; }
.ppi-frame #ppi-overview-pane { display: block !important; opacity: 1 !important; height: auto; }
.ppi-frame .ppi-results, .ppi-frame .tab-content { height: auto; }
.ppi-frame .ppi-main { display: block; height: auto; }
.ppi-frame .ppi-fig, .ppi-frame .ppi-side { border: 0; border-radius: 0; background: transparent; }
.ppi-frame .ppi-cy-wrap { flex: none; height: auto; min-height: 0; }
.ppi-frame .ppi-cy { position: relative; }
.ppi-frame .ppi-side { overflow: visible; padding: .5rem .25rem 0; }
/* The reader's dataset (`?dataset=`): the lead's dot is the registry's own-data colour, the node's dot is drawn by ppi_cytoscape.js. */
.ppi-band .dcv-band-lead .ppi-own-dot { display: inline-block; width: .55rem; height: .55rem; margin-right: .3rem; border-radius: 50%; background: var(--dcv-own-data); vertical-align: baseline; }
