/* Native WordPress graph viewer; all rules stay inside this plugin component. */
.gsf-explorer {
	--gx-paper: #fff;
	--gx-ink: var(--wp--preset--color--ink, #111);
	--gx-muted: #5b5b5b;
	--gx-line: var(--wp--preset--color--line, #d8dadd);
	--gx-red: var(--gsf-accent, #d90912);
	box-sizing: border-box;
	width: 100%;
	max-width: 1200px;
	margin-inline: auto;
	color: var(--gx-ink);
	font: inherit;
}
.gsf-explorer *, .gsf-explorer *::before, .gsf-explorer *::after { box-sizing: border-box; }
.gsf-explorer [hidden] { display: none !important; }
.gsf-explorer :focus-visible { outline: 2px solid var(--gx-red); outline-offset: 2px; }
.gsf-explorer__intro { margin: 0 0 1rem; }
.gsf-explorer__intro h2 { margin: .15em 0 .35em; font-size: clamp(1.5rem, 2.5vw, 2.15rem); line-height: 1.1; }
.gsf-explorer__intro .gsf-explorer__eyebrow,
.gsf-explorer__intro h2[data-gsf-explorer-id="model-title"] {
	position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important;
	margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important; border: 0 !important;
}
.gsf-explorer__intro p { max-width: 78ch; }
.gsf-explorer__intro .gsf-explorer__eyebrow { margin: 0; color: var(--gx-muted); font-size: .95rem; }
.gsf-explorer__intro [data-gsf-explorer-id="model-counts"] { color: var(--gx-muted); font-size: .9rem; }
.gsf-explorer__load { display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; border: 1px solid var(--gx-line); background: #f7f7f6; }
.gsf-explorer__load button, .gsf-explorer button {
	min-width: 44px; min-height: 44px; padding: .55rem .75rem;
	border: 1px solid var(--gx-ink); border-radius: 0;
	color: var(--gx-ink); background: var(--gx-paper); font: inherit; cursor: pointer;
}
.gsf-explorer button:hover:not(:disabled) { color: #fff; background: var(--gx-ink); }
.gsf-explorer button:disabled { opacity: .5; cursor: not-allowed; }
.gsf-explorer input, .gsf-explorer select { min-height: 44px; max-width: 100%; padding: .55rem .7rem; border: 1px solid #aeb2b5; border-radius: 0; color: var(--gx-ink); background: #fff; font: inherit; }
/* Reserve a separate arrow slot so longer options never touch the chevron. */
.gsf-explorer .gsf-explorer__viewer select[data-gsf-explorer-id] { appearance: none; padding-inline-end: 2.25rem; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23111' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right .75rem center; }
@media (forced-colors: active) { .gsf-explorer .gsf-explorer__viewer select[data-gsf-explorer-id] { appearance: auto; background-image: none; } }
.gsf-explorer__viewer { min-width: 0; border: 1px solid var(--gx-line); background: var(--gx-paper); }
.gsf-explorer__toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; padding: 1rem; border-bottom: 1px solid var(--gx-line); }
.gsf-explorer__search { position: relative; flex: 1 1 290px; min-width: min(100%, 230px); }
.gsf-explorer__search label { display: block; margin: 0 0 .35rem; font-weight: 600; }
.gsf-explorer__search input { width: 100%; }
.gsf-explorer__search-results { position: absolute; z-index: 8; inset-inline: 0; max-height: 40vh; overflow: auto; background: #fff; box-shadow: 0 4px 18px #0002; }
.gsf-explorer__filters { display: flex; flex-wrap: wrap; align-items: end; gap: .7rem; }
.gsf-explorer__filters label { display: grid; gap: .3rem; font-size: .88rem; }
.gsf-explorer__camera, .gsf-explorer__control-group { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.gsf-explorer__camera { padding: .7rem 1rem; border-bottom: 1px solid var(--gx-line); }
.gsf-explorer__control-group + .gsf-explorer__control-group { margin-left: auto; }
.gsf-explorer__camera output { min-width: 3ch; text-align: center; font-variant-numeric: tabular-nums; }
.gsf-explorer__camera button { font-size: .9rem; }
.gsf-explorer__camera details { position: relative; }
.gsf-explorer__camera summary, .gsf-explorer__side summary, .gsf-explorer__tools summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.gsf-explorer__tools { position: absolute; z-index: 10; right: 0; top: calc(100% + .3rem); display: grid; gap: .7rem; width: min(620px, calc(100vw - 2rem)); padding: .85rem; border: 1px solid var(--gx-line); background: #fff; box-shadow: 0 8px 24px #0002; }
.gsf-explorer__tools label { display: grid; gap: .25rem; font-size: .88rem; }
.gsf-explorer__pan { display: grid; grid-template-columns: repeat(3, 44px); justify-content: start; gap: .3rem; }
.gsf-explorer__pan [data-pan="up"] { grid-column: 2; }
.gsf-explorer__pan [data-pan="left"] { grid-column: 1; }
.gsf-explorer__pan [data-pan="down"] { grid-column: 2; }
.gsf-explorer__pan [data-pan="right"] { grid-column: 3; grid-row: 2; }
.gsf-explorer__tools [data-gsf-explorer-id="gesture-help"] { padding-top: .5rem; border-top: 1px solid var(--gx-line); }
.gsf-explorer__subnav { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .6rem 1rem; border-bottom: 1px solid var(--gx-line); }
.gsf-explorer__subnav button { min-height: 44px; }
.gsf-explorer__subnav [data-gsf-explorer-id="action-status"] { margin-left: auto; color: var(--gx-muted); }
.gsf-explorer__selection { min-height: 0; padding-inline: 1rem; color: var(--gx-muted); }
.gsf-explorer__workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); min-width: 0; }
.gsf-explorer__graph-area { min-width: 0; }
.gsf-explorer__stage { position: relative; width: 100%; height: clamp(420px, 65svh, 760px); min-height: 320px; overflow: hidden; background: #fff; touch-action: none; }
.gsf-explorer__stage { cursor: grab; }
.gsf-explorer__stage:active { cursor: grabbing; }
.gsf-explorer__stage > canvas, .gsf-explorer__stage > [data-gsf-explorer-id="labels"] { position: absolute; inset: 0; width: 100%; height: 100%; }
.gsf-explorer__stage > canvas { display: block; }
.gsf-explorer__stage > [data-gsf-explorer-id="labels"] { pointer-events: none; }
.gsf-explorer__stage .graph-label { pointer-events: auto; }
.gsf-explorer__stage .graph-label {
	position: absolute; left: 0; top: 0; z-index: 1; display: block;
	width: max-content; min-width: 0; min-height: 0; max-width: 200px;
	padding: 3px 5px; overflow: hidden; border: 1px solid var(--gx-line); border-left: 1px solid var(--gx-red);
	color: var(--gx-ink); background: rgb(255 255 255 / 96%); font-family: inherit; font-size: 12px; line-height: 18px;
	white-space: nowrap; text-overflow: ellipsis; cursor: pointer;
}
.gsf-explorer__stage .graph-label.selected, .gsf-explorer__stage .graph-label.anchor {
	max-width: min(320px, 70vw); border-left-width: 2px; font-size: 14px; font-weight: 700;
}
.gsf-explorer__stage [data-gsf-explorer-id="hover-card"] { position: absolute; z-index: 5; max-width: min(320px, 80%); padding: .45rem .6rem; border: 1px solid var(--gx-line); color: var(--gx-ink); background: #fff; box-shadow: 0 4px 14px #0002; pointer-events: none; }
.gsf-explorer__minimap { position: absolute; right: .75rem; bottom: .75rem; width: min(210px, 30%); aspect-ratio: 1.55; border: 1px solid var(--gx-line); background: #fff; box-shadow: 0 2px 12px #0002; }
.gsf-explorer__minimap canvas { width: 100%; height: 100%; }
.gsf-explorer__legend, .gsf-explorer__hint { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin: 0; padding: .65rem 1rem; color: var(--gx-muted); font-size: .86rem; line-height: 1.45; border-top: 1px solid var(--gx-line); }
.gsf-explorer__legend > span { display: inline-block; width: 8px; height: 8px; margin-left: .4rem; border-radius: 50%; background: #777; }
.gsf-explorer__legend .gsf-explorer__selected-key, .gsf-explorer__legend .gsf-explorer__context-key { width: 18px; height: 2px; border-radius: 0; background: var(--gx-red); }
.gsf-explorer__legend .gsf-explorer__context-key { background: #9b9b9b; }
.gsf-explorer__side { min-width: 0; border-left: 1px solid var(--gx-line); }
.gsf-explorer__side details { padding: .7rem .85rem; border-bottom: 1px solid var(--gx-line); }
.gsf-explorer__side details > summary { gap: .5rem; }
.gsf-explorer__side summary { justify-content: space-between; font-weight: 600; }
.gsf-explorer__browse-list { display: grid; max-height: 46vh; overflow: auto; }
.gsf-explorer__browse-list button { width: 100%; border-width: 0 0 1px; text-align: left; }
.gsf-explorer__browse-list .result { display: block; min-height: 44px; padding: .5rem .25rem; overflow-wrap: anywhere; border-width: 0 0 1px; border-color: #e5e6e7; text-align: left; }
.gsf-explorer__browse-list .result[aria-pressed="true"] { padding-left: .5rem; border-left: 2px solid var(--gx-red); background: #f4f4f1; font-weight: 700; }
.gsf-explorer__browse-list .result small { display: block; margin-top: .1rem; color: var(--gx-muted); font-size: .75rem; line-height: 1.35; font-weight: 400; }
.gsf-explorer [data-gsf-explorer-id="details"] { padding-top: .75rem; overflow-wrap: anywhere; }
.gsf-explorer [data-gsf-explorer-id="details"] p { margin: .4rem 0; font-size: .9rem; }
.gsf-explorer [data-gsf-explorer-id="details"] .note { color: var(--gx-muted); font-size: .82rem; }
.gsf-explorer [data-gsf-explorer-id="details"] .evidence { padding: .65rem 0; border-top: 1px solid #e5e6e7; }
.gsf-explorer [data-gsf-explorer-id="details"] .evidence p { margin: .25rem 0; }
.gsf-explorer .item-action { width: 100%; min-height: 44px; padding: .55rem 0; border-width: 0 0 1px; border-color: var(--gx-line); text-align: left; font-size: .9rem; overflow-wrap: anywhere; }
.gsf-explorer .route-step { margin: .65rem 0; padding: .5rem .65rem; border-left: 2px solid var(--gx-red); background: #f4f4f1; }
.gsf-explorer .route-step button { width: 100%; margin-top: .35rem; text-align: left; font-size: .82rem; }
.gsf-explorer__coverage { margin: 0; padding: .8rem 1rem; border-top: 1px solid var(--gx-line); color: var(--gx-muted); font-size: .9rem; }
.gsf-explorer__dialog:not([open]) { display: none; }
.gsf-explorer__dialog[open] { position: fixed; z-index: 100000; inset: 0; display: flex; flex-direction: column; width: calc(100vw - 2rem); height: calc(100dvh - 2rem); max-width: none; max-height: none; margin: auto; padding: 0; overflow: hidden; border: 1px solid var(--gx-line); color: var(--gx-ink); background: #fff; }
.gsf-explorer__dialog::backdrop { background: rgb(0 0 0 / 58%); }
html.gsf-network-expanded-open { overflow: hidden; scrollbar-gutter: stable; }
.gsf-explorer__dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 1rem; border-bottom: 1px solid var(--gx-line); }
.gsf-explorer__dialog-head h2 { margin: 0; font-size: 1.2rem; }
.gsf-explorer__dialog [data-gsf-explorer-id="dialog-body"] { flex: 1 1 auto; min-height: 0; overflow: auto; }
.gsf-explorer__dialog [data-gsf-explorer-id="viewer"] { display: block; min-height: 0; overflow: visible; }
.gsf-explorer__dialog .gsf-explorer__workspace { min-height: 0; }
.gsf-explorer__dialog .gsf-explorer__stage { height: 100%; min-height: 280px; }
@media (max-width: 820px) {
	.gsf-explorer__workspace { grid-template-columns: minmax(0, 1fr); }
	.gsf-explorer__side { border-left: 0; border-top: 1px solid var(--gx-line); }
	.gsf-explorer__side details[open] { max-height: 44vh; overflow: auto; }
	.gsf-explorer__stage { height: clamp(380px, 58svh, 620px); }
}
@media (max-width: 560px) {
	.gsf-explorer__intro { padding-inline: .25rem; }
	.gsf-explorer__toolbar { padding: .75rem; }
	.gsf-explorer__filters { width: 100%; align-items: stretch; }
	.gsf-explorer__filters label { flex: 1 1 130px; }
	.gsf-explorer__filters select { width: 100%; }
	.gsf-explorer__camera { padding: .6rem .75rem; }
	.gsf-explorer__control-group + .gsf-explorer__control-group { margin-left: 0; }
	.gsf-explorer__camera { align-items: start; }
	.gsf-explorer__camera > details { margin-left: auto; }
	.gsf-explorer__stage { height: clamp(360px, 54svh, 540px); }
	.gsf-explorer__dialog[open] { inset: 0; width: 100%; height: 100dvh; border: 0; }
	.gsf-explorer__dialog .gsf-explorer__workspace { overflow: auto; }
	.gsf-explorer__camera > details[open] .gsf-explorer__tools {
		position: fixed; z-index: 100001; inset: auto .75rem max(.75rem, env(safe-area-inset-bottom));
		width: auto; max-height: 70dvh; overflow: auto; overscroll-behavior: contain;
	}
}

/* Keep evidence beside the canvas without stretching the page into empty space. */
@media (min-width: 821px) {
	.gsf-explorer__side { max-height: calc(clamp(420px, 65svh, 760px) + 6rem); overflow: auto; }
	.gsf-explorer__browse-list { max-height: none; overflow: visible; }
	.gsf-explorer__dialog .gsf-explorer__side { max-height: calc(100dvh - 320px); overflow: auto; }
}

.gsf-explorer__stage [data-gsf-explorer-id="hover-card"] strong,
.gsf-explorer__stage [data-gsf-explorer-id="hover-card"] span { display: block; }
