@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: #ffffff;
    color: #1e293b;
    min-height: 100vh;
}

/* ===== HEADER ===== */
.diagram-header {
    text-align: center;
    padding: 28px 20px 6px;
}
.diagram-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
}
.diagram-header p {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

/* ===== LEGEND ===== */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    padding: 10px 20px 18px;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #475569;
    font-weight: 500;
}
.legend-swatch {
    width: 32px;
    height: 18px;
    border-radius: 4px;
    border: 1.5px solid;
}

/* ===== CANVAS ===== */
#diagram-container {
    position: relative;
    width: 1700px;
    margin: 0 auto 60px;
    padding: 0 16px;
}

svg#canvas {
    width: 100%;
    display: block;
}

/* ===== TOOLTIP ===== */
.legend-toggle { user-select: none; border-radius: 4px; padding: 2px 6px; transition: opacity 0.2s; }
.legend-toggle:hover { background: #f1f5f9; }
.legend-toggle.hidden { opacity: 0.35; text-decoration: line-through; }

#tooltip-box {
    display: none;
    position: fixed;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 11px;
    color: #475569;
    max-width: 300px;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    line-height: 1.5;
    pointer-events: none;
}
