* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: Arial, Helvetica, sans-serif;
    background: #ffffff;
}
main { display: block; width: 100%; height: 100%; }
.layout { display: flex; flex-direction: row; width: 100%; height: 100%; }
.diagram-panel {
    width: 70%;
    height: 100%;
    background: aliceblue;
    border-right: 1px solid #cbd5e1;
    display: flex;
    flex-direction: column;
    overflow: visible;
}
.diagram-title {
    font-size: 17px; color: #0d47a1; text-align: center;
    padding: 10px 8px 0 8px; font-weight: 600;
}
.mermaid {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
}
.mermaid svg { max-width: 100%; height: auto; }
.info-panel {
    width: 30%;
    height: 100%;
    padding: 12px;
    overflow: visible;
    background: #ffffff;
}
.info-panel h3 { font-size: 16px; color: #455a64; margin: 10px 0 6px 0; }
.legend {
    margin-bottom: 10px; font-size: 12.5px;
    border: 1px solid #cbd5e1; border-radius: 4px; padding: 8px 10px; background: #fff;
}
.legend-title { font-weight: 600; margin-bottom: 6px; color: #455a64; }
.legend-item { display: flex; align-items: center; margin: 3px 0; }
.legend-dot {
    display: inline-block; width: 14px; height: 14px; border-radius: 3px;
    margin-right: 8px; border: 1px solid #607d8b; flex-shrink: 0;
}
.callout {
    border: 1px solid #cbd5e1; background: #f8fafc; border-radius: 4px;
    padding: 8px 10px; font-size: 12.5px; color: #37474f; margin-bottom: 6px; line-height: 1.4;
}
.callout-title { font-weight: 600; margin-bottom: 4px; color: #0d47a1; }
#panelWrap { position: relative; }
#panel {
    background-color: #f8fafc; color: #334155; border: 1px solid #e2e8f0;
    padding: 10px; border-radius: 6px; font-size: 13.5px; line-height: 1.4;
}
.node, .node * { cursor: pointer; }

@media (max-width: 700px) {
    html, body { overflow: auto; }
    .layout { flex-direction: column; }
    .diagram-panel, .info-panel { width: 100%; }
    .diagram-panel { border-right: none; border-bottom: 1px solid #cbd5e1; }
}
