.augur-theme-fantasy.regional-trade-network .window-content,
.augur-theme-fantasy.trade-goods-picker .window-content {
    padding: 0;
    overflow: hidden;
    background: #070b0d;
    color: var(--nexus-text-primary);
}

.regional-trade-network-shell {
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    background: radial-gradient(circle at 16% 0, var(--nexus-accent-surface), transparent 30%), linear-gradient(145deg, rgba(14, 20, 22, .98), rgba(5, 8, 10, .99));
}

.regional-trade-network-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 16px 20px 13px;
    border-bottom: 1px solid var(--nexus-border-subtle);
}

.regional-trade-network-header>div:first-child>span,
.regional-trade-detail-header>div>span {
    color: var(--nexus-accent-bright);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.regional-trade-network-header h2,
.regional-trade-detail-header h3 {
    margin: 2px 0;
    color: var(--nexus-text-primary);
    font-family: var(--nexus-font-heading, serif);
}

.regional-trade-network-header h2 { font-size: 26px; }
.regional-trade-network-header p,
.regional-trade-detail-header p,
.regional-trade-tree-panel>header p,
.regional-trade-section-heading p {
    margin: 0;
    color: var(--nexus-text-muted);
    font-size: 11px;
    line-height: 1.35;
}

.regional-trade-network-summary { display: flex; gap: 8px; }
.regional-trade-network-summary>span {
    min-width: 76px;
    display: grid;
    padding: 7px 10px;
    border: 1px solid var(--nexus-border-subtle);
    border-radius: 2px;
    background: rgba(5, 9, 11, .72);
    text-align: center;
}
.regional-trade-network-summary strong { color: var(--nexus-accent-bright); font-size: 18px; }
.regional-trade-network-summary small { color: var(--nexus-text-muted); font-size: 11px; text-transform: uppercase; }
.regional-trade-network-summary.is-compact { margin-left: auto; align-items: center; gap: 12px; }
.regional-trade-network-summary.is-compact .regional-trade-region-name { max-width: 220px; overflow: hidden; color: var(--nexus-text-secondary); text-overflow: ellipsis; white-space: nowrap; }
.regional-trade-network-summary.is-compact .regional-trade-region-name i { margin-right: 4px; color: var(--nexus-accent-primary); }
.regional-trade-network-summary.is-compact>span {
    min-width: 0;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--nexus-text-muted);
    font-size: 11px;
    text-transform: uppercase;
}
.regional-trade-network-summary.is-compact strong { font-size: 14px; }

.regional-trade-network-scopes {
    display: flex;
    gap: 5px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--nexus-border-subtle);
    background: rgba(4, 8, 10, .72);
}
.regional-trade-network-scopes button,
.regional-trade-detail-header>button,
.regional-trade-market-group header button,
.regional-trade-center-controls button {
    width: auto;
    min-height: 30px;
    margin: 0;
    padding: 5px 10px;
    border: 1px solid var(--nexus-border-subtle);
    border-radius: 2px;
    background: var(--nexus-surface-interactive);
    color: var(--nexus-text-primary);
    font-size: 11px;
    font-weight: 800;
}
.regional-trade-network-scopes button.active,
.regional-trade-network-scopes button:hover,
.regional-trade-market-group header button:hover {
    border-color: var(--nexus-border-strong);
    background: var(--nexus-accent-surface);
    color: var(--nexus-accent-bright);
}
.regional-trade-network-workspace {
    min-height: 0;
    display: grid;
    grid-template-columns: 460px minmax(0, 1fr);
}
.regional-trade-tree-panel,
.regional-trade-detail-panel { min-height: 0; overflow: hidden; }
.regional-trade-tree-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border-right: 1px solid var(--nexus-border-subtle);
    background: rgba(5, 9, 11, .72);
}
.regional-trade-tree-panel>header { padding: 11px 14px; border-bottom: 1px solid var(--nexus-border-subtle); }
.regional-trade-tree-panel h3 {
    margin: 0 0 3px;
    color: var(--nexus-accent-bright);
    font-size: 13px;
    text-transform: uppercase;
}
.regional-trade-tree { min-height: 0; overflow: auto; padding: 8px; }
.regional-trade-tree-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px;
    margin: 0 0 6px;
    margin-left: var(--trade-depth);
    border: 1px solid var(--nexus-border-subtle);
    border-radius: 2px;
    background: rgba(9, 14, 16, .78);
}
.regional-trade-tree-row.is-selected { border-color: var(--nexus-border-strong); background: var(--nexus-accent-surface); }
.regional-trade-tree-row.has-warning { box-shadow: inset 3px 0 #d59a47; }
.regional-trade-tree-select {
    display: grid;
    grid-template-columns: 18px 52px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    min-width: 0;
    min-height: 76px;
    margin: 0;
    padding: 7px;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
}
.regional-trade-tree-select:hover { background: var(--nexus-accent-surface); }
.regional-trade-tree-branch { color: var(--nexus-accent-primary); font-size: 12px; text-align: center; }
.regional-trade-tree-select>.nexus-entity-image { width: 50px; height: 54px; }
.regional-trade-tree-copy { min-width: 0; display: grid; gap: 3px; }
.regional-trade-tree-copy>strong {
    overflow: hidden;
    color: var(--nexus-text-primary);
    font-family: var(--nexus-font-heading, serif);
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.regional-trade-tree-copy>strong i { margin-left: 5px; color: var(--nexus-accent-primary); font-size: 10px; }
.regional-trade-tree-copy>small {
    overflow: hidden;
    color: var(--nexus-text-muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.regional-trade-tree-flow { min-width: 0; display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; overflow: hidden; }
.regional-trade-tree-flow b {
    max-width: 122px;
    flex: 0 1 auto;
    overflow: hidden;
    color: var(--nexus-accent-bright);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.regional-trade-tree-flow em {
    max-width: 88px;
    flex: 0 1 auto;
    overflow: hidden;
    padding: 2px 5px;
    border: 1px solid color-mix(in srgb, var(--nexus-accent-primary) 28%, transparent);
    border-radius: 2px;
    color: var(--nexus-text-secondary);
    font-size: 11px;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.regional-trade-tree-flow em:last-child { flex-shrink: 0; }
.regional-trade-tree-flow>i { color: #d59a47; font-size: 10px; }
.regional-trade-tree-open {
    align-self: stretch;
    width: 32px;
    margin: 0;
    border: 0;
    border-left: 1px solid var(--nexus-border-subtle);
    border-radius: 0;
    background: transparent;
    color: var(--nexus-text-muted);
    font-size: 11px;
}
.regional-trade-tree-open:hover { background: var(--nexus-accent-surface); color: var(--nexus-accent-bright); }

.regional-trade-detail-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    padding: 14px 14px 0;
}
.regional-trade-detail-header {
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 11px;
    border-bottom: 1px solid var(--nexus-accent-primary);
}
.regional-trade-detail-header>.nexus-entity-image { width: 64px; height: 68px; }
.regional-trade-detail-header h3 { font-size: 24px; }
.regional-trade-detail-content { min-height: 0; overflow: auto; display: grid; align-content: start; gap: 12px; padding-bottom: 12px; }

.regional-trade-ledger {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--nexus-border-subtle);
    border-radius: 2px;
    background: rgba(5, 9, 11, .62);
}
.regional-trade-section-heading h4 {
    margin: 0 0 3px;
    color: var(--nexus-accent-bright);
    font-size: 13px;
    text-transform: uppercase;
}
.regional-trade-ledger { display: grid; gap: 10px; }
.regional-trade-ledger-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 46%);
    align-items: end;
    gap: 18px;
}
.regional-trade-center-controls { display: flex; align-items: end; justify-content: flex-end; gap: 7px; }
.regional-trade-center-controls label { flex: 1; display: grid; gap: 4px; color: var(--nexus-text-secondary); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.regional-trade-center-controls select {
    width: 100%;
    height: 34px;
    margin: 0;
    border: 1px solid var(--nexus-border-subtle);
    border-radius: 2px;
    background: #080d0f;
    color: var(--nexus-text-primary);
    font-size: 12px;
}
.regional-trade-danger { border-color: rgba(190, 74, 78, .55) !important; color: #e59191 !important; }
.regional-trade-center-readonly { display: grid; justify-items: end; }
.regional-trade-center-readonly small { color: var(--nexus-text-muted); font-size: 11px; text-transform: uppercase; }
.regional-trade-center-readonly strong { color: var(--nexus-text-primary); font-size: 13px; }
.regional-trade-region-warning { margin: 0; padding: 8px 10px; border: 1px solid rgba(213, 154, 71, .45); background: rgba(93, 57, 19, .2); color: #e2ad68; font-size: 11px; }
.regional-trade-region-warning i { margin-right: 5px; }
.regional-trade-ledger-list { display: grid; gap: 7px; }
.regional-trade-ledger-row {
    display: grid;
    grid-template-columns: 245px 100px minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    width: 100%;
    height: auto;
    max-height: none;
    min-width: 0;
    min-height: 82px;
    margin: 0;
    padding: 9px 11px;
    border: 1px solid var(--nexus-border-subtle);
    border-radius: 2px;
    background: rgba(10, 16, 18, .78);
    color: var(--nexus-text-secondary);
    text-align: left;
    white-space: normal;
    overflow: visible;
}
button.regional-trade-ledger-row:hover { border-color: var(--nexus-border-strong); background: var(--nexus-accent-surface); }
.regional-trade-ledger-location { min-width: 0; display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; align-self: start; gap: 10px; }
.regional-trade-ledger-location>.nexus-entity-image { width: 56px; height: 60px; }
.regional-trade-ledger-location>span:last-child { min-width: 0; display: grid; }
.regional-trade-ledger-location strong,
.regional-trade-ledger-location small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.regional-trade-ledger-location strong { color: var(--nexus-text-primary); font-family: var(--nexus-font-heading, serif); font-size: 15px; }
.regional-trade-ledger-location small { color: var(--nexus-text-muted); font-size: 11px; }
.regional-trade-ledger-direction { display: grid; justify-items: center; align-self: start; gap: 3px; padding-top: 9px; color: var(--nexus-accent-primary); }
.regional-trade-ledger-direction>i { font-size: 21px; }
.regional-trade-ledger-direction>small { color: var(--nexus-accent-bright); font-size: 11px; font-weight: 800; text-align: center; text-transform: uppercase; }
.regional-trade-goods-gallery { min-width: 0; display: flex; flex-wrap: wrap; align-items: flex-start; align-content: flex-start; gap: 8px; }
.regional-trade-ledger-row>.regional-trade-goods-gallery { align-self: stretch; padding-bottom: 2px; }
.regional-trade-ledger-good {
    width: 64px;
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 4px;
    color: var(--nexus-text-secondary);
    text-align: center;
}
.regional-trade-ledger-good>.nexus-entity-image { width: 42px; height: 42px; }
.regional-trade-ledger-good>strong {
    width: 100%;
    color: var(--nexus-text-primary);
    font-size: 11px;
    line-height: 1.15;
    overflow-wrap: anywhere;
}
.regional-trade-ledger-row>i { align-self: center; color: var(--nexus-text-muted); font-size: 13px; }
.regional-trade-ledger-breakdown-title { margin: 2px 0 -1px; color: var(--nexus-text-secondary); font-size: 12px; text-transform: uppercase; }
.regional-trade-market-card { border-color: var(--nexus-border-strong); background: linear-gradient(145deg, var(--nexus-accent-surface), rgba(5, 9, 11, .78)); }
.regional-trade-market-groups { display: grid; grid-template-columns: minmax(230px, .65fr) minmax(0, 1.35fr); gap: 10px; }
.regional-trade-market-group { min-width: 0; padding: 10px; border: 1px solid var(--nexus-border-subtle); background: rgba(5, 9, 11, .58); }
.regional-trade-market-group>header { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 31px; margin-bottom: 9px; }
.regional-trade-market-group>header>div { min-width: 0; }
.regional-trade-market-group h5 { margin: 0; color: var(--nexus-accent-bright); font-size: 11px; text-transform: uppercase; }
.regional-trade-market-group header small { color: var(--nexus-text-muted); font-size: 10px; }
.regional-trade-ledger-good>em { color: var(--nexus-text-muted); font-size: 9px; font-style: normal; text-transform: uppercase; }
.regional-trade-ledger-good.is-local>em { color: var(--nexus-accent-bright); }
.regional-trade-ledger-good.is-supplied>.nexus-entity-image { opacity: .86; }
.regional-trade-empty-copy { align-self: center; color: var(--nexus-text-muted); font-size: 11px; font-style: normal; }
.regional-trade-ledger-empty {
    min-height: 70px;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 3px;
    color: var(--nexus-text-muted);
    text-align: center;
}
.regional-trade-ledger-empty>i { color: var(--nexus-accent-primary); font-size: 22px; }
.regional-trade-ledger-empty strong { color: var(--nexus-text-secondary); font-size: 13px; }
.regional-trade-ledger-empty span { font-size: 11px; }
.regional-trade-qualitative-note {
    margin: 0;
    padding-top: 9px;
    border-top: 1px solid var(--nexus-border-subtle);
    color: var(--nexus-text-muted);
    font-size: 11px;
    line-height: 1.35;
}
.regional-trade-qualitative-note i { margin-right: 5px; color: var(--nexus-accent-primary); }
.regional-trade-network-empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: 5px; padding: 24px; color: var(--nexus-text-muted); text-align: center; }
.regional-trade-network-empty>i { color: var(--nexus-accent-primary); font-size: 30px; }
.regional-trade-network-empty strong { color: var(--nexus-text-secondary); font-size: 14px; }
.regional-trade-network-empty span { font-size: 11px; }

.trade-goods-picker-shell {
    height: 100%;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    background: radial-gradient(circle at 15% 0, var(--nexus-accent-surface), transparent 34%), linear-gradient(145deg, rgba(14, 20, 22, .98), rgba(5, 8, 10, .99));
}
.trade-goods-picker-shell>header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px 11px; border-bottom: 1px solid var(--nexus-border-subtle); }
.trade-goods-picker-shell>header div>span { color: var(--nexus-accent-bright); font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.trade-goods-picker-shell>header h2 { margin: 2px 0; color: var(--nexus-text-primary); font-family: var(--nexus-font-heading, serif); font-size: 21px; }
.trade-goods-picker-shell>header p { margin: 0; color: var(--nexus-text-muted); font-size: 11px; }
.trade-goods-picker-shell>header>strong { flex: 0 0 auto; padding: 6px 9px; border: 1px solid var(--nexus-border-subtle); border-radius: 2px; color: var(--nexus-accent-bright); font-size: 11px; }
.trade-goods-picker-search { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; margin: 9px 12px 7px; border: 1px solid var(--nexus-border-subtle); border-radius: 2px; background: #070c0e; }
.trade-goods-picker-search>i { color: var(--nexus-text-muted); font-size: 11px; text-align: center; }
.trade-goods-picker-search>input { height: 32px; margin: 0; border: 0; background: transparent; color: var(--nexus-text-primary); font-size: 12px; }
.trade-goods-picker-list { min-height: 0; overflow: auto; display: grid; align-content: start; gap: 5px; padding: 3px 12px 9px; }
.trade-goods-picker-list>label { display: grid; grid-template-columns: 16px 40px minmax(0, 1fr) 18px; align-items: center; gap: 8px; min-width: 0; padding: 6px 8px; border: 1px solid var(--nexus-border-subtle); border-radius: 2px; background: rgba(10, 16, 18, .76); cursor: pointer; }
.trade-goods-picker-list>label:hover { border-color: var(--nexus-border-strong); background: var(--nexus-accent-surface); }
.trade-goods-picker-list>label:has(input:checked) { border-color: var(--nexus-border-strong); background: var(--nexus-accent-surface-strong); }
.trade-goods-picker-list input { width: 14px; height: 14px; margin: 0; accent-color: var(--nexus-accent-primary); }
.trade-goods-picker-list .nexus-entity-image { width: 39px; height: 39px; }
.trade-goods-picker-list label>span:nth-of-type(2) { min-width: 0; display: grid; }
.trade-goods-picker-list strong,
.trade-goods-picker-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trade-goods-picker-list strong { color: var(--nexus-text-primary); font-size: 12px; }
.trade-goods-picker-list small { color: var(--nexus-text-muted); font-size: 11px; }
.trade-goods-picker-list label>i { color: transparent; font-size: 11px; }
.trade-goods-picker-list label:has(input:checked)>i { color: var(--nexus-accent-bright); }
.trade-goods-picker-shell>footer { display: flex; justify-content: flex-end; gap: 7px; padding: 9px 12px; border-top: 1px solid var(--nexus-border-subtle); }
.trade-goods-picker-shell>footer button { width: auto; min-height: 31px; margin: 0; padding: 5px 11px; border: 1px solid var(--nexus-border-subtle); border-radius: 2px; background: var(--nexus-surface-interactive); color: var(--nexus-text-secondary); font-size: 11px; font-weight: 800; }
.trade-goods-picker-shell>footer button[data-action="applyTradeGoods"] { border-color: var(--nexus-border-strong); background: var(--nexus-accent-surface-strong); color: var(--nexus-accent-bright); }

@media (max-width: 1180px) {
    .regional-trade-network-workspace { grid-template-columns: 390px minmax(0, 1fr); }
    .regional-trade-ledger-row { grid-template-columns: 210px 82px minmax(0, 1fr) auto; }
}

@media (max-width: 900px) {
    .regional-trade-network-workspace { grid-template-columns: 340px minmax(0, 1fr); }
    .regional-trade-ledger-header { grid-template-columns: 1fr; }
    .regional-trade-market-groups { grid-template-columns: 1fr; }
    .regional-trade-ledger-row { grid-template-columns: 1fr; justify-items: start; }
    .regional-trade-ledger-direction { grid-auto-flow: column; align-items: center; padding-top: 0; }
    .regional-trade-ledger-row>i { grid-column: auto; }
}
