.sn-profiles {
    width: 100%;
    min-height: 100%;
}

.sn-profiles-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.sn-profiles-kicker,
.sn-profiles-count span,
.sn-profile-inspector-label,
.sn-profile-record-id,
.sn-profile-map-label,
.sn-profile-map-status {
    color: var(--sn-accent-dim);
    font-size: 11px;
    letter-spacing: 0.16em;
}

.sn-profiles-header h1 {
    margin: 5px 0 6px;
    color: var(--sn-accent-bright);
    font-size: clamp(26px, 3vw, 40px);
    letter-spacing: 0.08em;
}

.sn-profiles-header p {
    margin: 0;
    max-width: 680px;
    opacity: 0.72;
}

.sn-profiles-count {
    min-width: 90px;
    padding: 12px 16px;
    border: 1px solid var(--sn-accent-dim);
    text-align: right;
}

.sn-profiles-count span,
.sn-profiles-count strong {
    display: block;
}

.sn-profiles-count strong {
    margin-top: 3px;
    color: var(--sn-accent-bright);
    font-size: 24px;
}

.sn-profile-filters,
.sn-profile-view-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sn-profile-filters {
    margin-bottom: 14px;
}

.sn-profile-filters button,
.sn-profile-view-switch button {
    border: 1px solid var(--sn-accent-dim);
    background: transparent;
    color: var(--sn-accent);
    padding: 9px 13px;
    font: inherit;
    font-size: 11px;
    letter-spacing: 0.1em;
    cursor: pointer;
}

.sn-profile-filters button:hover,
.sn-profile-view-switch button:hover,
.sn-profile-filters button.active,
.sn-profile-view-switch button.active {
    border-color: var(--sn-accent-bright);
    background: var(--sn-accent-soft);
    color: var(--sn-accent-bright);
    box-shadow: 0 0 16px var(--sn-glow);
}

.sn-profile-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.sn-profile-search {
    flex: 1;
    max-width: 520px;
}

.sn-profile-search span {
    display: block;
    margin-bottom: 6px;
    color: var(--sn-accent-dim);
    font-size: 10px;
    letter-spacing: 0.15em;
}

.sn-profile-search input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--sn-accent-dim);
    background: rgba(0, 0, 0, 0.32);
    color: var(--sn-accent-bright);
    padding: 11px 12px;
    font: inherit;
    outline: none;
}

.sn-profile-search input:focus {
    border-color: var(--sn-accent-bright);
    box-shadow: 0 0 14px var(--sn-glow);
}

.sn-profile-view {
    margin-bottom: 14px;
}

.sn-profile-map {
    position: relative;
    min-height: 390px;
    overflow: hidden;
    border: 1px solid var(--sn-accent-dim);
    background: rgba(0, 0, 0, 0.24);
}

.sn-profile-map-grid {
    position: absolute;
    inset: 0;
    opacity: 0.2;
    background-image:
        linear-gradient(var(--sn-accent-dim) 1px, transparent 1px),
        linear-gradient(90deg, var(--sn-accent-dim) 1px, transparent 1px);
    background-size: 38px 38px;
    pointer-events: none;
}

.sn-profile-map-label {
    position: absolute;
    top: 12px;
    left: 14px;
}

.sn-profile-map-status {
    position: absolute;
    right: 14px;
    bottom: 12px;
}

.sn-profile-map-stage {
    position: relative;
    z-index: 1;
    min-height: 390px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 28px;
    padding: 55px 40px;
    box-sizing: border-box;
}

.sn-profile-node {
    width: 160px;
    border: 0;
    background: transparent;
    color: var(--sn-accent);
    font: inherit;
    cursor: pointer;
}

.sn-profile-node-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 112px;
    height: 112px;
    margin: 0 auto 12px;
    overflow: hidden;
    border: 1px solid var(--sn-accent-dim);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: var(--sn-accent-bright);
    font-size: 28px;
    box-shadow: 0 0 0 transparent;
}

.sn-profile-node-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sn-profile-node strong {
    display: block;
    font-size: 12px;
    letter-spacing: 0.06em;
}

.sn-profile-node:hover .sn-profile-node-photo,
.sn-profile-node.active .sn-profile-node-photo {
    border-color: var(--sn-accent-bright);
    box-shadow: 0 0 24px var(--sn-glow);
}

.sn-profile-node.active strong {
    color: var(--sn-accent-bright);
}

.sn-profile-directory {
    border: 1px solid var(--sn-accent-dim);
}

.sn-profile-directory-row {
    width: 100%;
    display: grid;
    grid-template-columns: 48px minmax(180px, 1fr) minmax(160px, 0.8fr);
    align-items: center;
    gap: 14px;
    border: 0;
    border-bottom: 1px solid var(--sn-accent-dim);
    background: rgba(0, 0, 0, 0.18);
    color: var(--sn-accent);
    padding: 10px 14px;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.sn-profile-directory-row:last-child {
    border-bottom: 0;
}

.sn-profile-directory-row:hover {
    background: var(--sn-accent-soft);
    color: var(--sn-accent-bright);
}

.sn-profile-directory-photo {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--sn-accent-dim);
    border-radius: 50%;
}

.sn-profile-directory-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sn-profile-directory-row > span:last-child {
    text-align: right;
    font-size: 10px;
    letter-spacing: 0.08em;
    opacity: 0.72;
}

.sn-profile-inspector {
    border: 1px solid var(--sn-accent-dim);
    background: rgba(0, 0, 0, 0.2);
}

.sn-profile-inspector-label {
    padding: 10px 14px;
    border-bottom: 1px solid var(--sn-accent-dim);
}

.sn-profile-inspector-card {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 24px;
    padding: 20px;
}

.sn-profile-inspector-photo {
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--sn-accent-dim);
    background: rgba(0, 0, 0, 0.4);
    color: var(--sn-accent-dim);
    font-size: 11px;
    letter-spacing: 0.12em;
}

.sn-profile-inspector-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sn-profile-inspector-copy h2 {
    margin: 4px 0;
    color: var(--sn-accent-bright);
    font-size: 26px;
    letter-spacing: 0.05em;
}

.sn-profile-nickname {
    margin: 0 0 18px;
    color: var(--sn-accent);
    font-size: 11px;
    letter-spacing: 0.1em;
}

.sn-profile-inspector-copy dl {
    margin: 18px 0;
}

.sn-profile-inspector-copy dl div {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--sn-accent-03);
}

.sn-profile-inspector-copy dt {
    color: var(--sn-accent-dim);
    font-size: 10px;
    letter-spacing: 0.1em;
}

.sn-profile-inspector-copy dd {
    margin: 0;
}

.sn-profile-notes {
    max-width: 900px;
    line-height: 1.65;
    opacity: 0.82;
}

.sn-profiles-empty {
    padding: 50px 20px;
    border: 1px solid var(--sn-accent-dim);
    text-align: center;
}

.sn-profiles-empty strong,
.sn-profiles-empty span {
    display: block;
}

.sn-profiles-empty strong {
    color: var(--sn-accent-bright);
}

.sn-profiles-empty span {
    margin-top: 8px;
    opacity: 0.65;
}

.sn-profile-filtered-out {
    display: none !important;
}

@media (max-width: 900px) {
    .sn-profile-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .sn-profile-search {
        max-width: none;
    }

    .sn-profile-inspector-card {
        grid-template-columns: 1fr;
    }

    .sn-profile-inspector-photo {
        width: min(200px, 100%);
    }
}

@media (max-width: 640px) {
    .sn-profiles-header {
        flex-direction: column;
    }

    .sn-profile-directory-row {
        grid-template-columns: 42px 1fr;
    }

    .sn-profile-directory-row > span:last-child {
        grid-column: 2;
        text-align: left;
    }
}


/* =========================================================
   CONNECTION MAP // V2
   ========================================================= */

.sn-profile-map {
    min-height: 620px;
}

.sn-profile-map-stage {
    position: relative;
    z-index: 2;
    min-height: 620px;
    display: block;
    padding: 0;
}

.sn-profile-map-lines {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.sn-profile-map-line {
    fill: none;
    stroke: var(--sn-accent-dim);
    stroke-width: 1.5;
    opacity: 0.78;
    vector-effect: non-scaling-stroke;
}

.sn-profile-map-line[data-relationship-type="partner"] {
    stroke: var(--sn-accent-bright);
    stroke-width: 2;
}

.sn-profile-map-line[data-relationship-status="former"] {
    stroke-dasharray: 7 6;
    opacity: 0.55;
}

.sn-profile-map-controls {
    position: absolute;
    top: 11px;
    right: 14px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sn-profile-map-controls > span {
    margin-right: 3px;
    color: var(--sn-accent-dim);
    font-size: 9px;
    letter-spacing: 0.14em;
}

.sn-profile-map-controls button {
    min-width: 30px;
    height: 28px;
    border: 1px solid var(--sn-accent-dim);
    background: rgba(0, 0, 0, 0.52);
    color: var(--sn-accent);
    font: inherit;
    font-size: 10px;
    cursor: pointer;
}

.sn-profile-map-controls button:hover,
.sn-profile-map-controls button.active {
    border-color: var(--sn-accent-bright);
    background: var(--sn-accent-soft);
    color: var(--sn-accent-bright);
    box-shadow: 0 0 14px var(--sn-glow);
}

.sn-profile-map .sn-profile-node {
    position: absolute;
    z-index: 3;
    width: 132px;
    transform: translate(-50%, -50%);
    transition:
        left 220ms ease,
        top 220ms ease,
        opacity 180ms ease;
}

.sn-profile-map .sn-profile-node-photo {
    width: 86px;
    height: 86px;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.78);
    font-size: 23px;
}

.sn-profile-map .sn-profile-node strong {
    max-width: 132px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sn-profile-map .sn-profile-node.sn-profile-node-center {
    z-index: 4;
}

.sn-profile-map .sn-profile-node.sn-profile-node-center .sn-profile-node-photo {
    width: 116px;
    height: 116px;
    border-color: var(--sn-accent-bright);
    box-shadow: 0 0 30px var(--sn-glow);
}

.sn-profile-map .sn-profile-node.sn-profile-node-center strong {
    color: var(--sn-accent-bright);
}

.sn-profile-map .sn-profile-node-relation {
    display: block;
    margin-top: 4px;
    color: var(--sn-accent-dim);
    font-size: 8px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sn-profile-map .sn-profile-node[data-relationship-status="former"] .sn-profile-node-relation {
    opacity: 0.65;
}

.sn-profile-map-status {
    z-index: 5;
    max-width: 48%;
    text-align: right;
}

@media (max-width: 900px) {
    .sn-profile-map,
    .sn-profile-map-stage {
        min-height: 720px;
    }

    .sn-profile-map .sn-profile-node {
        width: 110px;
    }

    .sn-profile-map .sn-profile-node-photo {
        width: 72px;
        height: 72px;
    }

    .sn-profile-map .sn-profile-node.sn-profile-node-center .sn-profile-node-photo {
        width: 96px;
        height: 96px;
    }
}


/* =========================================================
   PROFILE CONTROL // V7
   ========================================================= */

.sn-profiles-header-actions {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.sn-profile-action-button {
    border: 1px solid var(--sn-accent-dim);
    background: rgba(0, 0, 0, 0.35);
    color: var(--sn-accent);
    padding: 10px 14px;
    font: inherit;
    font-size: 10px;
    letter-spacing: 0.12em;
    cursor: pointer;
}

.sn-profile-action-button:hover,
.sn-profile-action-button.is-primary {
    border-color: var(--sn-accent-bright);
    background: var(--sn-accent-soft);
    color: var(--sn-accent-bright);
    box-shadow: 0 0 16px var(--sn-glow);
}

.sn-profile-edit-button {
    float: right;
    margin: -4px 0 10px 16px;
}

.sn-profile-editor[hidden] {
    display: none !important;
}

.sn-profile-editor {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    box-sizing: border-box;
}

.sn-profile-editor-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.84);
    backdrop-filter: blur(4px);
}

.sn-profile-editor-panel {
    position: relative;
    z-index: 1;
    width: min(1180px, 96vw);
    max-height: 90vh;
    overflow: auto;
    border: 1px solid var(--sn-accent-bright);
    background: #020504;
    box-shadow: 0 0 42px var(--sn-glow);
}

.sn-profile-editor-head {
    position: sticky;
    top: 0;
    z-index: 4;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--sn-accent-dim);
    background: #020504;
}

.sn-profile-editor-head span,
.sn-profile-editor-status,
.sn-profile-editor fieldset legend,
.sn-profile-editor label,
.sn-profile-editor-relation-add > span {
    color: var(--sn-accent-dim);
    font-size: 9px;
    letter-spacing: 0.14em;
}

.sn-profile-editor-head h2 {
    margin: 5px 0 0;
    color: var(--sn-accent-bright);
    font-size: 22px;
    letter-spacing: 0.1em;
}

.sn-profile-editor-close {
    border: 0;
    background: transparent;
    color: var(--sn-accent-bright);
    font: inherit;
    font-size: 28px;
    cursor: pointer;
}

.sn-profile-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 20px;
}

.sn-profile-editor fieldset {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 16px;
    border: 1px solid var(--sn-accent-dim);
}

.sn-profile-editor fieldset legend {
    padding: 0 8px;
    color: var(--sn-accent);
}

.sn-profile-editor label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sn-profile-editor input,
.sn-profile-editor select,
.sn-profile-editor textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--sn-accent-dim);
    background: rgba(0, 0, 0, 0.45);
    color: var(--sn-accent-bright);
    padding: 9px 10px;
    font: inherit;
    font-size: 11px;
    outline: none;
}

.sn-profile-editor input:focus,
.sn-profile-editor select:focus,
.sn-profile-editor textarea:focus {
    border-color: var(--sn-accent-bright);
    box-shadow: 0 0 12px var(--sn-glow);
}

.sn-profile-editor-wide,
.sn-profile-editor-checks,
.sn-profile-editor-relations,
.sn-profile-editor-relation-add {
    grid-column: 1 / -1;
}

.sn-profile-editor-checks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.sn-profile-editor-checks label,
.sn-profile-editor-relation {
    flex-direction: row;
    align-items: center;
}

.sn-profile-editor-checks input,
.sn-profile-editor-relation input {
    width: auto;
}

.sn-profile-editor-relations {
    display: grid;
    gap: 6px;
    margin-top: 6px;
}

.sn-profile-editor-relation {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid var(--sn-accent-03);
    color: var(--sn-accent);
}

.sn-profile-editor-no-relations {
    opacity: 0.5;
    font-size: 9px;
    letter-spacing: 0.1em;
}

.sn-profile-editor-relation-add {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--sn-accent-03);
}

.sn-profile-editor-relation-add > span {
    grid-column: 1 / -1;
}

.sn-profile-editor-status {
    margin: 0 20px;
    padding: 10px 0;
    border-top: 1px solid var(--sn-accent-03);
}

.sn-profile-editor-status.is-error {
    color: #ff6767;
}

.sn-profile-editor-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--sn-accent-dim);
    background: #020504;
}

body.sn-profile-editor-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .sn-profile-editor-grid,
    .sn-profile-editor fieldset {
        grid-template-columns: 1fr;
    }

    .sn-profile-editor-wide,
    .sn-profile-editor-checks,
    .sn-profile-editor-relations,
    .sn-profile-editor-relation-add {
        grid-column: auto;
    }

    .sn-profile-editor-relation-add {
        grid-template-columns: 1fr;
    }

    .sn-profile-editor-relation-add > span {
        grid-column: auto;
    }
}


/* =========================================================
   PROFILES V8 // SAVE LOCK + DELETE SAFETY
   ========================================================= */

.sn-profile-editor-action-spacer {
    flex: 1;
}

.sn-profile-action-button.is-danger {
    border-color: rgba(255, 103, 103, 0.58);
    color: #ff8b8b;
}

.sn-profile-action-button.is-danger:hover {
    border-color: #ff6767;
    color: #ffd0d0;
    box-shadow: 0 0 16px rgba(255, 103, 103, 0.24);
}

.sn-profile-action-button:disabled,
.sn-profile-editor-close:disabled {
    opacity: 0.34;
    cursor: wait;
    pointer-events: none;
}

.sn-profile-processing {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(4px);
}

.sn-profile-processing-box {
    width: min(460px, 86%);
    padding: 24px;
    border: 1px solid var(--sn-accent-bright);
    background: #020504;
    box-shadow: 0 0 34px var(--sn-glow);
    text-align: center;
}

.sn-profile-processing-kicker,
.sn-profile-processing-box > span:last-child {
    display: block;
    color: var(--sn-accent-dim);
    font-size: 9px;
    letter-spacing: 0.14em;
}

.sn-profile-processing-box strong {
    display: block;
    margin: 10px 0 18px;
    color: var(--sn-accent-bright);
    font-size: 18px;
    letter-spacing: 0.12em;
}

.sn-profile-processing-bar {
    position: relative;
    height: 8px;
    margin: 0 0 16px;
    overflow: hidden;
    border: 1px solid var(--sn-accent-dim);
    background: rgba(0, 0, 0, 0.6);
}

.sn-profile-processing-bar i {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 34%;
    background: var(--sn-accent-bright);
    box-shadow: 0 0 14px var(--sn-glow);
    animation: sn-profile-processing 1s linear infinite;
}

@keyframes sn-profile-processing {
    from { left: -34%; }
    to   { left: 100%; }
}


/* V8.1 // PROCESSING OVERLAY VISIBILITY FIX
   The overlay exists in the DOM at all times, but must remain
   completely hidden until JavaScript begins an actual save/delete. */
.sn-profile-processing[hidden] {
    display: none !important;
}

/* SHADOWNET // PAGE HEADING ALIGNMENT // 2026-10-10
   Match the existing Command Center heading. Scoped to main page headers only. */
.sn-profiles-header h1 {
  margin-top: 0;
  font-family: inherit;
  font-size: 38px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .08em;
}
@media (max-width: 700px) {
  .sn-profiles-header h1 { font-size: 30px; }
}
