.series-map-block { margin: 28px 0; border: 1px solid #d7dee8; border-radius: 16px; background: #fff; color: #182638; }
.series-map-block > summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px; cursor: pointer; list-style: none; }
.series-map-block > summary::-webkit-details-marker { display: none; }
.series-map-block > summary strong { display: block; font-size: 22px; line-height: 1.3; }
.series-map-block > summary small { display: block; margin-top: 6px; color: #536277; font-size: 14px; }
.series-map, .series-map * { box-sizing: border-box; }
.series-map { --sm-accent: #3da9da; --sm-border: #d7dee8; --sm-grab: url('./series-map-grab.svg') 12 12, grab; --sm-grabbing: url('./series-map-grabbing.svg') 12 12, grabbing; font: 14px/1.45 system-ui, sans-serif; background: #fff; color: #182638; min-width: 0; border-radius: 16px; user-select: none; }
.series-map [hidden] { display: none; }
.series-map .series-map-toolbar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px; padding: 14px; border-bottom: 1px solid var(--sm-border); }
.series-map .series-map-button { display: inline-flex; justify-content: center; align-items: center; min-height: 38px; padding: 7px 12px; border: 1px solid var(--sm-border); border-radius: 8px; background: #fff; color: #182638; font: inherit; text-transform: none; letter-spacing: normal; cursor: pointer; box-shadow: none; }
.series-map .series-map-button:hover { background: #edf4ff; border-color: var(--sm-accent); }
.series-map button:focus, .series-map input:focus, .series-map select:focus, .series-map summary:focus, .series-map-stage:focus { outline: none; box-shadow: none; }
.series-map.is-keyboard button:focus-visible, .series-map.is-keyboard input:focus-visible, .series-map.is-keyboard select:focus-visible, .series-map.is-keyboard summary:focus-visible, .series-map.is-keyboard .series-map-stage:focus-visible { outline: 3px solid #3da9da; outline-offset: 2px; }
.series-map .series-map-zoom { min-width: 46px; text-align: center; font-variant-numeric: tabular-nums; }
.series-map .series-map-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; margin:0; font-size: 12px; }
.series-map .series-map-field select, .series-map .series-map-field input { width: 100%; min-width: 0; max-width: 100%; height: 38px; margin: 0; padding: 6px 10px; border: 1px solid var(--sm-border); border-radius: 8px; background: #fff; color: #182638; font: 14px system-ui, sans-serif; }
.series-map .series-map-toolbar .series-map-field { flex: 1 1 210px; max-width: 280px; }
.series-map .series-map-toolbar > .series-map-button { height:38px; }
.series-map .series-map-controls { padding: 12px 16px; border-bottom: 1px solid var(--sm-border); }
.series-map .series-map-controls > summary, .series-map .series-map-game-links > summary { display:inline-flex; align-items:center; gap:8px; padding:7px 12px; border:1px solid var(--sm-border); border-radius:18px; background:#f3f7fa; cursor:pointer; font-weight:600; list-style:none; }
.series-map .series-map-controls > summary::-webkit-details-marker, .series-map .series-map-game-links > summary::-webkit-details-marker { display:none; }
.series-map .series-map-controls > summary::after, .series-map .series-map-game-links > summary::after { content:''; width:7px; height:7px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(45deg); margin-top:-3px; }
.series-map .series-map-controls[open] > summary::after, .series-map .series-map-game-links[open] > summary::after { transform:rotate(225deg); margin-top:3px; }
.series-map .series-map-control-body { padding-top: 14px; }
.series-map .series-map-filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 10px; }
.series-map .series-map-layer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.series-map .series-map-layer-grid fieldset { min-width: 0; max-height: 240px; overflow-y: auto; margin: 0; padding: 10px; border: 1px solid var(--sm-border); border-radius: 8px; }
.series-map .series-map-layer-grid legend { padding: 0 5px; font: 600 14px/1.4 system-ui, sans-serif; }
.series-map .series-map-check { display: flex; align-items: center; gap: 8px; margin: 5px 0; cursor: pointer; font-size: 13px; overflow-wrap: anywhere; }
.series-map .series-map-check input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--sm-accent); }
.series-map .series-map-portrait { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.series-map .series-map-stage { position: relative; width: 100%; height: 560px; overflow: clip; touch-action: none; cursor: var(--sm-grab); background: #e0e1e3; isolation: isolate; }
.series-map .series-map-stage.is-panning, .series-map .series-map-stage.is-panning * { cursor: var(--sm-grabbing); }
.series-map .series-map-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; width: 1px; height: 1px; }
.series-map .series-map-lines { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.series-map .series-map-edge path { fill: none; stroke: #9aa5b3; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.series-map .series-map-edge circle { fill: #9aa5b3; }
.series-map .series-map-edge.is-sequence > path:first-child { stroke: #9aa5b3; }
.series-map .series-map-edge.is-suggested > path:first-child { stroke-dasharray: 4 5; }
.series-map .series-map-edge.is-highlighted > path:first-child { stroke: #3da9da; stroke-width: 3; }
.series-map .series-map-edge.is-highlighted circle { fill: #3da9da; }
.series-map .series-map-edge.is-muted { opacity: .2; }
.series-map .series-map-edge path.series-map-edge-hit { stroke: transparent; stroke-width: 14; stroke-dasharray: none; pointer-events: stroke; cursor: pointer; }
.series-map .series-map-edge:focus-visible > path:first-child { stroke: #3da9da; stroke-width: 4; }
.series-map .series-map-edge-tooltip { position: absolute; top: 72px; left: 16px; max-width: calc(100% - 32px); padding: 8px 12px; border: 1px solid var(--sm-border); border-radius: 8px; background: #fff; color: #182638; pointer-events: none; z-index: 3; }
.series-map .series-map-connection-detail { flex: 1 1 100%; padding: 8px 0; border-top: 1px solid var(--sm-border); font-size: 12px; }
.series-map .series-map-connection-detail p { margin: 5px 0 0; font: inherit; }
.series-map .series-map-node { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: stretch; gap: 0; width: 192px; height: auto; margin: 0; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #182638; text-align: left; font: inherit; text-transform: none; letter-spacing: normal; box-shadow: none; transform-origin: 0 0; cursor: var(--sm-grab); user-select: none; }
.series-map .series-map-node > img { width: 192px; height: 192px; object-fit: cover; object-position: center 25%; border-radius: 8px; flex: 0 0 auto; pointer-events: none; }
.series-map .series-map-node-meta { position: absolute; left: 0; top: -31px; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #647184; font-size: 11px; white-space: nowrap; }
.series-map .series-map-node-meta > span:first-child { border-radius:10px; padding:2px 5px; margin-left:-5px; }
.series-map .series-map-node.is-highlighted .series-map-node-meta > span:first-child { color:#fff; background:var(--sm-accent); }
.series-map .series-map-node:hover, .series-map .series-map-node:focus { background: transparent; }
.series-map.is-keyboard .series-map-node:focus-visible { outline: none; }
.series-map.is-keyboard .series-map-node:focus-visible > img { outline: 3px solid #3da9da; outline-offset: 3px; }
.series-map .series-map-node-copy { min-width: 0; display: flex; flex-direction: column; gap: 5px; padding: 10px 0; }
.series-map .series-map-node-copy strong { font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.series-map .series-map-node-copy small { color: #536277; font-size: 11px; }
.series-map .series-map-node-copy > span { color: #3da9da; font-size: 10px; line-height: 1.2; }
.series-map .series-map-node.is-highlighted > img { outline: 3px solid #3da9da; outline-offset: 3px; }
.series-map .series-map-node.is-muted { opacity: .35; }
.series-map .series-map-node.is-selected > img { outline: 3px solid #3da9da; outline-offset: 3px; }
.series-map .series-map-lane { position: absolute; left: 0; width: 192px; text-align:center; color: #3da9da; font-size: 22px; line-height: 1.25; display: flex; flex-direction: column; gap: 8px; }
.series-map .series-map-lane small { color: #536277; font-size: 13px; }
.series-map .series-map-node, .series-map .series-map-node * { cursor: pointer; }
.series-map .series-map-edge { cursor: pointer; }
.series-map .series-map-canvas-tools { position: absolute; left: 16px; top: 16px; z-index: 2; display: flex; align-items: center; gap: 4px; padding: 5px; border: 1px solid #d7dee8; border-radius: 10px; background: #ffffffed; box-shadow: 0 2px 6px #1935540b; cursor: default; }
.series-map .series-map-canvas-tools .series-map-button { min-width: 34px; padding: 5px 9px; border: 0; background: transparent; font-size: 18px; }
.series-map .series-map-empty { position: absolute; inset: 40% 20px auto; text-align: center; color: #536277; }
.series-map .series-map-inspector { position:absolute; z-index:4; display:flex; flex-direction:column; gap:8px; align-items:stretch; width:280px; max-width:calc(100% - 16px); max-height:calc(100% - 84px); overflow-y:auto; padding:12px; border:1px solid var(--sm-border); border-radius:12px; background:#fff; box-shadow:0 6px 20px #18263820; cursor:default; }
.series-map .series-map-inspector:empty { display: none; }
.series-map .series-map-inspector > span { flex: 0 0 auto; font-size: 14px; color: #536277; overflow-wrap: anywhere; }
.series-map .series-map-game-links { flex: 1 1 100%; }
.series-map .series-map-game-links summary { cursor: pointer; }
.series-map .series-map-character-summary { padding: 0 16px; font-size: 13px; }
.series-map .series-map-character-summary p { font: inherit; margin: 10px 0; }
.series-map .series-map-character-summary:empty { display: none; }
.series-map .series-map-footer { padding: 12px 16px; color: #536277; font-size: 14px; }
.series-map .series-map-footer p { margin: 6px 0; font: inherit; }
.series-map-dialog { position: fixed; inset: 0; width: calc(100vw - 32px); max-width: 1800px; max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 1px solid #d7dee8; border-radius: 16px; background: #fff; color: #182638; }
.series-map-dialog::backdrop { background: #0b172dc9; }
.series-map-dialog:fullscreen { width: 100%; max-width: none; max-height: 100%; border: 0; border-radius: 0; overflow-y: auto; }
.series-map-dialog .series-map-stage { height: max(300px, calc(100dvh - 260px)); }
.series-map-dialog .series-map-controls[open] { max-height: 40dvh; overflow-y: auto; }
@media (max-width: 650px) {
    .series-map-block > summary { padding: 16px; }
    .series-map-block > summary strong { font-size: 19px; }
    .series-map .series-map-layer-grid { grid-template-columns: minmax(0, 1fr); }
    .series-map .series-map-stage { height: 420px; }
    .series-map .series-map-toolbar { gap: 6px; padding: 10px; }
    .series-map .series-map-toolbar .series-map-field { flex:1 1 150px; max-width:none; }
    .series-map .series-map-button { padding: 7px 10px; font-size: 12px; }
    .series-map-dialog { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); }
}

.series-map .series-map-inspector { font-size:14px; }
.series-map .series-map-game-facts { display:grid; grid-template-columns:auto minmax(0,1fr); gap:6px 8px; margin:0; font-size:14px; }
.series-map .series-map-game-facts dt { font-weight:600; }
.series-map .series-map-game-facts dd { margin:0; overflow-wrap:anywhere; }
.series-map .series-map-game-timing { margin:3px 0; font:inherit; color:#536277; }
.series-map .series-map-footer small { font-size:12px; }