.knowledge-map-page {
    background: #f8f7f6;
    color: #1f2933;
}

.km-hero {
    background: rgba(158, 80, 21, 0.06);
    padding: 38px 0;
    border-bottom: 1px solid rgba(158, 80, 21, 0.1);
}

.km-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #9e5015;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    margin-bottom: 18px;
}

.km-title {
    font-family: "Playfair Display", serif;
    font-size: clamp(34px, 4vw, 58px);
    font-weight: 800;
    margin-bottom: 12px;
    color: #1f2933;
}

.km-subtitle {
    max-width: 760px;
    font-size: 17px;
    color: #667085;
    line-height: 1.7;
}

.km-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(360px, 100%);
    background: rgba(158, 80, 21, 0.06);
    border-radius: 12px;
    padding: 10px 14px;
}

.km-search-box input {
    border: 0;
    outline: 0;
    background: transparent;
    width: 100%;
    font-size: 14px;
}

.km-workspace-wrap {
    padding: 32px 0 20px;
}

.km-workspace {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr) 390px;
    height: 790px;
    background: #fff;
    border: 1px solid rgba(158, 80, 21, 0.1);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(44, 44, 44, 0.06);
}

.km-filter-panel,
.km-detail-panel {
    background: #fff;
    overflow-y: auto;
}

.km-filter-panel {
    border-right: 1px solid rgba(158, 80, 21, 0.1);
}

.km-detail-panel {
    border-left: 1px solid rgba(158, 80, 21, 0.1);
    padding: 32px;
}

.km-panel-header {
    padding: 24px;
    border-bottom: 1px solid rgba(158, 80, 21, 0.08);
}

.km-panel-header h3 {
    font-family: "Playfair Display", serif;
    font-size: 20px;
    font-weight: 800;
    margin: 0;
}

.km-panel-header p {
    margin: 4px 0 0;
    font-size: 11px;
    font-weight: 800;
    color: #98a2b3;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.km-panel-body {
    padding: 24px;
}

.km-filter-group {
    margin-bottom: 30px;
}

.km-filter-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9e5015;
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 14px;
}

.km-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.km-chip {
    border: 1px solid rgba(158, 80, 21, 0.18);
    background: rgba(158, 80, 21, 0.08);
    color: #9e5015;
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.km-chip.active {
    background: #9e5015;
    color: #fff;
}

.km-select {
    background-color: rgba(158, 80, 21, 0.06);
    border: 0;
    border-radius: 12px;
    font-size: 14px;
}

.km-upsc-toggle {
    border-top: 1px solid rgba(158, 80, 21, 0.08);
    padding-top: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 800;
    color: #344054;
}

.km-switch input {
    display: none;
}

.km-switch span {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    background: #e4e7ec;
    border-radius: 999px;
    cursor: pointer;
    transition: .2s ease;
}

.km-switch span:before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: .2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,.15);
}

.km-switch input:checked + span {
    background: #9e5015;
}

.km-switch input:checked + span:before {
    transform: translateX(20px);
}

.km-clear-filter-btn {
    width: 100%;
    border: 1px solid rgba(158, 80, 21, .2);
    background: #fff;
    color: #9e5015;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 800;
    margin-top: 20px;
}

.km-canvas-area {
    position: relative;
    overflow: hidden;
    background-color: rgba(234, 221, 207, 0.22);
    background-image: radial-gradient(circle, #eaddcf 1px, transparent 1px);
    background-size: 30px 30px;
}

.km-canvas {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.km-svg {
    position: absolute;
    inset: 0;
    width: 4000px;
    height: 3000px;
    pointer-events: none;
    z-index: 1;
    border: 1px solid rgba(255, 0, 0, 0.1); /* Temporary debug border */
}

.km-nodes-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.km-map-node {
    position: absolute;
    border: 1px solid rgba(158, 80, 21, 0.28);
    background: #fff;
    color: #344054;
    border-radius: 999px;
    min-width: 110px;
    max-width: 190px;
    padding: 9px 15px;
    box-shadow: 0 10px 25px rgba(44, 44, 44, 0.09);
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
    text-align: center;
}

.km-map-node:hover,
.km-map-node.selected {
    background: #9e5015;
    color: #fff;
    box-shadow: 0 14px 34px rgba(158, 80, 21, 0.24);
}

.km-map-node.core {
    min-width: 96px;
    min-height: 96px;
    border-radius: 999px;
    background: #9e5015;
    color: #fff;
    border: 4px solid #fff;
    font-family: "Playfair Display", serif;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.km-node-title {
    display: block;
    font-weight: 800;
    line-height: 1.25;
    font-size: 13px;
}

.km-node-upsc {
    display: inline-flex;
    margin-top: 5px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .06em;
    background: rgba(16, 185, 129, .12);
    color: #027a48;
    border-radius: 999px;
    padding: 2px 7px;
}

.km-map-node:hover .km-node-upsc,
.km-map-node.selected .km-node-upsc,
.km-map-node.core .km-node-upsc {
    background: rgba(255,255,255,.18);
    color: #fff;
}

.km-line {
    stroke: #9e5015;
    stroke-width: 1.6;
    opacity: .36;
    fill: none;
    marker-end: url(#km-user-arrow);
}

.km-controls {
    position: absolute;
    left: 24px;
    bottom: 24px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.km-controls button {
    width: 42px;
    height: 42px;
    border: 0;
    background: #fff;
    color: #667085;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(44, 44, 44, .12);
    display: flex;
    align-items: center;
    justify-content: center;
}

.km-controls button span {
    font-size: 20px;
}

.km-controls button:hover {
    color: #9e5015;
}

.km-related-item span.material-symbols-outlined {
    color: #9e5015;
    font-size: 24px;
}

.km-avatar span.material-symbols-outlined {
    font-size: 20px;
    color: #98a2b3;
}

.km-no-selection span.material-symbols-outlined {
    font-size: 54px;
    color: #9e5015;
    opacity: .35;
    margin-bottom: 15px;
}

.km-path-icon span.material-symbols-outlined {
    font-size: 22px;
}

.km-context-section span.material-symbols-outlined {
    font-size: 54px;
    color: #9e5015;
}

.km-locked-overlay span.material-symbols-outlined {
    font-size: 32px;
    color: #9e5015;
    margin-bottom: 10px;
}

.km-filter-title span.material-symbols-outlined {
    font-size: 18px;
}

.km-back-btn span.material-symbols-outlined {
    font-size: 18px;
}

.km-search-box span.material-symbols-outlined {
    color: #9e5015;
    font-size: 20px;
}

.km-canvas-empty span.material-symbols-outlined {
    font-size: 42px;
    color: #9e5015;
    opacity: .45;
}

.km-canvas-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    text-align: center;
    color: #98a2b3;
    z-index: 4;
    pointer-events: none;
}

.km-canvas-empty i {
    font-size: 42px;
    color: #9e5015;
    opacity: .45;
}

.km-selected-label {
    display: inline-flex;
    background: rgba(158, 80, 21, 0.09);
    color: #9e5015;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    padding: 5px 8px;
    border-radius: 6px;
    margin-bottom: 18px;
}

.km-detail-panel h2 {
    font-family: "Playfair Display", serif;
    font-size: 34px;
    font-weight: 800;
    margin-bottom: 10px;
}

.km-node-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: #667085;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 20px;
}

.km-dot {
    width: 8px;
    height: 8px;
    background: #9e5015;
    border-radius: 50%;
}

.km-upsc-pill,
.km-member-pill {
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.km-upsc-pill {
    background: #dcfae6;
    color: #027a48;
}

.km-member-pill {
    background: #fff3cd;
    color: #946200;
}

.km-node-summary,
.km-node-description {
    color: #667085;
    line-height: 1.75;
    font-size: 14px;
}

.blurred {
    filter: blur(4px);
    user-select: none;
}

.km-locked-content {
    position: relative;
}

.km-locked-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
    z-index: 10;
    text-align: center;
    padding: 20px;
    border-radius: 12px;
}

.km-locked-overlay i {
    font-size: 32px;
    color: #9e5015;
    margin-bottom: 10px;
}

.km-locked-overlay p {
    font-size: 13px;
    font-weight: 700;
    color: #1f2933;
    margin: 0;
}

.km-detail-section {
    margin-top: 30px;
}

.km-detail-section h4 {
    font-size: 12px;
    font-weight: 900;
    color: #344054;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 14px;
}

.km-related-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    text-decoration: none;
    color: #344054;
    border: 1px solid transparent;
}

.km-related-item:hover {
    background: rgba(158, 80, 21, 0.06);
    border-color: rgba(158, 80, 21, 0.14);
}

.km-related-item i {
    color: #9e5015;
    font-size: 22px;
}

.km-related-item span {
    display: block;
    color: #98a2b3;
    font-size: 12px;
}

.km-thinker-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 12px;
    margin-bottom: 10px;
    color: #667085;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}

.km-thinker-link:hover {
    color: #9e5015;
}

.km-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f2f4f7;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.km-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.km-profile-btn {
    display: block;
    margin-top: 28px;
    width: 100%;
    text-align: center;
    background: #9e5015;
    color: #fff;
    text-decoration: none;
    border-radius: 12px;
    padding: 13px 18px;
    font-weight: 900;
    box-shadow: 0 14px 30px rgba(158, 80, 21, .18);
}

.km-muted {
    color: #98a2b3;
    font-size: 13px;
}

.km-no-selection {
    height: 100%;
    min-height: 420px;
    display: grid;
    place-content: center;
    text-align: center;
    color: #98a2b3;
}

.km-no-selection i {
    font-size: 54px;
    color: #9e5015;
    opacity: .35;
}

.km-learning-paths {
    padding: 48px 0;
    border-top: 1px solid rgba(158, 80, 21, 0.1);
}

.km-learning-paths h3 {
    font-family: "Playfair Display", serif;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
}

.km-learning-paths p {
    color: #667085;
}

.km-path-card {
    height: 100%;
    background: #fff;
    border: 1px solid rgba(158, 80, 21, 0.1);
    border-radius: 18px;
    padding: 24px;
    transition: .2s ease;
    cursor: pointer;
}

.km-path-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(44, 44, 44, .08);
}

.km-path-icon {
    width: 44px;
    height: 44px;
    background: rgba(158, 80, 21, .08);
    color: #9e5015;
    border-radius: 12px;
    display: grid;
    place-content: center;
    font-size: 22px;
    margin-bottom: 16px;
}

.km-path-card h4 {
    font-weight: 900;
    font-size: 17px;
    margin-bottom: 8px;
}

.km-path-card p {
    font-size: 13px;
    line-height: 1.7;
}

.km-path-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #9e5015;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    margin-top: 18px;
}

.km-context-section {
    background: #111827;
    color: #fff;
    text-align: center;
    padding: 70px 20px;
}

.km-context-section i {
    font-size: 54px;
    color: #9e5015;
}

.km-context-section h2 {
    font-family: "Playfair Display", serif;
    font-size: clamp(28px, 3vw, 42px);
    font-style: italic;
    margin: 20px 0;
}

.km-context-section p {
    max-width: 820px;
    margin: 0 auto;
    color: #cbd5e1;
    line-height: 1.8;
    font-size: 16px;
}

@media (max-width: 1199px) {
    .km-workspace {
        grid-template-columns: 260px minmax(0, 1fr);
        height: auto;
        min-height: 760px;
    }

    .km-detail-panel {
        grid-column: 1 / -1;
        border-left: 0;
        border-top: 1px solid rgba(158, 80, 21, 0.1);
    }
}

@media (max-width: 767px) {
    .km-workspace {
        display: block;
        height: auto;
    }

    .km-filter-panel,
    .km-detail-panel {
        border: 0;
    }

    .km-canvas-area {
        height: 620px;
    }

    .km-hero {
        padding: 28px 0;
    }
}
