/* Explore module: lifecycle card and Relations page. Colours come from styles.css tokens, so dark mode follows. */
.xmuted { color: var(--muted); font-size: 12px; }
.xsub { font-size: 12px; font-weight: 600; color: var(--muted); margin: 12px 0 8px; }
.xsub:first-child { margin-top: 0; }

/* ---- maturity state chart */
.xchart { width: 100%; max-width: 420px; height: auto; display: block; }
.xchart .xarrow { stroke-width: 2; }
.xchart .xarrow.on { stroke: var(--accent); }
.xchart .xarrow.off { stroke: var(--line); stroke-dasharray: 4 3; }
.xchart .xarrow.dim { stroke: var(--muted); opacity: .35; }
.xstate rect { fill: var(--panel-2); stroke: var(--line); stroke-width: 1.5; }
.xstate text { font-size: 13px; font-weight: 600; fill: var(--muted); pointer-events: none; }
/* Like 3DEXPERIENCE's Collaborative Lifecycle chart: the current state is solid blue with white text,
   whatever the state; every other state stays grey. */
.xstate.here rect { fill: var(--accent); stroke: var(--accent-hover); stroke-width: 1.5; }
.xstate.here text { fill: var(--on-accent); }
.xstate.can { cursor: pointer; }
.xstate.can rect { stroke: var(--accent); stroke-dasharray: 5 3; }
.xstate.can text { fill: var(--text); }
.xstate.can:hover rect, .xstate.can:focus rect { fill: var(--accent-soft); stroke-dasharray: none; }
.xstate.no { cursor: not-allowed; }
.xstate.no rect { opacity: .6; }
.xlegend { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; font-size: 12px; color: var(--muted); margin: 4px 0 8px; }
.xkey { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.xkey.can { border: 1.5px dashed var(--accent); }
.xkey.no { border: 1.5px dashed var(--line); opacity: .8; }

/* ---- revision chain */
.xchain { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.xlink { color: var(--muted); }
.xrev { display: grid; grid-template-columns: auto auto; gap: 0 8px; align-items: baseline; text-align: left; cursor: pointer;
  padding: 4px 12px; border-radius: 2px; border: 1.5px solid var(--line); background: var(--panel); min-width: 84px; }
.xrev b { font-size: 16px; grid-row: span 2; }
.xrev .xm { font-size: 11px; font-weight: 600; }
.xrev .xn { font-size: 11px; color: var(--muted); }
.xrev .xlatest { grid-column: 1 / -1; font-size: 11px; color: var(--muted); }
.xrev.In-Work { border-color: var(--work); } .xrev.In-Work .xm { color: var(--work); }
.xrev.Frozen { border-color: var(--frozen); } .xrev.Frozen .xm { color: var(--frozen); }
.xrev.Released { border-color: var(--released); } .xrev.Released .xm { color: var(--released); }
.xrev.Obsolete { border-color: var(--obsolete); } .xrev.Obsolete .xm { color: var(--obsolete); }
.xrev.sel { box-shadow: 0 0 0 2px var(--accent-soft); background: var(--panel-2); }
.xrev.sel b { text-decoration: underline; text-underline-offset: 3px; }
.xvers { margin-top: 4px; }
.xver { display: grid; grid-template-columns: 40px 1fr; gap: 0 8px; padding: 4px 0; border-top: 1px solid var(--line); font-size: 13px; }
.xver .xmuted { grid-column: 2; }

/* ---- relations graph: CSS org-chart lines; the "up" tree is drawn flipped so parents sit above */
.xgraph { --xline: color-mix(in srgb, var(--muted) 55%, transparent); }
.xgraph { overflow: auto; margin: 12px 0 16px; }
.xcanvas { width: max-content; min-width: 100%; padding: 16px; display: flex; flex-direction: column; align-items: safe center; }
.xnone { padding: 4px 0 8px; text-align: center; }
.xtree ul { display: flex; justify-content: safe center; position: relative; margin: 0; padding: 20px 0 0; list-style: none; }
.xtree ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 20px; border-left: 2px solid var(--xline); }
.xtree li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 20px 8px 0; }
.xtree li::before, .xtree li::after { content: ""; position: absolute; top: 0; width: 50%; height: 20px; border-top: 2px solid var(--xline); }
.xtree li::before { right: 50%; }
.xtree li::after { left: 50%; border-left: 2px solid var(--xline); }
.xtree li:first-child::before, .xtree li:last-child::after { border-top: 0; }
.xtree li:only-child { padding-top: 0; }
.xtree li:only-child::before, .xtree li:only-child::after { display: none; }
.xtree ul.xroot { padding-top: 0; }
.xtree ul.xroot::before, .xtree ul.xroot > li::before, .xtree ul.xroot > li::after { display: none; }
.xtree.up { transform: scaleY(-1); }
.xtree.up .xflip { transform: scaleY(-1); }

.xnode { display: flex; gap: 8px; align-items: flex-start; width: 210px; padding: 8px; border-radius: 2px; text-align: left;
  border: 1px solid var(--line); background: var(--panel); cursor: pointer; position: relative; }
.xnode:hover, .xnode:focus { border-color: var(--accent); }
.xnode.centre { width: 250px; border: 2px solid var(--accent); }
.xnode.ghost { cursor: default; flex-direction: column; gap: 2px; background: var(--panel-2); border-style: dashed; }
.xthumb { width: 48px; height: 48px; flex: none; object-fit: contain; border-radius: 2px; background: var(--panel-2); }
.xthumb.none { display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.xthumb.big { width: 100%; height: 140px; }
.xnode.centre .xthumb { width: 64px; height: 64px; }
.xtext { min-width: 0; flex: 1; padding-right: 20px; }
.xname { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xfile { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xmeta { display: flex; gap: 8px; align-items: center; font-size: 12px; margin-top: 2px; }
.xbadges .tag { margin: 4px 4px 0 0; }
.xbadges .tag.lock { color: var(--text); }
.xgrow { position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; padding: 0; line-height: 0; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--accent); font-weight: 700; cursor: pointer; }
.xgrow:hover { border-color: var(--accent); }

/* ---- compare */
.xpick { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.xpick select { flex: 1; min-width: 0; }
.xthumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.xcthumb { margin: 0; text-align: center; }
.xcthumb img { width: 100%; height: 140px; object-fit: contain; background: var(--panel-2); }
.xcthumb figcaption { font-size: 12px; color: var(--muted); }
.xdiff td, .xdiff th { white-space: normal; overflow-wrap: anywhere; }
.xdiff tbody th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; background: none; position: static; cursor: default; width: 110px; }
.xdiff tr.chg td { background: var(--accent-soft); }
.xdiff tr.r-removed td.name { text-decoration: line-through; color: var(--muted); }

/* ---- lifecycle: why a move is not allowed, written out (no hover needed) */
.xwhy { margin: 0 0 8px; padding-left: 20px; font-size: 12px; color: var(--muted); }
.xwhy b { color: var(--text); font-weight: 600; }
