/* Disputed regions page */

.disputed-intro {
    margin-bottom: 12px;
}

.disputed-notice {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px 16px;
    border: 1px solid rgba(37, 99, 235, 0.24);
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.08);
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.disputed-notice strong {
    color: var(--text-primary);
}

.disputed-notice a {
    color: var(--accent-primary);
    font-weight: 700;
}

.disputed-controls {
    align-items: flex-end;
}

.disputed-map-section {
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
}

.disputed-map-guidance {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.04);
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.disputed-map-guidance strong {
    color: var(--text-primary);
}

.disputed-map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
}

.disputed-map-card,
.disputed-map-panel {
    min-width: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
}

.disputed-map-card {
    overflow: hidden;
}

.disputed-map-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.disputed-map-toolbar-title {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 800;
}

.disputed-map-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.disputed-map-controls button {
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font: 700 12px/1 "Inter", "Noto Sans KR", sans-serif;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.disputed-map-controls button:hover {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    color: #ffffff;
}

.disputed-map-canvas-wrap {
    position: relative;
    width: 100%;
    min-height: 360px;
    overflow: hidden;
    background:
        linear-gradient(rgba(15, 23, 42, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.055) 1px, transparent 1px),
        linear-gradient(180deg, #e0e7ff, #eaf2ff);
    background-size: 12.5% 25%, 12.5% 25%, 100% 100%;
    touch-action: none;
}

.disputed-map-stage,
.disputed-map-canvas-wrap canvas,
.disputed-map-canvas-wrap svg {
    position: absolute;
    inset: 0;
}

.disputed-map-stage {
    transform-origin: 0 0;
}

.disputed-map-canvas-wrap.is-panning {
    cursor: grabbing;
}

.disputed-map-marker {
    position: absolute;
    outline: none;
    cursor: pointer;
    pointer-events: all;
}

.disputed-map-marker.is-hidden {
    display: none;
}

.marker-hit-target {
    fill: transparent;
    pointer-events: all;
}

.marker-stem {
    display: none;
    stroke: rgba(15, 23, 42, 0.28);
    stroke-dasharray: 3 3;
    stroke-linecap: round;
    stroke-width: 1.2;
}

.marker-stem.is-visible {
    display: block;
}

.marker-halo {
    fill: rgba(255, 255, 255, 0.9);
    stroke: rgba(15, 23, 42, 0.2);
    stroke-width: 1;
    filter: drop-shadow(0 7px 12px rgba(15, 23, 42, 0.22));
    pointer-events: none;
    transition: fill 0.16s ease, stroke 0.16s ease, stroke-width 0.16s ease;
}

.marker-dot {
    stroke: rgba(255, 255, 255, 0.96);
    stroke-width: 2;
    pointer-events: none;
    transition: opacity 0.16s ease, stroke-width 0.16s ease;
}

.disputed-map-marker.risk-high .marker-dot {
    fill: #b91c1c;
}

.disputed-map-marker.risk-medium .marker-dot {
    fill: #b45309;
}

.disputed-map-marker.risk-low .marker-dot {
    fill: #334155;
}

.marker-symbol {
    fill: #ffffff;
    font: 900 9px/1 "Inter", "Noto Sans KR", sans-serif;
    pointer-events: none;
}

.disputed-map-marker:hover,
.disputed-map-marker:focus-visible,
.disputed-map-marker.is-active {
    z-index: 3;
}

.disputed-map-marker:hover .marker-halo,
.disputed-map-marker:focus-visible .marker-halo,
.disputed-map-marker.is-active .marker-halo {
    fill: rgba(255, 255, 255, 0.98);
    stroke: rgba(37, 99, 235, 0.42);
    stroke-width: 1.8;
}

.disputed-map-marker:hover .marker-dot,
.disputed-map-marker:focus-visible .marker-dot,
.disputed-map-marker.is-active .marker-dot {
    opacity: 0.9;
    stroke-width: 2.4;
}

.disputed-map-marker.is-active .marker-halo {
    stroke: rgba(37, 99, 235, 0.58);
    stroke-width: 2.4;
}

.disputed-map-marker.is-edge-marker .marker-halo {
    stroke-dasharray: 3 2;
}

.disputed-map-tooltip {
    position: absolute;
    z-index: 30;
    max-width: 300px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.95);
    color: #ffffff;
    font-size: 12px;
    line-height: 1.45;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

.disputed-map-tooltip.visible {
    opacity: 1;
}

.disputed-map-tooltip p {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.84);
}

.disputed-map-tooltip .tooltip-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
    font-weight: 800;
}

.tooltip-edge-note {
    color: rgba(255, 255, 255, 0.72) !important;
}

.disputed-map-status {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 20;
    max-width: calc(100% - 24px);
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.35;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.disputed-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    padding: 10px 12px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.disputed-map-legend span {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.legend-marker {
    display: inline-block;
    width: 11px;
    height: 11px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.14);
}

.legend-marker.risk-high {
    background: #b91c1c;
}

.legend-marker.risk-medium {
    background: #b45309;
}

.legend-marker.risk-low {
    background: #334155;
}

.disputed-map-panel {
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 14px;
    height: fit-content;
}

.disputed-map-panel-title {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.3;
}

.disputed-map-panel-subtitle,
.disputed-map-panel-placeholder {
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
}

.disputed-map-panel-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.disputed-map-panel-fields {
    display: grid;
    gap: 9px;
    margin: 0;
}

.disputed-map-panel-fields dt {
    margin-bottom: 2px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.disputed-map-panel-fields dd {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.disputed-map-panel-action {
    justify-self: start;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid rgba(37, 99, 235, 0.3);
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent-primary);
    font: 800 12px/1 "Inter", "Noto Sans KR", sans-serif;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.disputed-map-panel-action:hover,
.disputed-map-panel-action:focus-visible {
    background: var(--accent-primary);
    color: #ffffff;
    outline: none;
}

.disputed-section {
    overflow: visible;
}

.disputed-region-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 16px;
    background: var(--bg-secondary);
}

.disputed-region-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
}

.disputed-region-card.is-map-active {
    border-color: rgba(37, 99, 235, 0.42);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.disputed-region-card.is-fixed {
    border-color: rgba(220, 38, 38, 0.28);
    background: linear-gradient(180deg, rgba(254, 242, 242, 0.8), var(--bg-primary));
}

.disputed-card-header {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.disputed-card-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    line-height: 1.25;
    letter-spacing: 0;
}

.disputed-card-header p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.45;
}

.disputed-card-actions {
    display: grid;
    justify-items: end;
    gap: 8px;
    flex: 0 0 auto;
}

.disputed-card-map-action {
    min-height: 28px;
    padding: 5px 10px;
    border: 1px solid rgba(37, 99, 235, 0.28);
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent-primary);
    font: 800 12px/1 "Inter", "Noto Sans KR", sans-serif;
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.disputed-card-map-action:hover,
.disputed-card-map-action:focus-visible {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    color: #ffffff;
    outline: none;
}

.disputed-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.status-pill.fixed {
    border-color: rgba(220, 38, 38, 0.32);
    background: rgba(220, 38, 38, 0.1);
    color: #991b1b;
}

.status-pill.open {
    border-color: rgba(22, 163, 74, 0.25);
    background: rgba(22, 163, 74, 0.08);
    color: #166534;
}

.status-pill.tension-very_high {
    border-color: rgba(220, 38, 38, 0.3);
    background: rgba(220, 38, 38, 0.08);
    color: #991b1b;
}

.status-pill.tension-high {
    border-color: rgba(245, 158, 11, 0.34);
    background: rgba(245, 158, 11, 0.12);
    color: #92400e;
}

.status-pill.tension-medium {
    border-color: rgba(37, 99, 235, 0.24);
    background: rgba(59, 130, 246, 0.08);
    color: #1d4ed8;
}

.status-pill.tension-low {
    border-color: rgba(71, 85, 105, 0.2);
    background: rgba(100, 116, 139, 0.08);
    color: #334155;
}

.disputed-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.disputed-meta-row span {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 3px 8px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
}

.disputed-lock-note {
    display: grid;
    gap: 3px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(220, 38, 38, 0.24);
    border-radius: 8px;
    background: rgba(254, 226, 226, 0.72);
    color: #7f1d1d;
    font-size: 12px;
    line-height: 1.45;
}

.disputed-lock-note strong {
    color: #991b1b;
}

.disputed-fields {
    display: grid;
    gap: 10px;
    margin: 0;
}

.disputed-fields div {
    min-width: 0;
}

.disputed-fields dt {
    margin-bottom: 3px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.disputed-fields dd {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.disputed-empty {
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

@media (max-width: 1080px) {
    .disputed-map-layout {
        grid-template-columns: 1fr;
    }

    .disputed-region-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .disputed-map-layout {
        padding: 12px;
    }

    .disputed-map-toolbar {
        display: grid;
        align-items: start;
    }

    .disputed-map-controls {
        width: 100%;
    }

    .disputed-map-controls button {
        flex: 1 1 0;
    }

    .disputed-map-canvas-wrap {
        min-height: 320px;
    }

    .disputed-region-list {
        padding: 12px;
    }

    .disputed-card-header {
        display: grid;
    }

    .disputed-card-actions {
        justify-items: start;
    }

    .disputed-card-badges {
        justify-content: flex-start;
    }
}
