.mr-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    align-items: start;
    margin-top: 2rem;
}
@media (max-width: 900px) {
    .mr-layout { grid-template-columns: 1fr; }
}

.mr-plot-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    aspect-ratio: 1 / 1;
    max-width: 720px;
    margin: 0 auto;
    position: relative;
}
.mr-plot {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    user-select: none;
}
.mr-plot rect.cell { stroke: rgba(0,0,0,0.25); stroke-width: 1; }
.mr-plot text.cell-num {
    fill: rgba(0,0,0,0.55);
    font-size: 11px;
    font-weight: 700;
    pointer-events: none;
    text-anchor: middle;
    dominant-baseline: central;
}
.mr-plot text.axis-label {
    fill: rgba(255,255,255,0.7);
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
}
.mr-plot text.axis-num {
    fill: rgba(255,255,255,0.4);
    font-size: 11px;
    font-weight: 600;
    pointer-events: none;
}
.mr-plot circle.point {
    cursor: grab;
    stroke: #0a0a0a;
    stroke-width: 2.5;
}
.mr-plot circle.point.selected { stroke: #fff; }
.mr-plot text.label {
    fill: var(--text);
    font-size: 11px;
    font-weight: 600;
    pointer-events: none;
    paint-order: stroke;
    stroke: rgba(10,10,10,0.85);
    stroke-width: 3;
    stroke-linejoin: round;
}

.mr-help {
    text-align: center;
    margin-top: 0.75rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-style: italic;
}

.mr-side {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}
.mr-side h3 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
}
.mr-add-form { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.mr-input, .mr-textarea {
    flex: 1;
    padding: 0.5rem 0.8rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
}
.mr-input:focus, .mr-textarea:focus { border-color: var(--accent); }
.mr-textarea { width: 100%; min-height: 60px; resize: vertical; }
.mr-add-btn {
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: white;
    border: 0;
    border-radius: var(--radius-xs);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--t);
}
.mr-add-btn:hover { background: var(--accent-hover); }

.mr-list { list-style: none; margin-bottom: 1.25rem; }
.mr-list-empty { color: var(--text-muted); font-size: 0.82rem; padding: 0.5rem 0 1rem; }
.mr-list-item {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    cursor: pointer;
    flex-wrap: wrap;
}
.mr-list-item.selected {
    background: var(--accent-soft);
    padding: 0.55rem 8px;
    margin: 0 -8px;
    border-radius: var(--radius-xs);
    border-bottom-color: transparent;
}
.mr-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.mr-list-name {
    flex: 1; min-width: 100px;
    background: transparent;
    border: 0;
    color: var(--text);
    outline: none;
    font-family: inherit;
    font-size: 0.85rem;
}
.mr-list-name:focus { color: var(--accent); }
.mr-list-score {
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    font-size: 0.78rem;
}
.mr-list-x {
    background: transparent; border: 0;
    color: var(--text-muted);
    cursor: pointer;
    width: 22px; height: 22px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all var(--t);
}
.mr-list-x:hover { background: rgba(239,68,68,0.15); color: var(--red); }

.mr-detail {
    margin: 0.5rem 0 1rem;
    padding: 0.75rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
}
.mr-detail h4 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    margin-top: 0.6rem;
}
.mr-detail h4:first-child { margin-top: 0; }
.mr-detail-meta {
    display: flex; flex-wrap: wrap; gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.mr-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.mr-pill.low { background: rgba(34,197,94,0.15); color: var(--green); }
.mr-pill.med { background: rgba(255,235,59,0.18); color: var(--yellow); }
.mr-pill.high { background: rgba(255,152,0,0.18); color: #FF9800; }
.mr-pill.crit { background: rgba(239,68,68,0.15); color: var(--red); }
.mr-pill.strat { background: rgba(23,141,154,0.12); color: var(--accent); }

.mr-actions { display: flex; flex-direction: column; gap: 0.45rem; }
.mr-action-btn {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.55rem 0.9rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text);
    font-family: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all var(--t);
}
.mr-action-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.mr-action-btn.primary { background: var(--accent); color: white; border-color: var(--accent); font-weight: 600; }
.mr-action-btn.primary:hover { background: var(--accent-hover); }
.mr-action-btn.danger:hover { color: var(--red); border-color: rgba(239,68,68,0.4); background: rgba(239,68,68,0.06); }
.mr-action-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.mr-error {
    margin-top: 0.75rem;
    padding: 0.5rem 0.8rem;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: var(--radius-xs);
    color: var(--red);
    font-size: 0.8rem;
}
