.augur-nexus.settlement-view-window .window-content {
    padding: 0;
    overflow: hidden;
    border: 0;
    background: #090d0f;
}

.fantasy-settlement-view-shell {
    position: relative;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    color: var(--nexus-text-primary);
    background: #090d0f;
    isolation: isolate;
}

.fantasy-settlement-background,
.fantasy-settlement-view-shade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.fantasy-settlement-background {
    z-index: 0;
    border: 0;
    object-fit: cover;
}

.fantasy-settlement-view-shade {
    z-index: 1;
    background:
        radial-gradient(circle at 34% 39%, rgba(0, 0, 0, .02), rgba(4, 8, 9, .24) 56%, rgba(3, 7, 9, .7)),
        linear-gradient(90deg, rgba(4, 7, 8, .18), rgba(4, 8, 9, .1) 48%, rgba(2, 7, 9, .74)),
        linear-gradient(0deg, rgba(4, 7, 8, .7), transparent 44%, rgba(4, 7, 8, .28));
}

.fantasy-settlement-stage {
    position: absolute;
    inset: 0 382px 0 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    min-height: 0;
    padding: 12px;
}

.fantasy-settlement-command-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.fantasy-settlement-command-card {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 98px;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--nexus-border-subtle);
    border-radius: 2px;
    color: var(--nexus-text-primary);
    background: rgba(8, 13, 15, .82);
    text-align: left;
}

.fantasy-settlement-command-card > i {
    color: var(--nexus-accent-primary);
    font-size: 28px;
    text-align: center;
}

.fantasy-settlement-command-card > span:last-child {
    display: grid;
    min-width: 0;
}

.fantasy-settlement-command-card em,
.fantasy-settlement-domain-panel h3,
.fantasy-settlement-economy-row > h3 {
    color: var(--nexus-accent-bright);
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.fantasy-settlement-command-card strong {
    overflow: hidden;
    color: var(--nexus-text-primary);
    font-family: var(--nexus-font-heading, serif);
    font-size: 17px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fantasy-settlement-command-card small {
    overflow: hidden;
    color: var(--nexus-text-secondary);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fantasy-settlement-command-card.is-empty { opacity: .75; }
.fantasy-settlement-command-card .nexus-entity-image { width: 70px; height: 76px; }
.fantasy-settlement-command-card .is-person { height: 70px; }
.fantasy-settlement-command-card.is-drop-target,
.fantasy-settlement-people.is-drop-target {
    border-color: var(--nexus-accent-primary);
    box-shadow: inset 0 0 0 1px var(--nexus-accent-primary), 0 0 12px color-mix(in srgb, var(--nexus-accent-primary) 22%, transparent);
}

.fantasy-settlement-economy-row {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 70px;
    padding: 9px 12px;
    border: 1px solid var(--nexus-border-subtle);
    background: rgba(8, 13, 15, .78);
}

.fantasy-settlement-economy-row > h3 { margin: 0; }
.fantasy-settlement-empty-inline { color: var(--nexus-text-secondary); font-size: 11px; }

.fantasy-settlement-domain-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    flex: 1;
    gap: 12px;
    min-height: 0;
}

.fantasy-settlement-domain-panel {
    position: relative;
    min-height: 0;
    padding: 12px;
    border: 1px solid var(--nexus-border-subtle);
    background: rgba(8, 13, 15, .8);
    overflow: auto;
}

.fantasy-settlement-domain-panel > h3 {
    display: flex;
    gap: 7px;
    margin: 0 0 10px;
}

.fantasy-settlement-domain-panel > h3 span { margin-left: auto; }
.fantasy-settlement-establishment-grid,
.fantasy-settlement-people-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 8px;
}

.fantasy-settlement-establishments {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
}

.fantasy-settlement-establishments .fantasy-settlement-establishment-grid,
.fantasy-settlement-establishments .fantasy-settlement-establishment-grid.is-few {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding: 0 3px 50px 0;
    overflow-y: auto;
    scrollbar-width: thin;
}

.fantasy-settlement-establishments .fantasy-settlement-establishment-card,
.fantasy-settlement-establishments .fantasy-settlement-establishment-grid.is-few .fantasy-settlement-establishment-card {
    grid-template-columns: 100px minmax(0, 1fr);
    width: 100%;
    min-height: 118px;
    padding: 9px;
}

.fantasy-settlement-establishments .fantasy-settlement-establishment-card .nexus-entity-image,
.fantasy-settlement-establishments .fantasy-settlement-establishment-grid.is-few .fantasy-settlement-establishment-card .nexus-entity-image {
    width: 96px;
    height: 96px;
}

.fantasy-settlement-establishments .fantasy-settlement-establishment-card strong {
    font-family: var(--nexus-font-heading, serif);
    font-size: 15px;
}

.fantasy-settlement-people {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
}

.fantasy-settlement-people .fantasy-settlement-people-grid {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding-right: 3px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.fantasy-settlement-establishment-card,
.fantasy-settlement-person-card {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 62px;
    margin: 0;
    padding: 6px;
    border: 1px solid var(--nexus-border-subtle);
    border-radius: 2px;
    color: var(--nexus-text-primary);
    background: rgba(7, 12, 14, .88);
    text-align: left;
}

.fantasy-settlement-establishment-card > span:last-child,
.fantasy-settlement-person-card > span:last-child { display: grid; min-width: 0; }
.fantasy-settlement-establishment-card strong,
.fantasy-settlement-person-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fantasy-settlement-establishment-card small { color: var(--nexus-text-secondary); }
.fantasy-settlement-person-card em { color: var(--nexus-accent-bright); font-size: 9px; font-style: normal; }
.fantasy-settlement-establishment-card .nexus-entity-image,
.fantasy-settlement-person-card .nexus-entity-image { width: 50px; height: 50px; }
.fantasy-settlement-people-grid .fantasy-settlement-person-card {
    grid-template-columns: 54px minmax(0, 1fr);
    grid-template-rows: auto auto;
    min-height: 66px;
    padding: 8px;
}

.fantasy-settlement-people-grid .fantasy-settlement-person-card.has-allegiance {
    grid-template-columns: 54px 96px minmax(0, 1fr);
}

.fantasy-settlement-people-grid .fantasy-settlement-person-card > .nexus-entity-image {
    grid-row: 1 / 3;
    width: 42px;
    height: 42px;
    align-self: center;
    justify-self: center;
}

.fantasy-settlement-people-grid .fantasy-settlement-person-copy {
    display: grid;
    align-content: center;
    gap: 3px;
    min-width: 0;
}

.fantasy-settlement-people-grid .fantasy-settlement-person-copy strong,
.fantasy-settlement-people-grid .fantasy-settlement-person-copy em {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fantasy-settlement-people-grid .fantasy-settlement-person-copy strong {
    color: var(--nexus-text-primary);
    font-size: 11px;
    line-height: 1.1;
}

.fantasy-settlement-people-grid .fantasy-settlement-person-copy em {
    margin: 0;
    color: var(--nexus-text-secondary);
    font-size: 9px;
    font-style: normal;
    line-height: 1.1;
    text-transform: none;
}

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

.fantasy-settlement-person-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) 24%, transparent);
}

.fantasy-settlement-person-card .fantasy-settlement-person-allegiance-image {
    width: 30px;
    height: 34px;
}

.fantasy-settlement-person-allegiance-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.fantasy-settlement-person-allegiance-copy strong,
.fantasy-settlement-person-allegiance-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fantasy-settlement-person-allegiance-copy strong { color: var(--nexus-accent-primary); font-size: 9px; }
.fantasy-settlement-person-allegiance-copy small { color: var(--nexus-text-muted); font-size: 8px; }
.fantasy-settlement-empty { display: grid; place-items: center; grid-column: 1 / -1; min-height: 86px; color: var(--nexus-text-secondary); text-align: center; }
.fantasy-settlement-panel-add { position: absolute; right: 12px; bottom: 12px; }
.fantasy-settlement-drop-hint { grid-column: 2; display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; color: var(--nexus-accent-primary); font-size: 9px; line-height: 1.25; text-align: center; }
.fantasy-settlement-people-footer .fantasy-settlement-panel-add { position: static; grid-column: 3; margin: 0; }

.fantasy-settlement-dossier {
    position: absolute;
    z-index: 4;
    top: 12px;
    right: 12px;
    bottom: 12px;
    width: 370px;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--nexus-border-subtle);
    border-radius: 2px;
    background: linear-gradient(180deg, rgba(13, 19, 22, .96), rgba(6, 10, 12, .96));
    box-shadow: 0 14px 34px rgba(0, 0, 0, .62), inset 0 0 28px rgba(0, 0, 0, .36);
    backdrop-filter: blur(4px);
}

.fantasy-settlement-dossier .location-embedded-dossier {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: 12px;
}

.fantasy-settlement-dossier .location-embedded-dossier-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 4px;
}

.fantasy-settlement-dossier .location-embedded-connections { position: relative; flex: 1 1 auto; min-height: 0; margin-top: 12px; }
.fantasy-settlement-dossier .location-embedded-connections .connections-board { inset: 0; }
.fantasy-settlement-compact-toggle { position: absolute; z-index: 9; top: 70px; right: 34px; }
.fantasy-settlement-view-missing { display: grid; place-items: center; height: 100%; color: var(--nexus-text-secondary); }

.fantasy-settlement-view-shell.is-compact .fantasy-settlement-dossier {
    inset: 0;
    width: 100%;
    border: 0;
    background: rgba(6, 10, 12, .94);
}

.fantasy-settlement-view-shell.is-compact .location-embedded-dossier { padding: 14px; }
.fantasy-settlement-view-shell.is-compact .fantasy-settlement-compact-toggle { right: 14px; }

@media (max-width: 1100px) {
    .fantasy-settlement-stage { right: 332px; }
    .fantasy-settlement-dossier { width: 320px; }
}

@media (max-width: 850px) {
    .fantasy-settlement-stage { right: 292px; }
    .fantasy-settlement-dossier { width: 280px; }
}
