.augur-nexus.npc-dossier .window-content {
    padding: 0;
    overflow: hidden;
    background: #020711;
    color: #f8e7c7;
}

.npc-dossier-shell {
    height: 100%;
    min-height: 0;
    position: relative;
    overflow: hidden;
    background-color: #020711;
    background-size: cover;
    background-position: center;
}

.npc-dossier-stage {
    grid-template-columns: 330px minmax(0, 1fr);
}

.npc-dossier-profile,
.npc-dossier-connections {
    min-height: 0;
    border: 1px solid rgba(85, 189, 236, 0.5);
    border-radius: 8px;
    background: rgba(0, 8, 15, 0.8);
}

.npc-dossier-profile {
    display: flex;
    flex-direction: column;
    padding: 14px;
    overflow: hidden;
}

.npc-dossier-connections {
    position: relative;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    overflow: hidden;
}

.faction-domain-stage {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 370px;
    gap: 18px;
    padding: 18px;
    box-sizing: border-box;
}

.faction-domain-overview {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
}

.faction-domain-command {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
    align-items: stretch;
    gap: 8px;
}

.faction-domain-command-slot {
    min-width: 0;
}

.faction-domain-command-slot > .faction-domain-command-card {
    width: 100%;
    height: 100%;
}

.faction-domain-command-card {
    min-width: 0;
    min-height: 116px;
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    margin: 0;
    padding: 14px;
    border: 1px solid rgba(85, 189, 236, 0.48);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(8, 32, 44, 0.94), rgba(3, 16, 25, 0.94));
    color: #f6fbff;
    text-align: left;
}

button.faction-domain-command-card:hover {
    border-color: #f0c84c;
    background: linear-gradient(135deg, rgba(15, 51, 66, 0.96), rgba(5, 23, 34, 0.96));
    box-shadow: 0 0 18px rgba(240, 200, 76, 0.12);
}

.faction-domain-command-card.is-seat {
    border-color: rgba(217, 171, 72, 0.58);
    background: linear-gradient(135deg, rgba(50, 36, 12, 0.92), rgba(18, 18, 16, 0.95));
}

.faction-domain-command-card.is-empty {
    grid-template-columns: 46px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 88px;
    border-style: dashed;
    color: #758a93;
    background: rgba(3, 12, 18, 0.72);
}

.faction-domain-command-card.is-empty > i { font-size: 25px; text-align: center; }
.faction-domain-command-card.is-empty span { display: flex; flex-direction: column; gap: 4px; }

.faction-domain-command-image {
    position: relative;
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    overflow: visible;
    border: 2px solid #55bdec;
    border-radius: 50%;
    background: #06131d;
    color: #bdefff;
}

.faction-domain-command-image.is-square { border-color: #d9ab48; border-radius: 8px; }
.faction-domain-command-card.is-empty small { margin-top: 2px; color: #8aa5af; font-size: 9px; }
.faction-domain-command-image > img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.faction-domain-command-image > i { font-size: 28px; }
.faction-domain-command-image > b {
    position: absolute;
    right: -6px;
    bottom: -5px;
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    border: 1px solid #f0c84c;
    border-radius: 50%;
    color: #f0c84c;
    background: #071019;
    font-size: 11px;
}

.faction-domain-command-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.faction-domain-command-copy em,
.faction-domain-command-card.is-empty em {
    color: #70d9ff;
    font-size: 9px;
    font-style: normal;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}
.faction-domain-command-card.is-seat .faction-domain-command-copy em { color: #f0c84c; }
.faction-domain-command-copy strong,
.faction-domain-command-card.is-empty strong {
    overflow: hidden;
    color: #ffffff;
    font-size: 18px;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.faction-domain-command-copy small,
.faction-domain-command-copy > span { color: #a8c7d2; font-size: 10px; }
.faction-domain-opinion { color: var(--opinion-color, #a8c7d2) !important; font-weight: 800; }
.faction-domain-command-link { display: grid; place-items: center; align-self: center; color: rgba(240, 200, 76, 0.72); }
.faction-domain-command-link::before,
.faction-domain-command-link::after { content: ""; width: 100%; height: 1px; background: rgba(240, 200, 76, 0.34); }

.faction-domain-columns {
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    flex: 1 1 auto;
}

.faction-domain-collection {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: 12px;
    border: 1px solid rgba(85, 189, 236, 0.28);
    border-radius: 8px;
    background: rgba(2, 14, 22, 0.78);
}

.faction-domain-collection h3 {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 10px;
    color: #70d9ff;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.faction-domain-collection h3 span { margin-left: auto; color: #f0c84c; }

.faction-domain-card-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 8px;
    overflow: auto;
    scrollbar-width: thin;
}

.faction-domain-small-card {
    min-width: 0;
    min-height: 66px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    column-gap: 9px;
    margin: 0;
    padding: 8px;
    border: 1px solid rgba(85, 189, 236, 0.34);
    border-radius: 7px;
    background: rgba(7, 29, 40, 0.88);
    color: #f6fbff;
    text-align: left;
}
.faction-domain-small-card:hover { border-color: #70d9ff; background: rgba(10, 44, 59, 0.94); }
.faction-domain-small-card > span {
    grid-row: 1 / 4;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(85, 189, 236, 0.56);
    border-radius: 50%;
    color: #bdefff;
    background: #06131d;
}
.faction-domain-small-card.is-holding > span { border-color: rgba(217, 171, 72, 0.6); border-radius: 7px; color: #f0c84c; }
.faction-domain-small-card img { width: 100%; height: 100%; object-fit: cover; }
.faction-domain-small-card strong,
.faction-domain-small-card em,
.faction-domain-small-card small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.faction-domain-small-card strong { color: #fff; font-size: 11px; }
.faction-domain-small-card em { color: #9fc4d1; font-size: 9px; font-style: normal; }
.faction-domain-small-card small { color: var(--opinion-color, #d0b56d); font-size: 9px; }
.faction-domain-small-card small.is-vacant { color: #8b7b76; }
.faction-domain-empty { grid-column: 1 / -1; padding: 18px; color: #78909a; font-size: 10px; text-align: center; }

.faction-domain-dossier { overflow: hidden; }

.faction-dossier-header-actions {
    flex-direction: column;
}

.faction-dossier-shell.is-compact .faction-domain-stage {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 10px;
    overflow: hidden;
}

.faction-dossier-shell.is-compact .faction-domain-dossier {
    width: 100%;
    min-height: 0;
}

.faction-dossier-shell.is-compact .faction-domain-dossier > .npc-dossier-section {
    padding-right: 3px;
}

.faction-profile-command-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 10px;
}

.faction-profile-command-card {
    min-width: 0;
    min-height: 66px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 7px;
    border: 1px solid rgba(240, 200, 76, 0.48);
    border-radius: 7px;
    background: rgba(24, 20, 10, 0.78);
    color: #ffffff;
    text-align: left;
}

.faction-profile-command-card:hover {
    border-color: #f0c84c;
    background: rgba(42, 32, 11, 0.88);
}

.faction-profile-command-card.is-empty {
    grid-template-columns: 28px minmax(0, 1fr);
    border-style: dashed;
    color: #82959c;
    background: rgba(3, 12, 18, 0.62);
}

.faction-profile-command-card.is-empty > i {
    color: #f0c84c;
    font-size: 18px;
    text-align: center;
}

.faction-profile-command-card.is-empty > span,
.faction-profile-command-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.faction-profile-command-image {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid #55bdec;
    border-radius: 50%;
    background: #07131c;
}

.faction-profile-command-image.is-square {
    border-color: #f0c84c;
    border-radius: 5px;
}

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

.faction-profile-command-copy em,
.faction-profile-command-card.is-empty em {
    overflow: hidden;
    color: #f0c84c;
    font-size: 7px;
    font-style: normal;
    font-weight: 900;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.faction-profile-command-copy strong,
.faction-profile-command-card.is-empty strong {
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.faction-profile-command-copy small {
    overflow: hidden;
    color: #a8c7d2;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.faction-domain-dossier .faction-ideology-grid { grid-template-columns: 1fr; }
.faction-domain-dossier > .npc-dossier-section,
.faction-domain-dossier > .entity-dossier-chronicle { min-height: 0; flex: 1 1 auto; overflow: auto; }
.faction-domain-connections { position: relative; min-height: 0; flex: 1 1 auto; overflow: hidden; }
.faction-domain-connections .connections-board { padding-bottom: 42px; }
.faction-domain-ideology {
    min-width: 0;
}

.faction-domain-ideology .faction-ideology-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.faction-domain-ideology .faction-ideology-card {
    padding: 8px 10px;
}

.faction-domain-ideology .faction-ideology-card p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.faction-domain-add {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 112px;
    min-height: 28px;
    margin: 9px 0 0;
    padding: 0 10px;
    border: 1px solid rgba(85, 189, 236, 0.68);
    border-radius: 5px;
    background: rgba(5, 35, 50, 0.88);
    color: #f7fcff;
    font-size: 10px;
    font-weight: 900;
}

.faction-domain-add:hover {
    border-color: #f0c84c;
    background: rgba(13, 53, 68, 0.95);
}

.faction-domain-overview [draggable="true"] { cursor: grab; }
.faction-domain-overview [draggable="true"]:active { cursor: grabbing; }

.faction-domain-overview [data-faction-domain-drop] {
    transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.faction-domain-overview [data-faction-domain-drop].is-domain-drop-target {
    border-color: #f0c84c;
    box-shadow: 0 0 0 1px rgba(240, 200, 76, 0.4) inset, 0 0 18px rgba(240, 200, 76, 0.18);
}

.faction-domain-drop-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 8px 0 0;
    color: #78939f;
    font-size: 9px;
    line-height: 1.25;
    text-align: center;
}

.faction-domain-drop-hint i {
    color: #55bdec;
}

.faction-domain-command-drop-hint {
    grid-column: 1 / -1;
    min-height: 20px;
    margin: 0;
    padding-inline: 8px;
}

.faction-domain-command-empty-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.faction-domain-command-empty-actions .faction-domain-command-drop-hint {
    flex: 1 1 auto;
    padding-inline: 0;
}

.faction-domain-create-leader {
    flex: 0 0 auto;
    min-height: 30px;
    margin: 0;
    padding: 5px 10px;
    border: 1px solid rgba(85, 189, 236, 0.48);
    border-radius: 4px;
    color: #dff6ff;
    background: rgba(8, 32, 44, 0.94);
    font-size: 11px;
    font-weight: 700;
}

.faction-domain-create-leader:hover,
.faction-domain-create-leader:focus-visible {
    border-color: #f0c84c;
    color: #ffffff;
    box-shadow: 0 0 14px rgba(240, 200, 76, 0.12);
}

.faction-domain-member-footer {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    align-items: end;
    gap: 8px;
    margin-top: 8px;
}

.faction-domain-member-footer .faction-domain-drop-hint {
    grid-column: 2;
    margin: 0;
}

.faction-domain-member-footer .faction-domain-add {
    grid-column: 3;
    margin: 0;
}
.connection-card-seat { color: #f0c84c; }
.connection-card-leadership { color: #e8bd6c; }
.location-relationship-pill.is-location-leader { border-color: rgba(85, 189, 236, 0.64); background: rgba(5, 28, 40, 0.94); }
.location-relationship-pill.is-location-leader:hover { border-color: #8be1ff; background: rgba(8, 47, 65, 0.96); }

@media (max-width: 1050px) {
    .faction-domain-stage { grid-template-columns: minmax(0, 1fr) 340px; }
    .faction-domain-ideology .faction-ideology-grid { grid-template-columns: 1fr; }
    .faction-domain-command { grid-template-columns: 1fr; }
    .faction-domain-command-link { display: none; }
    .faction-domain-command-card { min-height: 92px; }
    .faction-domain-columns { grid-template-columns: 1fr; }
}

.npc-life-stage {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 370px;
    gap: 18px;
    padding: 18px;
    box-sizing: border-box;
}

.npc-life-overview {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
}

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

.npc-life-hero {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    border: 1px solid rgba(85, 189, 236, 0.28);
    border-radius: 8px;
    background: linear-gradient(155deg, rgba(9, 34, 46, 0.92), rgba(3, 15, 23, 0.94));
    text-align: center;
}

.npc-life-portrait {
    width: 128px;
    height: 128px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 2px solid var(--npc-life-accent, #55bdec);
    border-radius: 50%;
    background: #06131d;
    color: #bdefff;
    box-shadow: 0 0 24px color-mix(in srgb, var(--npc-life-accent, #55bdec) 25%, transparent);
}
.npc-life-portrait img { width: 100%; height: 100%; object-fit: cover; }
.npc-life-portrait > i { font-size: 42px; }

.npc-life-identity { min-width: 0; width: 100%; }
.npc-life-identity em {
    display: block;
    overflow: hidden;
    color: #70d9ff;
    font-size: 9px;
    font-style: normal;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}
.npc-life-identity h2 {
    margin: 3px 0;
    border: 0;
    color: #fff;
    font-size: 25px;
    font-style: italic;
    line-height: 1.05;
}
.npc-life-identity > strong { color: #f8e7c7; font-size: 12px; }
.npc-life-identity > p {
    display: -webkit-box;
    margin: 7px 0 0;
    overflow: hidden;
    color: #9fc4d1;
    font-size: 10px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.npc-life-featured {
    position: relative;
    min-width: 0;
    min-height: 218px;
    display: flex;
    flex-direction: column;
    padding: 11px;
    border: 1px solid rgba(85, 189, 236, 0.28);
    border-radius: 8px;
    background: linear-gradient(155deg, rgba(9, 34, 46, 0.92), rgba(3, 15, 23, 0.94));
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.npc-life-featured.is-manual { border-color: rgba(240, 200, 76, 0.52); }
.npc-life-featured.is-drop-target {
    border-color: #f0c84c;
    box-shadow: 0 0 0 1px rgba(240, 200, 76, 0.38) inset, 0 0 20px rgba(240, 200, 76, 0.18);
}
.npc-life-featured > h3 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px;
    color: #70d9ff;
    font-size: 10px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}
.npc-life-featured > h3 span { margin-left: auto; color: #f0c84c; font-size: 8px; }
.npc-life-featured-card {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0;
    padding: 9px;
    border: 0;
    border-radius: 7px;
    background: rgba(2, 13, 21, 0.52);
    color: #fff;
    text-align: center;
    cursor: grab;
}
.npc-life-featured-card:hover { background: rgba(9, 37, 49, 0.75); box-shadow: 0 0 0 1px rgba(85, 189, 236, 0.34) inset; }
.npc-life-featured-card:active { cursor: grabbing; }
.npc-life-featured-image {
    width: 104px;
    height: 104px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 2px solid #55bdec;
    border-radius: 50%;
    background: #06131d;
    color: #bdefff;
}
.npc-life-featured-image.is-square { border-color: rgba(217, 171, 72, 0.72); border-radius: 8px; }
.npc-life-featured-image.is-emblem { overflow: visible; border: 0; border-radius: 0; background: transparent; }
.npc-life-featured-image img { width: 100%; height: 100%; object-fit: cover; }
.npc-life-featured-image.is-emblem img { object-fit: contain; }
.npc-life-featured-image > i { font-size: 34px; }
.npc-life-featured-copy { min-width: 0; width: 100%; display: flex; flex-direction: column; gap: 2px; }
.npc-life-featured-copy em,
.npc-life-featured-copy strong,
.npc-life-featured-copy small,
.npc-life-featured-copy b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.npc-life-featured-copy em { color: #70d9ff; font-size: 9px; font-style: normal; font-weight: 900; text-transform: uppercase; }
.npc-life-featured-copy strong { color: #fff; font-size: 17px; }
.npc-life-featured-copy small { color: #9fc4d1; font-size: 9px; }
.npc-life-featured-copy b { color: var(--opinion-color, #d0b56d); font-size: 9px; }
.npc-life-featured-reset {
    position: absolute;
    right: 8px;
    bottom: 8px;
    min-height: 23px;
    padding: 0 7px;
    border: 1px solid rgba(240, 200, 76, 0.44);
    border-radius: 4px;
    background: rgba(40, 31, 10, 0.88);
    color: #f0c84c;
    font-size: 8px;
    font-weight: 900;
}
.npc-life-featured-empty { min-height: 0; display: flex; flex: 1 1 auto; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 15px; border: 1px dashed rgba(85, 189, 236, 0.26); border-radius: 7px; color: #75909a; text-align: center; }
.npc-life-featured-empty > i { font-size: 29px; }
.npc-life-featured-empty strong { color: #b8cbd3; font-size: 11px; }
.npc-life-featured-empty small { font-size: 9px; line-height: 1.3; }
.npc-life-card[draggable="true"] { cursor: grab; }
.npc-life-card[draggable="true"]:active { cursor: grabbing; }
.npc-profile-current-thread { margin: 10px 0 12px; }
.faction-diplomacy-panel {
    min-width: 0;
    margin: 10px 0 4px;
}

.faction-diplomacy-heading small {
    margin-left: auto;
    color: var(--nexus-text-secondary, #9fc4d1);
    font-size: 9px;
    font-weight: 800;
}

.faction-diplomacy-list {
    display: grid;
    gap: 7px;
}

.faction-diplomacy-card {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    border: 1px solid var(--nexus-border-subtle, rgba(240, 200, 76, 0.32));
    border-radius: 2px;
    background: var(--nexus-surface-interactive, rgba(4, 13, 17, 0.78));
}

.faction-diplomacy-identity {
    min-width: 0;
    min-height: 52px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 6px 7px;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
}

.faction-diplomacy-identity:hover,
.faction-diplomacy-identity:focus-visible {
    background: var(--nexus-surface-hover, rgba(240, 200, 76, 0.08));
    box-shadow: none;
}

.faction-diplomacy-emblem {
    width: 36px;
    height: 40px;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: var(--nexus-accent-primary, #f0c84c);
}

.faction-diplomacy-emblem img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.faction-diplomacy-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.faction-diplomacy-copy strong,
.faction-diplomacy-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.faction-diplomacy-copy strong {
    color: var(--nexus-text-primary, #fff);
    font-size: 11px;
}

.faction-diplomacy-copy small {
    color: var(--nexus-text-secondary, #9fc4d1);
    font-size: 9px;
}

.faction-diplomacy-opinion {
    align-self: center;
    margin-right: 7px;
}

.faction-diplomacy-unrated {
    align-self: center;
    margin-right: 8px;
    color: var(--nexus-text-muted, #7c8b90);
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

.faction-diplomacy-details {
    grid-column: 1 / -1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 9px;
    padding: 5px 8px 6px;
    border-top: 1px solid var(--nexus-border-subtle, rgba(240, 200, 76, 0.24));
    color: var(--nexus-text-secondary, #9fc4d1);
    font-size: 8px;
    line-height: 1.25;
}

.faction-diplomacy-details > span,
.faction-diplomacy-details > p {
    min-width: 0;
    margin: 0;
}

.faction-diplomacy-details i {
    margin-right: 4px;
    color: var(--nexus-accent-primary, #f0c84c);
}

.faction-diplomacy-details b {
    color: var(--opinion-tier-color, var(--nexus-text-primary, #fff));
}

.faction-diplomacy-role {
    color: var(--nexus-accent-bright, #f6d777);
    font-weight: 800;
}

.faction-diplomacy-details > p {
    flex-basis: 100%;
    overflow: hidden;
    color: var(--nexus-text-muted, #87979d);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.faction-diplomacy-empty {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px;
    border: 1px dashed var(--nexus-border-subtle, rgba(240, 200, 76, 0.25));
    color: var(--nexus-text-muted, #7c8b90);
    font-size: 9px;
    text-align: center;
}
.npc-life-core-details {
    min-width: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
}

.npc-life-core-panel {
    min-width: 0;
    padding: 11px;
    border: 1px solid rgba(85, 189, 236, 0.24);
    border-radius: 8px;
    background: rgba(2, 14, 22, 0.78);
}
.npc-life-core-panel > h3,
.npc-life-section > h3 {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 9px;
    color: #70d9ff;
    font-size: 10px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}
.npc-life-section > h3 span { margin-left: auto; color: #f0c84c; }

.npc-life-traits {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.npc-life-trait {
    min-width: 0;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 6px;
    border: 1px solid rgba(85, 189, 236, 0.3);
    border-radius: 6px;
    background: rgba(7, 29, 40, 0.84);
}
.npc-life-trait img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}
.npc-life-trait > i { color: #70d9ff; text-align: center; }
.npc-life-trait strong {
    overflow: hidden;
    color: #fff;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.npc-life-beliefs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.npc-life-beliefs article {
    min-width: 0;
    padding: 8px;
    border: 1px solid rgba(85, 189, 236, 0.28);
    border-radius: 6px;
    background: rgba(5, 25, 35, 0.82);
}
.npc-life-beliefs article > span {
    display: block;
    overflow: hidden;
    color: #70d9ff;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}
.npc-life-beliefs article > strong {
    display: block;
    margin-top: 3px;
    color: #fff;
    font-size: 11px;
}
.npc-life-beliefs article > p {
    display: -webkit-box;
    margin: 4px 0 0;
    overflow: hidden;
    color: #b4cbd3;
    font-size: 10px;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}
.npc-life-core-empty { margin: 4px 0; color: #718b95; font-size: 10px; font-style: italic; }

.npc-life-sections {
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    align-content: start;
    gap: 12px;
    flex: 1 1 auto;
    overflow: auto;
    padding-right: 3px;
    scrollbar-width: thin;
}

.npc-life-section.is-current-thread {
    border-color: rgba(184, 125, 232, 0.36);
    background: linear-gradient(145deg, rgba(28, 13, 39, 0.86), rgba(7, 20, 29, 0.88));
}
.npc-life-section.is-current-thread > h3 { color: #d5a7f5; }
.npc-life-thread-reroll {
    width: 25px;
    height: 25px;
    min-height: 25px;
    display: grid;
    place-items: center;
    margin: -4px 0 -4px auto;
    padding: 0;
    border: 1px solid rgba(213, 167, 245, 0.55);
    border-radius: 5px;
    background: rgba(51, 23, 68, 0.86);
    color: #e8c9ff;
}
.npc-life-thread-reroll:hover { border-color: #eddaff; background: rgba(79, 38, 103, 0.94); }
.npc-life-thread-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}
.npc-life-thread-grid article {
    min-width: 0;
    padding: 8px 9px;
    border: 1px solid rgba(184, 125, 232, 0.28);
    border-radius: 6px;
    background: rgba(23, 14, 31, 0.78);
}
.npc-life-thread-grid span {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #d5a7f5;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.npc-life-thread-grid strong {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    color: #fff;
    font-size: 11px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.npc-life-section {
    min-width: 0;
    padding: 11px;
    border: 1px solid rgba(85, 189, 236, 0.26);
    border-radius: 8px;
    background: rgba(2, 14, 22, 0.82);
}
.npc-life-section.is-responsibility { border-color: rgba(240, 200, 76, 0.36); }
.npc-life-section.is-responsibility > h3 { color: #f0c84c; }

.npc-life-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 7px; }
.npc-life-card {
    min-width: 0;
    min-height: 58px;
    height: auto !important;
    max-height: none;
    display: grid;
    grid-template-columns: 43px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 7px;
    border: 1px solid rgba(85, 189, 236, 0.3);
    border-radius: 7px;
    background: rgba(7, 29, 40, 0.88);
    color: #fff;
    text-align: left;
}
.npc-life-card:hover { border-color: #70d9ff; background: rgba(10, 44, 59, 0.95); }
.npc-life-card-image {
    width: 41px;
    height: 41px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(85, 189, 236, 0.55);
    border-radius: 50%;
    background: #06131d;
    color: #70d9ff;
}
.npc-life-card-image.is-square { border-radius: 6px; color: #c49bdf; }
.npc-life-card-image.is-emblem { overflow: visible; border: 0; border-radius: 0; background: transparent; }
.npc-life-card-image img { width: 100%; height: 100%; object-fit: cover; }
.npc-life-card-image.is-emblem img { object-fit: contain; }

.npc-life-card-copy { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.npc-life-card-copy em,
.npc-life-card-copy strong,
.npc-life-card-copy small,
.npc-life-card-copy b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.npc-life-card-copy em { color: #70d9ff; font-size: 8px; font-style: normal; font-weight: 900; text-transform: uppercase; }
.npc-life-card-copy strong { color: #fff; font-size: 11px; }
.npc-life-card-copy small { color: #9fc4d1; font-size: 9px; }
.npc-life-card-copy b { color: var(--opinion-color, #d0b56d); font-size: 9px; }

.npc-life-unconnected {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 14px;
    border: 1px dashed rgba(85, 189, 236, 0.3);
    border-radius: 8px;
    background: rgba(2, 14, 22, 0.7);
    color: #76909a;
}
.npc-life-unconnected > i { font-size: 25px; text-align: center; }
.npc-life-unconnected strong { color: #b7ccd4; font-size: 11px; }
.npc-life-unconnected p { margin: 3px 0 0; font-size: 9px; }
.npc-life-unconnected button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid rgba(85, 189, 236, 0.5);
    border-radius: 5px;
    background: rgba(5, 35, 50, 0.88);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
}

.npc-life-dossier {
    min-width: 0;
    overflow: hidden;
    background: rgba(3, 9, 18, 0.72);
}
.npc-life-dossier .npc-dossier-header { flex: 0 0 auto; }
.npc-life-dossier > .npc-dossier-section,
.npc-life-dossier > .entity-dossier-chronicle {
    min-height: 0;
    flex: 1 1 auto;
    overflow: auto;
}
.npc-life-dossier .npc-dossier-chip-row { grid-template-columns: 1fr; }
.npc-life-connections {
    position: relative;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
}
.npc-life-connections .connections-board { padding-bottom: 8px; }

@media (max-width: 1120px) {
    .npc-life-stage { grid-template-columns: minmax(0, 1fr) 340px; }
    .npc-life-core { grid-template-columns: 210px minmax(0, 1fr); }
    .npc-life-beliefs { grid-template-columns: 1fr; }
    .npc-life-beliefs article > p { display: none; }
    .npc-life-card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    .npc-life-stage {
        grid-template-columns: minmax(0, 1fr);
        overflow: auto;
    }
    .npc-life-overview { min-height: 700px; overflow: visible; }
    .npc-life-dossier { min-height: 580px; }
}


.npc-dossier-shell.is-compact .npc-life-stage {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 10px;
    overflow: hidden;
}

.npc-dossier-shell.is-compact .npc-life-dossier {
    width: 100%;
    min-height: 0;
}

.npc-dossier-shell.is-compact .npc-life-dossier > .npc-dossier-section {
    padding-right: 3px;
}

.npc-dossier-shell.is-compact .faction-ideology-grid {
    grid-template-columns: 1fr;
}

.npc-dossier-shell.is-compact .faction-ideology-card {
    min-height: 0;
}

.npc-dossier-shell.is-compact .npc-trait-row {
    flex-wrap: nowrap;
    justify-content: center;
    gap: 18px;
    margin-bottom: 12px;
}

.npc-dossier-shell.is-compact .npc-trait-chip {
    width: 72px;
}

.npc-dossier-shell.is-compact .npc-dossier-header {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 8px;
}

.npc-dossier-shell.is-compact .npc-dossier-portrait {
    width: 64px;
    height: 64px;
}

.npc-dossier-header-actions {
    display: flex;
    align-items: flex-start;
    gap: 5px;
}

.npc-dossier-compact-toggle {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(85, 189, 236, 0.42);
    border-radius: 6px;
    background: rgba(4, 14, 23, 0.85);
    color: #ffffff;
}

.npc-dossier-compact-toggle:hover {
    border-color: #f0c84c;
    color: #f0c84c;
}

.npc-profile-section-heading {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 10px 0 8px;
    color: #55bdec;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}


.npc-profile-section-heading > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.npc-profile-section-heading.is-thread {
    justify-content: space-between;
    color: #d5a7f5;
}

.npc-profile-information + .npc-dossier-custom-row {
    margin-top: 0;
}

.npc-profile-current-thread .faction-current-thread-grid {
    margin-top: 0;
}

.npc-profile-current-thread .faction-current-thread-reroll {
    flex: 0 0 25px;
}
.npc-dossier-header {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.88);
}

.npc-dossier-portrait {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    border: 1px solid var(--npc-accent, #55bdec);
    border-radius: 50%;
    background: rgba(5, 16, 24, 0.92);
    color: #d7f6ff;
    overflow: hidden;
    box-shadow: 0 0 16px rgba(85, 189, 236, 0.18);
}

.npc-dossier-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.npc-dossier-portrait[draggable="true"] {
    cursor: grab;
}

.npc-dossier-portrait[draggable="true"]:active,
.npc-dossier-portrait[draggable="true"].is-dragging {
    cursor: grabbing;
}

.npc-dossier-portrait[draggable="true"] img {
    pointer-events: none;
    user-select: none;
}

.faction-dossier-emblem {
    border-color: transparent;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.faction-dossier-emblem img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.npc-dossier-title {
    min-width: 0;
}

.npc-dossier-title h2 {
    margin: 6px 0 2px;
    border: 0;
    color: #ffffff;
    font-family: var(--font-primary);
    font-size: 23px;
    font-style: italic;
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: 0;
}

.npc-dossier-title p {
    margin: 0 0 8px;
    color: #d9eff7;
    font-size: 12px;
    font-weight: 800;
}

.location-relationship-summary {
    width: min(100%, 900px);
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    margin: 6px auto 7px;
    padding: 0 10px;
    box-sizing: border-box;
}

.location-relationship-pill {
    width: auto;
    max-width: min(100%, 340px);
    min-height: 29px;
    height: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 3px 9px 3px 4px;
    border: 1px solid rgba(214, 171, 75, .72);
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(91, 59, 16, .88), rgba(28, 25, 17, .92));
    color: #fff2bf;
    box-shadow: 0 0 12px rgba(214, 171, 75, .12);
    text-align: left;
}

.location-relationship-pill:hover {
    border-color: #f3d277;
    background: linear-gradient(90deg, rgba(121, 78, 20, .94), rgba(42, 34, 18, .96));
    box-shadow: 0 0 0 1px rgba(255, 245, 194, .18) inset, 0 0 14px rgba(214, 171, 75, .2);
}

.location-relationship-pill.is-owner.has-owner-color {
    border-color: color-mix(in srgb, var(--owner-color) 78%, #ffffff 22%);
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--owner-color) 76%, #090d11 24%),
        color-mix(in srgb, var(--owner-color) 28%, #11151a 72%)
    );
    box-shadow: 0 0 12px color-mix(in srgb, var(--owner-color) 28%, transparent);
}

.location-relationship-pill.is-owner.has-owner-color:hover {
    border-color: color-mix(in srgb, var(--owner-color) 58%, #ffffff 42%);
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--owner-color) 86%, #090d11 14%),
        color-mix(in srgb, var(--owner-color) 36%, #11151a 64%)
    );
}

.location-relationship-pill.is-owner {
    min-height: 44px;
    max-width: min(100%, 390px);
    position: relative;
    gap: 0;
    margin-left: 38px;
    padding: 5px 16px 5px 45px;
    overflow: visible;
    border-radius: 5px 18px 18px 5px;
    box-shadow: 0 0 0 1px rgba(255, 239, 181, .08) inset, 0 4px 14px rgba(0, 0, 0, .28);
}

.location-relationship-pill.is-owner.has-owner-color {
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--owner-color) 42%, transparent) inset,
        0 4px 16px color-mix(in srgb, var(--owner-color) 24%, rgba(0, 0, 0, .45));
}

.location-relationship-pill.is-owner .location-relationship-owner-emblem {
    width: 76px;
    height: 76px;
    position: absolute;
    z-index: 1;
    top: 50%;
    left: -38px;
    flex-basis: 76px;
    overflow: visible;
    transform: translateY(-50%);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
}

.location-relationship-pill.is-owner .location-relationship-owner-emblem img {
    width: 76px;
    height: 76px;
    max-width: none;
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .7));
}

.location-relationship-summary .location-relationship-pill.is-owner .location-relationship-owner-label {
    display: grid;
    align-content: center;
    align-items: center;
    gap: 1px;
}

.location-relationship-pill.is-owner .location-relationship-owner-label em {
    color: rgba(255, 235, 177, .74);
    font-size: 8px;
    letter-spacing: .12em;
}

.location-relationship-pill.is-owner .location-relationship-owner-label strong {
    color: #fff7dd;
    font-family: "Signika", sans-serif;
    font-size: 13px;
    line-height: 1.1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .85);
}

.location-relationship-pill-icon {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: rgba(6, 10, 12, .72);
    color: #f0c95f;
}

.location-relationship-pill-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.location-relationship-pill:not(.is-trade-flow) > span:last-child {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.location-relationship-pill em {
    color: rgba(255, 238, 184, .72);
    font-size: 9px;
    font-style: normal;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.location-relationship-pill strong {
    overflow: hidden;
    color: #fff6d2;
    font-size: 11px;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.location-relationship-pill.is-trading-center {
    min-height: 40px;
    position: relative;
    gap: 0;
    margin-left: 30px;
    padding: 5px 16px 5px 37px;
    overflow: visible;
    border-radius: 5px 18px 18px 5px;
    border-color: rgba(106, 194, 164, .72);
    background: linear-gradient(90deg, rgba(20, 76, 61, .9), rgba(20, 34, 31, .94));
    color: #d9fff2;
}

.location-relationship-pill.is-trading-center:hover {
    border-color: #91e0c4;
    background: linear-gradient(90deg, rgba(25, 99, 77, .96), rgba(26, 45, 40, .98));
}

.location-relationship-pill.is-trading-center .location-relationship-pill-icon {
    width: 60px;
    height: 60px;
    position: absolute;
    z-index: 1;
    top: 50%;
    left: -30px;
    flex-basis: 60px;
    overflow: visible;
    transform: translateY(-50%);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #8fe0c4;
    pointer-events: none;
}

.location-relationship-pill.is-trading-center .location-relationship-pill-icon img {
    width: 60px;
    height: 60px;
    max-width: none;
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .65));
}

.location-relationship-pill.is-trade-flow {
    max-width: min(100%, 430px);
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding-left: 9px;
    border-color: rgba(201, 154, 69, .58);
    border-radius: 8px;
    background: rgba(22, 18, 11, .88);
}

.location-relationship-flow {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.location-relationship-resources,
.connection-card-resource-icons {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.location-relationship-resources img,
.location-relationship-resources > i {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    margin-block: -7px;
    border: 0;
    border-radius: 0;
    background: transparent;
    object-fit: contain;
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .7));
}

.location-relationship-resources > i {
    font-size: 22px;
    color: #e7c56b;
}

.connection-card-ownership {
    margin-right: 3px;
    color: #f0c95f;
    font-size: .8em;
}

.connection-card-membership {
    margin-right: 3px;
    color: #8ad1f2;
    font-size: .8em;
}

.connection-card-membership.is-leader {
    color: #f0c95f;
}

.connection-card-trading-center {
    margin-right: 3px;
    color: #e6bd59;
    font-size: .8em;
}

.npc-dossier-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
}

.npc-dossier-tabs button,
.npc-dossier-secondary,
.npc-create-form button {
    min-height: 28px;
    border: 1px solid rgba(85, 189, 236, 0.78);
    border-radius: 5px;
    background: rgba(5, 35, 50, 0.88);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
}

.npc-dossier-tabs button {
    min-height: 24px;
    padding: 0 8px;
    font-size: 11px;
    white-space: nowrap;
}

.npc-dossier-tabs button.active {
    background: rgba(0, 105, 150, 0.92);
    box-shadow: 0 0 0 1px #ffffff inset;
}
.npc-dossier-tabs .npc-dossier-tab-icon {
    width: 28px;
    min-width: 28px;
    padding: 0;
}


.npc-dossier-tabs .npc-dossier-tab-icon i {
    font-size: 13px;
}

.npc-dossier-action {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(85, 189, 236, 0.42);
    border-radius: 6px;
    background: rgba(4, 14, 23, 0.85);
    color: #ffffff;
}

.npc-dossier-section {
    min-height: 0;
    padding-top: 12px;
    overflow: auto;
}

.npc-dossier-journal {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.npc-dossier-journal-body {
    min-height: 0;
    flex: 1 1 auto;
    overflow: auto;
}

.npc-trait-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-bottom: 14px;
}

.npc-trait-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 78px;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
}

.npc-trait-chip img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    padding: 5px;
    border: 1px solid rgba(85, 189, 236, 0.28);
    border-radius: 7px;
    background: rgba(7, 24, 36, 0.62);
}

.npc-trait-chip span {
    color: #f4fbff;
}

.npc-trait-chip.missing {
    opacity: 0.55;
}

.npc-dossier-description {
    margin: 0 0 12px;
    color: #ffe7b2;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
}

.npc-dossier-custom-row {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.npc-dossier-chip-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.npc-dossier-chip-row-primary {
    margin-top: 12px;
}

.npc-dossier-chip-row span,
.npc-dossier-custom-row span {
    min-width: 0;
    padding: 7px 8px;
    border: 1px solid rgba(85, 189, 236, 0.28);
    border-radius: 6px;
    background: rgba(7, 24, 36, 0.62);
}

.npc-dossier-chip-row em,
.npc-dossier-custom-row em {
    display: block;
    color: #a8d9e9;
    font-size: 9px;
    font-style: normal;
    font-weight: 800;
    text-transform: none;
}

.npc-dossier-chip-row strong,
.npc-dossier-custom-row strong {
    display: block;
    overflow: hidden;
    color: #ffffff;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.npc-dossier-chip-row strong {
    text-overflow: ellipsis;
    white-space: nowrap;
}

.faction-dossier .npc-dossier-chip-row strong,
.faction-create-dialog .npc-dossier-chip-row strong,
.ship-dossier .npc-dossier-chip-row strong,
.ship-create-dialog .npc-dossier-chip-row strong {
    overflow: visible;
    line-height: 1.08;
    text-overflow: clip;
    white-space: normal;
}

.faction-dossier .npc-dossier-chip-row span,
.faction-create-dialog .npc-dossier-chip-row span,
.ship-dossier .npc-dossier-chip-row span,
.ship-create-dialog .npc-dossier-chip-row span {
    min-height: 42px;
}

.faction-ideology-panel {
    margin-bottom: 12px;
}

.faction-ideology-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.faction-ideology-card {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid rgba(85, 189, 236, 0.28);
    border-radius: 7px;
    background: linear-gradient(145deg, rgba(8, 29, 42, 0.86), rgba(3, 12, 20, 0.92));
}

.faction-ideology-title {
    min-width: 0;
    display: flex;
    gap: 5px;
    align-items: baseline;
}

.faction-ideology-topic {
    flex: 0 0 auto;
    display: inline-flex;
    gap: 5px;
    align-items: center;
    color: #a8d9e9;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.faction-ideology-separator {
    flex: 0 0 auto;
    color: rgba(168, 217, 233, 0.72);
    font-size: 11px;
    font-weight: 900;
}

.faction-ideology-title strong {
    min-width: 0;
    color: #ffffff;
    font-size: 10px;
    line-height: 1.2;
}

.faction-ideology-card p {
    margin: 4px 0 0;
    color: rgba(244, 251, 255, 0.72);
    font-size: 11px;
    line-height: 1.3;
}

.faction-current-thread {
    margin: 0 0 12px;
    padding: 10px;
    border: 1px solid rgba(184, 125, 232, 0.34);
    border-radius: 7px;
    background: linear-gradient(145deg, rgba(28, 13, 39, 0.82), rgba(5, 16, 24, 0.9));
}

.faction-current-thread > h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 8px;
    color: #d5a7f5;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.faction-current-thread > h3 > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.faction-current-thread-reroll {
    width: 25px;
    height: 25px;
    min-height: 25px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(213, 167, 245, 0.55);
    border-radius: 5px;
    background: rgba(51, 23, 68, 0.86);
    color: #e8c9ff;
}

.faction-current-thread-reroll:hover {
    border-color: #eddaff;
    background: rgba(79, 38, 103, 0.94);
}

.faction-current-thread-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.faction-current-thread-grid article {
    min-width: 0;
    padding: 8px 9px;
    border: 1px solid rgba(184, 125, 232, 0.26);
    border-radius: 6px;
    background: rgba(23, 14, 31, 0.76);
}

.faction-current-thread-grid span {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #d5a7f5;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.faction-current-thread-grid strong {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    color: #ffffff;
    font-size: 11px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ship-dossier-image {
    border-color: transparent;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.ship-dossier .ship-dossier-image img {
    width: auto !important;
    height: auto !important;
    max-width: 76%;
    max-height: 76%;
    object-fit: contain;
}

/* Ships use a domain dashboard: command, physical presence, crew, and world ties. */
.ship-dossier-shell { --augur-ui-accent: var(--nexus-accent-primary); --npc-accent: var(--nexus-accent-primary); }
.ship-domain-stage { position: absolute; inset: 0; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) 365px; gap: 18px; width: 100%; height: 100%; min-height: 0; padding: 18px; box-sizing: border-box; }
.ship-domain-overview { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.ship-domain-dossier { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 14px; overflow: hidden; background: rgba(0, 8, 15, 0.76); }
.ship-domain-dossier .npc-dossier-header { flex: 0 0 auto; }
.ship-dossier-header-actions { flex-direction: column; }
.ship-dossier-shell.is-compact .ship-domain-stage { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 10px; overflow: hidden; }
.ship-dossier-shell.is-compact .ship-domain-dossier { width: 100%; min-height: 0; }
.ship-dossier-shell.is-compact .ship-domain-dossier > .npc-dossier-section { padding-right: 3px; }
.ship-dossier-shell.is-compact .ship-domain-command { grid-template-columns: minmax(0, 1fr); gap: 7px; margin: 12px 0; overflow: auto; }
.ship-dossier-shell.is-compact .ship-domain-command-card { grid-template-columns: 46px minmax(0, 1fr); min-height: 68px; padding: 6px; }
.ship-dossier-shell.is-compact .ship-domain-command-card > .nexus-entity-image { width: 44px; height: 48px; }
.ship-domain-command { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ship-domain-command-card { min-width: 0; min-height: 98px; display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 10px; margin: 0; padding: 10px; border: 1px solid var(--nexus-border-subtle); border-radius: var(--nexus-radius-control, 3px); color: var(--nexus-text-primary); background: rgba(8, 13, 15, 0.82); box-shadow: none; text-align: left; transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease; }
.ship-domain-command-card:hover { border-color: var(--nexus-border-strong); background: var(--nexus-accent-surface); box-shadow: none; }
.ship-domain-command-card.is-empty { color: var(--nexus-text-secondary); opacity: .78; }
.ship-domain-command-card.is-empty > i,
.ship-domain-command-card.is-derived-owner > i { color: var(--nexus-accent-primary); font-size: 28px; text-align: center; }
.ship-domain-command-card.is-derived-owner { cursor: default; }
.ship-domain-command-card > span:last-child { min-width: 0; display: grid; align-content: center; gap: 2px; }
.ship-domain-command-card em { color: var(--nexus-accent-bright); font-size: 9px; font-style: normal; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.ship-domain-command-card strong { min-width: 0; overflow: hidden; color: var(--nexus-text-primary); font-family: var(--nexus-heading-font, serif); font-size: 17px; line-height: 1.12; text-overflow: ellipsis; white-space: nowrap; }
.ship-domain-command-card small { min-width: 0; overflow: hidden; color: var(--nexus-text-secondary); font-size: 9px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.ship-domain-command-card > .nexus-entity-image { width: 70px; height: 76px; justify-self: center; }
.ship-domain-command-card > .nexus-entity-image.is-person { height: 70px; }
.ship-domain-command-card > .nexus-entity-image.is-emblem,
.ship-domain-command-card > .nexus-entity-image.is-place { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.ship-domain-command-card > .nexus-entity-image.is-emblem img,
.ship-domain-command-card > .nexus-entity-image.is-place img { object-fit: contain; }
.ship-domain-identity, .ship-domain-collection { border: 1px solid var(--nexus-border-subtle); border-radius: var(--nexus-radius-control, 3px); background: rgba(2, 10, 15, 0.72); }
.ship-domain-identity { display: grid; grid-template-columns: 145px minmax(0, 1fr); align-items: stretch; }
.ship-domain-identity > h3, .ship-domain-collection > h3, .ship-domain-sidebar-assignment > h3 { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--nexus-accent-bright); font-size: 10px; font-weight: 900; letter-spacing: 0.05em; text-transform: uppercase; }
.ship-domain-identity > h3 { padding: 12px; border-right: 1px solid var(--nexus-border-subtle); }
.ship-domain-identity > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ship-domain-identity article { min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 9px 14px; border-right: 1px solid var(--nexus-border-subtle); }
.ship-domain-identity article:last-child { border-right: 0; }
.ship-domain-identity em, .ship-domain-sidebar-assignment em { color: var(--nexus-text-muted); font-size: 8px; font-style: normal; font-weight: 900; text-transform: uppercase; }
.ship-domain-identity strong, .ship-domain-sidebar-assignment strong { overflow: hidden; color: var(--nexus-text-primary); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ship-domain-columns { min-height: 0; flex: 1 1 auto; display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 12px; }
.ship-domain-collection { min-height: 280px; display: flex; flex-direction: column; padding: 11px; }
.ship-domain-collection > h3 { padding-bottom: 9px; border-bottom: 1px solid var(--nexus-border-subtle); }
.ship-domain-collection > h3 span { margin-left: auto; color: var(--nexus-accent-bright); }
.ship-domain-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 8px; padding-top: 10px; }
.ship-domain-small-card { min-width: 0; min-height: 65px; display: grid; grid-template-columns: 48px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 9px; align-items: center; margin: 0; padding: 7px; border: 1px solid var(--nexus-border-subtle); border-radius: var(--nexus-radius-control, 3px); background: color-mix(in srgb, var(--nexus-accent-primary) 7%, rgba(3, 12, 18, 0.88)); color: inherit; box-shadow: none; text-align: left; }
.ship-domain-small-card:hover { border-color: var(--nexus-border-strong); background: var(--nexus-accent-surface); box-shadow: none; }
.ship-domain-small-card > span { width: 48px; height: 48px; grid-row: 1 / 3; }
.ship-domain-small-card strong, .ship-domain-small-card em { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ship-domain-small-card strong { align-self: end; color: #fff; font-size: 12px; }
.ship-domain-small-card em { align-self: start; color: var(--connection-category-color, var(--nexus-text-secondary)); font-size: 9px; font-style: normal; }
.ship-domain-small-card.is-captain { border-color: var(--nexus-border-strong); }
.ship-domain-empty { grid-column: 1 / -1; display: grid; place-items: center; min-height: 100px; padding: 18px; color: var(--nexus-text-muted); font-size: 10px; text-align: center; }
.ship-domain-drop-hint { margin: auto 0 0; padding-top: 10px; color: var(--nexus-text-muted); font-size: 9px; text-align: center; }
.ship-domain-drop-hint i { margin-right: 4px; color: var(--nexus-accent-primary); }
.ship-domain-crew-footer { display: grid; grid-template-columns: 34px minmax(0, 1fr) 34px; align-items: end; gap: 8px; margin-top: auto; padding-top: 10px; }
.ship-domain-crew-footer .ship-domain-drop-hint { grid-column: 2; margin: 0; padding: 0; }
.ship-domain-crew-footer .nexus-create-button-round { grid-column: 3; width: 30px; height: 30px; min-width: 30px; min-height: 30px; display: grid; place-items: center; margin: 0; padding: 0; border-radius: 50%; background: var(--nexus-accent-surface); color: var(--nexus-text-primary); }
.ship-domain-overview [draggable="true"] { cursor: grab; }
.ship-domain-overview [draggable="true"]:active { cursor: grabbing; }
.ship-dossier-shell [data-ship-domain-drop].is-ship-drop-target { border-color: var(--nexus-accent-primary); background: var(--nexus-accent-surface); box-shadow: inset 0 0 0 1px var(--nexus-accent-primary), 0 0 12px color-mix(in srgb, var(--nexus-accent-primary) 22%, transparent); }
.ship-domain-sidebar-assignment { margin: 12px; padding: 11px; border: 1px solid var(--nexus-border-subtle); border-radius: var(--nexus-radius-control, 3px); background: rgba(2, 10, 15, 0.72); }
.ship-domain-sidebar-assignment > h3 { padding-bottom: 8px; border-bottom: 1px solid var(--nexus-border-subtle); }
.ship-domain-sidebar-assignment .faction-current-thread-reroll {
    margin-left: auto;
    border-color: var(--nexus-border-strong);
    color: var(--nexus-accent-bright);
    background: var(--nexus-accent-surface);
}
.ship-domain-sidebar-assignment .faction-current-thread-reroll:hover,
.ship-domain-sidebar-assignment .faction-current-thread-reroll:focus-visible {
    border-color: var(--nexus-accent-bright);
    color: var(--nexus-accent-bright);
    background: var(--nexus-accent-surface-strong);
    box-shadow: var(--nexus-focus-ring);
}
.ship-domain-sidebar-assignment > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding-top: 9px; }
.ship-domain-sidebar-assignment article { min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 8px; border: 1px solid var(--nexus-border-subtle); background: var(--nexus-accent-surface); }
.ship-domain-sidebar-assignment article:last-child:nth-child(odd) { grid-column: 1 / -1; }
.ship-domain-connections { position: relative; min-height: 0; flex: 1 1 auto; overflow: hidden; }
.ship-domain-connections .connections-board { padding-bottom: 8px; }
/* Ship dossiers use the same live Nexus appearance variables as the other dossiers. */
.ship-dossier-shell .ship-domain-dossier.npc-dossier-profile { border-color: var(--nexus-border-subtle); }
.ship-dossier-shell .npc-dossier-header { border-bottom-color: var(--nexus-border-strong); }
.ship-dossier-shell .npc-dossier-tabs button,
.ship-dossier-shell .npc-dossier-action,
.ship-dossier-shell .npc-dossier-compact-toggle,
.ship-dossier-shell .npc-dossier-secondary,
.ship-dossier-shell .nexus-create-button-round { border-color: var(--nexus-border-strong); }
.ship-dossier-shell .npc-dossier-tabs button,
.ship-dossier-shell .npc-dossier-action,
.ship-dossier-shell .npc-dossier-compact-toggle,
.ship-dossier-shell .npc-dossier-secondary { background: var(--nexus-accent-surface); }
.ship-dossier-shell .npc-dossier-tabs button.active { background: var(--nexus-accent-surface-strong); }
.ship-dossier-shell .npc-dossier-action:hover,
.ship-dossier-shell .npc-dossier-compact-toggle:hover,
.ship-dossier-shell .npc-dossier-secondary:hover,
.ship-dossier-shell .nexus-create-button-round:hover { border-color: var(--nexus-accent-primary); color: var(--nexus-accent-bright); }
.ship-domain-sidebar-assignment { border-color: var(--nexus-border-subtle); }
.ship-domain-sidebar-assignment > h3 { border-bottom-color: var(--nexus-border-subtle); }
.ship-domain-sidebar-assignment article { border-color: var(--nexus-border-subtle); background: var(--nexus-accent-surface); }
@media (max-width: 1050px) { .ship-domain-stage { grid-template-columns: minmax(0, 1fr) 330px; } .ship-domain-command { grid-template-columns: 1fr; } .ship-domain-command-card { min-height: 84px; } .ship-domain-columns { grid-template-columns: 1fr; } }

.npc-dossier-journal-content {
    padding-right: 8px;
    color: #f8e7c7;
    font-size: 14px;
    line-height: 1.4;
}

.npc-dossier-journal-footer {
    flex: 0 0 auto;
    padding-top: 10px;
}

.location-dossier-profile-footer {
    display: grid;
    gap: 6px;
}

.location-dossier-profile-footer > button {
    width: 100%;
}

.location-limited-preview-window .window-content {
    padding: 0;
    overflow: hidden;
}

.location-limited-preview {
    min-height: 225px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px 26px 28px;
    background:
        radial-gradient(circle at 50% 24%, color-mix(in srgb, var(--location-accent, #d18a42) 18%, transparent), transparent 44%),
        linear-gradient(165deg, rgba(13, 27, 35, 0.98), rgba(5, 14, 20, 0.99));
    color: #f8e7c7;
    text-align: center;
}

.location-limited-preview-icon {
    width: 92px;
    height: 92px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background: rgba(2, 10, 15, 0.7);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.38);
}

.location-limited-preview-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.location-limited-preview-icon i {
    color: var(--location-accent, #d18a42);
    font-size: 42px;
}

.location-limited-preview h2 {
    margin: 2px 0 0;
    color: #ffffff;
    font-family: var(--font-serif, serif);
    font-size: 24px;
    line-height: 1.1;
}

.location-limited-preview p {
    margin: 0;
    color: rgba(232, 241, 245, 0.72);
    font-size: 13px;
    line-height: 1.4;
}

.npc-dossier-empty,
.npc-dossier-missing {
    padding: 14px;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: 7px;
    color: #b8cad2;
    text-align: center;
}

.npc-dossier-empty.compact {
    margin-bottom: 12px;
    padding: 10px;
}

.npc-dossier-secondary {
    width: 100%;
}
