.d3Viewer {
    position: relative;
    margin: 15px 0;
    height: clamp(340px, 43vw, 560px);
    overflow: hidden;
    border-radius: 12px;
    background: #f2ece2;
    isolation: isolate;
}
.d3Viewer canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.d3Viewer:fullscreen { width: 100% !important; height: 100% !important; margin: 0; border-radius: 0; }
.d3Viewer .fullscreen {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #80664b url('../images/icons/fullscreen.png') center / 26px no-repeat;
    cursor: pointer;
    z-index: 2;
}
.d3Viewer .hint-controls {
    position: absolute;
    bottom: 12px;
    left: 14px;
    max-width: calc(100% - 82px);
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(255, 252, 246, 0.85);
    color: #68523e;
    font: 12px/1.4 sans-serif;
    pointer-events: none;
    z-index: 2;
}
.d3Viewer .d3-loading {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(250, 248, 244, 0.96);
    z-index: 10;
}
.d3Viewer .d3-loading-box {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    padding: 24px;
    box-sizing: border-box;
    text-align: center;
}
.d3Viewer .d3-loading-spinner {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    box-sizing: border-box;
    border: 3px solid #dfd3c4;
    border-top-color: #9a6136;
    border-radius: 50%;
    animation: d3viewer-loading 1s linear infinite;
}
.d3Viewer .d3-loading-message {
    max-width: 100%;
    margin: 0;
    color: #493b30;
    font: 600 18px/1.5 sans-serif;
    white-space: normal;
    overflow-wrap: anywhere;
}
.d3Viewer .d3-loading-message span {
    color: #6f6257;
    font-size: 14px;
    font-weight: 400;
}
@keyframes d3viewer-loading { to { transform: rotate(360deg); } }
@media (max-width: 600px) {
    .d3Viewer { height: 380px; }
    .d3Viewer .hint-controls { font-size: 11px; }
}
