/* NPC expanded world-ties layout */
.npc-life-overview {
    overflow: auto;
}

.npc-life-primary {
    min-width: 0;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    align-items: start;
    gap: 14px;
}

.npc-life-importance-rail,
.npc-life-main-column {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.npc-life-featured {
    border-color: rgba(240, 200, 76, 0.42);
    background: linear-gradient(155deg, rgba(40, 31, 10, 0.72), rgba(3, 15, 23, 0.94));
}

.npc-life-featured > h3,
.npc-life-featured-copy em {
    color: #f0c84c;
}

.npc-life-featured-card:hover {
    background: rgba(47, 37, 13, 0.72);
    box-shadow: 0 0 0 1px rgba(240, 200, 76, 0.3) inset;
}

.npc-life-featured-image {
    border-color: #f0c84c;
    color: #f0c84c;
}

.npc-life-responsibilities {
    border-color: rgba(240, 200, 76, 0.42);
    background: linear-gradient(155deg, rgba(35, 27, 9, 0.72), rgba(2, 14, 22, 0.9));
}

.npc-life-responsibility-stack {
    display: grid;
    gap: 8px;
}

.npc-life-responsibility-card {
    min-width: 0;
    min-height: 145px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(240, 200, 76, 0.28);
    border-radius: 7px;
    background: rgba(14, 25, 28, 0.84);
    color: #fff;
    text-align: center;
    cursor: grab;
}

.npc-life-responsibility-card:hover {
    border-color: #f0c84c;
    background: rgba(39, 34, 17, 0.92);
}

.npc-life-responsibility-card .npc-life-card-image {
    width: 62px;
    height: 62px;
    border-color: rgba(240, 200, 76, 0.62);
    color: #f0c84c;
}

.npc-life-responsibility-card .npc-life-card-copy {
    align-items: center;
    width: 100%;
}

.npc-life-responsibility-card .npc-life-card-copy em {
    color: #f0c84c;
}

.npc-life-responsibility-overflow {
    display: block;
    margin-top: 8px;
    color: #a79358;
    font-size: 8px;
    text-align: center;
}

.npc-life-world-ties {
    min-height: 0;
}

.npc-life-world-ties-drop-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 12px 0 0;
    color: var(--nexus-text-muted, #79949e);
    font-size: 9px;
    line-height: 1.25;
    text-align: center;
    pointer-events: none;
}

.npc-life-world-ties-drop-hint i {
    color: var(--nexus-accent-primary, #55bdec);
}

.npc-life-world-group + .npc-life-world-group {
    margin-top: 11px;
    padding-top: 10px;
    border-top: 1px solid rgba(85, 189, 236, 0.15);
}

.npc-life-world-group > h4 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 7px;
    color: #8dcfe6;
    font-size: 9px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.npc-life-world-group > h4 span {
    margin-left: auto;
    color: #668995;
}

@media (max-width: 1120px) {
    .npc-life-primary { grid-template-columns: 210px minmax(0, 1fr); }
    .npc-life-world-group .npc-life-card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    .npc-life-primary { grid-template-columns: minmax(0, 1fr); }
}


/* NPC importance cards and interactive world ties */
.npc-life-importance-rail {
    gap: 10px;
}

.npc-life-importance-card {
    min-height: 198px;
}

.npc-life-importance-card > h3 {
    color: #f0c84c;
}

.npc-life-importance-card .npc-life-responsibility-card {
    min-height: 0;
    padding: 10px;
    border: 0;
    background: rgba(2, 13, 21, 0.52);
}

.npc-life-importance-card .npc-life-featured-image {
    width: 96px;
    height: 96px;
    border-color: rgba(240, 200, 76, 0.72);
}

.npc-life-importance-card .npc-life-featured-copy {
    align-items: center;
}

.npc-life-importance-card .npc-life-featured-copy strong {
    font-size: 15px;
}

.npc-life-featured > h3 {
    min-height: 14px;
}

.npc-life-featured-copy:not(:has(em)) {
    align-items: center;
}

/* Tall ship art needs a bounded stage so it cannot run into the identity copy. */
.npc-life-featured-card .npc-life-featured-image.is-ship {
    width: min(210px, 100%);
    height: 120px;
    flex: 0 0 120px;
    overflow: hidden !important;
    margin-bottom: 7px;
}

.npc-life-featured-card .npc-life-featured-image.is-ship img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 112px;
    height: 200px;
    object-fit: contain;
    transform: translate(-50%, -50%) rotate(-90deg);
    transform-origin: center;
}

.npc-life-world-ties.is-connection-drop-target {
    border-color: #70d9ff;
    background: linear-gradient(145deg, rgba(9, 43, 58, 0.94), rgba(2, 14, 22, 0.9));
    box-shadow: 0 0 0 1px rgba(112, 217, 255, 0.25) inset, 0 0 20px rgba(85, 189, 236, 0.14);
}

.npc-life-card.is-world-tie {
    min-height: 58px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto;
    gap: 0;
    padding: 0;
    overflow: hidden;
}

.npc-life-card.is-world-tie .npc-life-card-open {
    min-width: 0;
    min-height: 58px;
    display: grid;
    grid-template-columns: 41px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 7px;
    border: 0;
    background: transparent;
    color: #fff;
    text-align: left;
    cursor: grab;
}

.npc-life-card.is-world-tie .npc-life-card-open:hover {
    background: color-mix(in srgb, var(--connection-category-color, #55bdec) 9%, transparent);
}

.npc-life-card.is-world-tie .npc-life-card-open:active {
    cursor: grabbing;
}

.npc-life-card.is-world-tie .npc-life-card-open.has-allegiance {
    grid-template-columns: 41px 94px minmax(0, 1fr);
}

.npc-life-card-allegiance {
    min-width: 0;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    padding-left: 8px;
    border-left: 1px solid color-mix(in srgb, var(--nexus-accent-primary, #55bdec) 24%, transparent);
}

.npc-life-card-allegiance-image {
    width: 30px;
    height: 34px;
    display: grid;
    place-items: center;
    overflow: visible;
    color: var(--nexus-accent-primary, #55bdec);
}

.npc-life-card-allegiance-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.npc-life-card-allegiance-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.npc-life-card-allegiance-copy strong,
.npc-life-card-allegiance-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.npc-life-card-allegiance-copy strong {
    color: var(--nexus-accent-primary, #55bdec);
    font-size: 9px;
}

.npc-life-card-allegiance-copy small {
    color: var(--nexus-text-muted, #79949e);
    font-size: 8px;
}

.npc-life-card.is-world-tie .npc-life-card-copy em {
    color: var(--connection-category-color, #70d9ff);
}

.npc-life-card.is-world-tie .npc-life-card-copy em i {
    margin-right: 3px;
}

.npc-life-card.is-world-tie .npc-life-opinion-pill {
    align-self: center;
    justify-self: end;
    grid-column: 2;
    grid-row: 1;
    max-width: none;
    margin: 0 7px 0 4px;
}

.npc-life-card.is-world-tie .npc-life-opinion-pill.is-score-only {
    width: 48px;
    min-width: 48px;
    justify-content: center;
    padding-inline: 4px;
}

@media (max-width: 1120px) {
    .npc-life-importance-card { min-height: 184px; }
    .npc-life-importance-card .npc-life-featured-image { width: 82px; height: 82px; }
    .npc-life-card.is-world-tie { grid-template-columns: minmax(0, 1fr); }
    .npc-life-card.is-world-tie .npc-life-opinion-pill {
        grid-column: 1;
        grid-row: 2;
        justify-self: start;
        margin: 0 7px 7px 56px;
    }
}

.npc-life-world-ties-empty {
    min-height: 92px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 14px;
    border: 1px dashed rgba(85, 189, 236, 0.28);
    border-radius: 7px;
    color: #79949e;
    text-align: center;
}

.npc-life-world-ties-empty > i { color: #70d9ff; font-size: 22px; }
.npc-life-world-ties-empty strong { color: #bad4de; font-size: 11px; }
.npc-life-world-ties-empty small { max-width: 330px; font-size: 9px; line-height: 1.35; }

/* NPC compact importance row and frameless responsibility art */
.npc-life-importance-card .npc-life-featured-image,
.npc-life-importance-card .npc-life-featured-image.is-square {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.npc-life-importance-card .npc-life-featured-image img {
    object-fit: contain;
}

.npc-profile-section-heading.is-importance {
    color: #f0c84c;
}

.npc-profile-importance-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 7px;
    margin: 0 0 12px;
}

.npc-profile-importance-card {
    min-width: 0;
    width: calc((100% - 14px) / 3);
    min-height: 66px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    padding: 6px;
    border: 1px solid rgba(240, 200, 76, 0.34);
    border-radius: 7px;
    background: linear-gradient(145deg, rgba(38, 29, 9, 0.72), rgba(3, 15, 23, 0.9));
    color: #fff;
    text-align: left;
    cursor: grab;
}

.npc-profile-importance-card:hover {
    border-color: #f0c84c;
    background: linear-gradient(145deg, rgba(55, 42, 12, 0.84), rgba(5, 22, 31, 0.94));
}

.npc-profile-importance-card:active {
    cursor: grabbing;
}

.npc-profile-importance-image {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    overflow: visible;
    color: #f0c84c;
}

.npc-profile-importance-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.npc-profile-importance-image > i {
    font-size: 22px;
}

.npc-profile-importance-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.npc-profile-importance-copy em,
.npc-profile-importance-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.npc-profile-importance-copy em {
    color: #f0c84c;
    font-size: 7px;
    font-style: normal;
    font-weight: 900;
    text-transform: uppercase;
}

.npc-profile-importance-copy strong {
    color: #fff;
    font-size: 10px;
}

@media (max-width: 390px) {
    .npc-profile-importance-card { width: calc((100% - 7px) / 2); }
}


/* NPC importance sizing and compact spacing polish */
.npc-life-importance-card .npc-life-featured-image.is-unframed,
.npc-life-importance-card .npc-life-responsibility-card .npc-life-featured-image {
    overflow: visible;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.npc-dossier-shell.is-compact .npc-life-dossier > .npc-dossier-section {
    padding-top: 0;
}

.npc-dossier-shell.is-compact .npc-dossier-section > .npc-profile-section-heading:first-child {
    margin-top: 2px;
}

.npc-profile-importance-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.npc-profile-importance-card {
    width: auto;
    grid-column: span 2;
}

.npc-profile-importance-card:only-child {
    grid-column: span 6;
}

.npc-profile-importance-card:first-child:nth-last-child(2),
.npc-profile-importance-card:first-child:nth-last-child(2) ~ .npc-profile-importance-card {
    grid-column: span 3;
}

.npc-profile-importance-row:has(> .npc-profile-importance-card:nth-child(4)) > .npc-profile-importance-card:first-child {
    grid-column: 1 / -1;
}

@media (max-width: 390px) {
    .npc-profile-importance-card { width: auto; }
}
