/**
 * Shared Editorial Guide graph visual language — aligned with Developmental Edit
 * shape graph (.developmental-shape-graph-panel / .developmental-shape-curve / .developmental-shape-node).
 * Cards are enlarged graph nodes; edges only styled here, never invented in CSS.
 */

:root {
    --en-graph-bg: linear-gradient(180deg, #f9f6f1 0%, #fff 62%);
    --en-graph-canvas-bg: var(--en-graph-bg);
    --en-graph-surface: #fffefb;
    --en-graph-border: var(--st-border-strong, #e4d7c8);
    --en-graph-ink: var(--st-ink, #111111);
    --en-graph-muted: var(--st-color-muted, #6a7380);
    --en-graph-axis: #c8c8c8;
    --en-graph-edge: var(--st-ink, #111111);
    --en-graph-edge-muted: #c5c5c5;
    --en-graph-node-stroke: var(--st-border-strong, #dddddd);
    --en-graph-node-fill: var(--st-bg, #fff);
    --en-graph-node-selected: var(--st-brand-gold, #a67c52);
    --en-graph-shadow: 4px 3px 11px rgba(32, 26, 18, 0.09);
    --en-graph-card-accent: var(--st-bronze, #8b6914);
}

.en-editorial-graph-host {
    margin: 0.5rem 0 0;
}

.en-editorial-graph-panel {
    border: 1px solid var(--en-graph-border);
    border-radius: 10px;
    padding: 0.75rem 0.85rem 0.9rem;
    background: var(--en-graph-bg);
    box-sizing: border-box;
}

.en-editorial-graph-viewport {
    position: relative;
    width: 100%;
    height: min(58vh, 460px);
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid var(--en-graph-border);
    background: var(--en-graph-surface);
    touch-action: none;
    cursor: grab;
}

.en-editorial-graph-viewport:active {
    cursor: grabbing;
}

.en-editorial-graph-viewport.en-char-spider-viewport,
.en-editorial-graph-viewport.en-char-cork-viewport {
    border-radius: 10px;
    background: var(--en-graph-surface);
    background-image: none;
    box-shadow: var(--en-graph-shadow);
}

/* Characters map canvas — same fade as Beat Board (--en-graph-bg). */
.en-character-connection-map .en-editorial-graph-viewport.en-char-spider-viewport,
.en-character-connection-map .en-editorial-graph-viewport.en-char-cork-viewport,
.en-character-connection-map .en-char-spider-viewport,
.en-character-connection-map .en-char-cork-viewport {
    background: var(--en-graph-canvas-bg);
}

.en-editorial-graph-stage {
    position: relative;
    transform-origin: 0 0;
}

.en-editorial-graph-links {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.en-character-spiderboard .en-editorial-graph-card {
    background: var(--en-graph-node-fill);
}

.en-editorial-graph-card,
.en-char-editorial-card.en-editorial-graph-card {
    position: absolute;
    box-sizing: border-box;
    border: 2px solid var(--en-graph-node-stroke);
    border-right: 3px solid var(--en-graph-card-accent);
    border-radius: 10px;
    background: var(--en-graph-node-fill);
    box-shadow: var(--en-graph-shadow);
    cursor: grab;
    user-select: none;
    z-index: 2;
}

.en-editorial-graph-card.is-selected,
.en-char-editorial-card.en-editorial-graph-card.is-selected {
    border-color: var(--en-graph-ink);
    box-shadow:
        0 0 0 2px rgba(166, 124, 82, 0.35),
        var(--en-graph-shadow);
}

.en-editorial-graph-card.is-dimmed {
    opacity: 0.45;
}

.en-editorial-graph-edge,
.en-char-map-edge.en-editorial-graph-edge {
    fill: none;
    stroke: var(--en-graph-edge);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.88;
}

.en-editorial-graph-edge.is-editorial,
.en-char-map-edge.en-editorial-graph-edge.is-editorial {
    stroke-dasharray: 5 4;
    opacity: 0.72;
}

.en-editorial-graph-edge.is-planned,
.en-char-map-edge.en-editorial-graph-edge.is-planned {
    stroke: var(--en-graph-muted);
    stroke-dasharray: 4 3;
    opacity: 0.7;
}

.en-editorial-graph-edge.is-manuscript {
    stroke: var(--en-graph-ink);
    opacity: 0.82;
}

.en-editorial-graph-edge.is-active {
    stroke: var(--en-graph-card-accent);
    stroke-width: 2.75;
    opacity: 1;
}

.en-character-spiderboard .en-char-map-edge.en-editorial-graph-edge,
.en-character-connection-map .en-char-map-edge.en-editorial-graph-edge,
.en-world-setting-map .en-char-map-edge.en-editorial-graph-edge {
    stroke-width: 2.5;
    opacity: 0.88;
}

.en-editorial-graph-node-dot,
.en-char-spider-link-dot.en-editorial-graph-node-dot {
    fill: var(--en-graph-node-fill);
    stroke: var(--en-graph-node-stroke);
    stroke-width: 2;
    opacity: 1;
}

.en-editorial-graph-node-dot.is-active {
    fill: var(--en-graph-node-selected);
    stroke: var(--en-graph-ink);
}

.en-editorial-graph-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin: 0.5rem 0 0.65rem;
}

.en-editorial-graph-legend {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--en-graph-muted);
}

.en-editorial-graph-legend-item::before {
    content: "—";
    margin-right: 0.25rem;
    color: var(--en-graph-edge);
}

.en-editorial-graph-legend-item.is-editorial::before {
    content: "- -";
}

.en-world-setting-map .en-editorial-graph-card {
    width: 7.5rem;
    min-height: 5.5rem;
    padding: 0.55rem 0.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.en-world-setting-map .en-editorial-graph-card-title {
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1.25;
    color: var(--en-graph-ink);
    word-break: break-word;
}

.en-world-setting-map .en-editorial-graph-card-meta {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--en-graph-muted);
}

.en-visual-world-fallback {
    margin-top: 0.75rem;
}

.en-visual-world-graph .en-visual-entity-chip {
    border: 2px solid var(--en-graph-node-stroke);
    border-right: 3px solid var(--en-graph-card-accent);
    border-radius: 10px;
    background: var(--en-graph-node-fill);
    box-shadow: var(--en-graph-shadow);
}

/**
 * Beat Board solitaire stacks — graph node language, scoped to beat solitaire only.
 * Does not touch Timeline or other guide tabs.
 */
.editors-note-beat-solitaire.en-beat-solitaire {
    border-color: var(--en-graph-border);
    background: var(--en-graph-bg);
}

.en-beat-solitaire .en-editorial-graph-solitaire-card {
    border: 2px solid var(--en-graph-node-stroke);
    border-right-width: 3px;
    border-right-style: solid;
    border-radius: 10px;
    background: var(--en-graph-node-fill);
    color: var(--en-graph-ink);
    box-shadow: var(--en-graph-shadow);
}

.en-beat-solitaire .en-editorial-graph-solitaire-card .en-beat-editorial-card-title {
    font-weight: 650;
    color: var(--en-graph-ink);
}

.en-beat-solitaire .en-editorial-graph-solitaire-card .en-beat-editorial-card-prov {
    color: var(--en-graph-muted);
    font-weight: 600;
    font-size: 0.62rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.en-beat-solitaire .en-editorial-graph-solitaire-card:hover,
.en-beat-solitaire .en-editorial-graph-solitaire-card:focus-visible {
    border-color: var(--en-graph-ink);
    box-shadow:
        5px 4px 14px rgba(32, 26, 18, 0.12);
    outline: none;
}

.en-beat-solitaire .en-editorial-graph-solitaire-card.is-selected {
    border-color: var(--en-graph-ink);
    box-shadow:
        0 0 0 2px var(--en-graph-node-selected),
        5px 4px 14px rgba(32, 26, 18, 0.14);
}

.en-beat-solitaire .en-editorial-graph-solitaire-card.is-stack-front,
.en-beat-solitaire .en-editorial-graph-solitaire-card.is-selected.is-stack-front {
    z-index: 500;
}

.en-beat-solitaire .en-editorial-graph-solitaire-card.is-selected:not(.is-stack-front) {
    z-index: 240;
}

/* Beat Board: grow with stacks — no nested vertical scroll clip (Timeline frame unchanged). */
.en-visual-frame.is-beat-board-solitaire-frame,
.en-visual-frame-scroll.is-beat-board-solitaire-scroll {
    overflow-x: visible;
    overflow-y: visible;
    max-height: none;
}

.editors-note-beat-solitaire.en-beat-solitaire {
    overflow: visible;
}

.en-beat-solitaire-scroller.editors-note-beat-timeline-scroller {
    overflow-y: visible;
    max-height: none;
}