/* Regional Chronicle reader */
.augur-region-chronicle-app {
    --chronicle-ink: var(--nexus-text-primary);
    --chronicle-muted: var(--nexus-text-muted);
    --chronicle-rule: var(--nexus-border-subtle);
    --chronicle-paper: var(--nexus-surface-raised);
    --chronicle-paper-deep: var(--nexus-surface-base);
    --chronicle-gold: var(--nexus-accent-bright);
    --chronicle-control: #111617;
    --chronicle-control-hover: #1d2425;
    --chronicle-control-border: color-mix(in srgb, var(--nexus-accent-primary) 16%, rgba(190, 199, 196, .14));
}

.augur-region-chronicle-app .window-header {
    border-bottom: 0;
    background: #090c0d;
    color: var(--chronicle-ink);
}

.augur-region-chronicle-app .window-content {
    height: 100%;
    padding: 0;
    overflow: hidden;
    background: var(--chronicle-paper-deep);
    color: var(--chronicle-ink);
}

.augur-region-chronicle-app .chronicle-ledger {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    background:
        radial-gradient(circle at 18% 6%, var(--nexus-accent-surface), transparent 30%),
        linear-gradient(145deg, rgba(15, 21, 23, .98), rgba(6, 10, 12, .99));
    font-family: var(--nexus-body-font);
}

.chronicle-ledger__masthead {
    padding: 18px 26px 14px;
    border-bottom: 1px solid var(--nexus-border-strong);
    background: rgba(8, 12, 14, .72);
    text-align: center;
}

.chronicle-ledger__rule {
    display: grid;
    grid-template-columns: minmax(24px, 1fr) auto minmax(24px, 1fr);
    align-items: center;
    gap: 10px;
    max-width: 540px;
    margin: 0 auto 5px;
    color: var(--chronicle-gold);
    font-size: 8px;
}

.chronicle-ledger__rule::before,
.chronicle-ledger__rule::after {
    content: "";
    height: 1px;
    background-color: var(--chronicle-rule);
}

.chronicle-ledger__kicker {
    margin: 0;
    color: var(--chronicle-gold);
    font-family: var(--nexus-heading-font);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.chronicle-ledger__masthead h1 {
    margin: 2px 0 3px;
    border: 0;
    color: var(--chronicle-ink);
    font-family: var(--nexus-heading-font);
    font-size: 30px;
    font-variant: small-caps;
    letter-spacing: 0.035em;
    line-height: 1.05;
}

.chronicle-ledger__subtitle {
    margin: 0;
    color: var(--nexus-text-secondary);
    font-family: var(--nexus-heading-font);
    font-style: italic;
}

.chronicle-ledger__summary {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px auto 0;
    padding: 0;
}

.chronicle-ledger__summary > div {
    display: grid;
    grid-template-columns: auto auto;
    align-items: baseline;
    gap: 7px;
    min-width: 118px;
    padding: 6px 10px;
    border: 1px solid var(--chronicle-control-border);
    border-radius: 2px;
    background: rgba(7, 12, 14, .82);
}

.chronicle-ledger__summary dt {
    color: var(--chronicle-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.chronicle-ledger__summary dt i {
    color: var(--chronicle-gold);
}

.chronicle-ledger__summary dd {
    margin: 0;
    color: var(--chronicle-ink);
    font-family: var(--nexus-heading-font);
    font-size: 17px;
    font-weight: 700;
}


.chronicle-ledger__filters {
    display: grid;
    grid-template-columns: minmax(190px, 1.5fr) repeat(5, minmax(112px, 1fr)) 82px 82px auto;
    align-items: end;
    gap: 7px;
    padding: 9px 12px 8px;
    border-bottom: 1px solid var(--chronicle-rule);
    background: rgba(7, 12, 14, .9);
}

.chronicle-ledger__filters label {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.chronicle-ledger__filters label > span:first-child {
    color: var(--chronicle-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.chronicle-ledger__filters input,
.chronicle-ledger__filters select,
.chronicle-ledger__filters button {
    height: 30px;
    min-width: 0;
    border: 1px solid var(--chronicle-control-border);
    border-radius: 2px;
    background: var(--chronicle-control);
    color: var(--chronicle-ink);
}

.chronicle-ledger__filters input:focus,
.chronicle-ledger__filters select:focus {
    border-color: var(--nexus-border-strong);
    background: var(--chronicle-control-hover);
    box-shadow: var(--nexus-focus-ring);
    outline: none;
}

.chronicle-ledger__input-wrap {
    position: relative;
    display: block;
}

.chronicle-ledger__input-wrap i {
    position: absolute;
    top: 9px;
    left: 9px;
    color: var(--chronicle-muted);
    pointer-events: none;
}

.chronicle-ledger__input-wrap input {
    width: 100%;
    padding-left: 29px;
}

.chronicle-ledger__filters button {
    padding: 0 10px;
    color: var(--nexus-text-secondary);
    white-space: nowrap;
}

.chronicle-ledger__filters button:not(:disabled):hover {
    border-color: var(--nexus-border-strong);
    background: var(--chronicle-control-hover);
    color: var(--nexus-accent-bright);
    box-shadow: var(--nexus-focus-ring);
}

.chronicle-ledger__filters select option {
    background: var(--nexus-surface-panel);
    color: var(--nexus-text-primary);
}

.chronicle-ledger__filters select option:checked,
.chronicle-ledger__filters select option:hover,
.chronicle-ledger__filters select option:focus {
    background: var(--nexus-accent-surface-strong);
    box-shadow: 0 0 0 100px var(--nexus-accent-surface-strong) inset;
    color: var(--nexus-accent-bright);
}

.chronicle-ledger__result-count {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--chronicle-muted);
    font-size: 11px;
    text-align: right;
}

.chronicle-ledger__result-count strong {
    color: var(--chronicle-ink);
}

.chronicle-ledger__record {
    min-height: 0;
    overflow-y: auto;
    padding: 12px 18px 28px;
    background: transparent;
    scrollbar-color: var(--nexus-border-strong) transparent;
}

.chronicle-year {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 14px;
    max-width: 920px;
    margin: 0 auto 15px;
}

.chronicle-year__heading {
    display: grid;
    grid-template-rows: 1fr auto 1fr;
    justify-items: center;
    align-items: center;
    min-height: 110px;
    color: var(--chronicle-gold);
}

.chronicle-year__heading > span {
    width: 1px;
    height: 100%;
    background-color: var(--chronicle-rule);
}

.chronicle-year__heading h2 {
    min-width: 66px;
    margin: 7px 0;
    padding: 7px 5px 6px;
    border: 1px solid var(--nexus-border-strong);
    border-radius: 2px;
    background: var(--nexus-accent-surface);
    color: var(--chronicle-ink);
    font-family: var(--nexus-heading-font);
    font-size: 21px;
    line-height: 1;
    text-align: center;
}

.chronicle-year__heading small {
    display: block;
    margin-bottom: 2px;
    color: var(--chronicle-muted);
    font-size: 8px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.chronicle-year__events {
    display: grid;
    gap: 8px;
}

.chronicle-event {
    display: grid;
    grid-template-columns: minmax(96px, 155px) minmax(0, 1fr);
    gap: 12px;
    min-height: 94px;
    padding: 10px 12px 10px 9px;
    border: 1px solid var(--nexus-border-subtle);
    border-left: 4px solid var(--augur-chronicle-event-accent, var(--nexus-accent-primary));
    border-radius: 2px;
    background: linear-gradient(145deg, rgba(15, 21, 23, .94), rgba(7, 11, 13, .96));
    box-shadow: var(--nexus-shadow-panel);
}

.chronicle-event__participants {
    display: flex;
    align-content: flex-start;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    padding-right: 10px;
    border-right: 1px solid var(--chronicle-rule);
}

.chronicle-participant {
    display: grid;
    justify-items: center;
    gap: 3px;
    width: 62px;
    margin: 0;
    padding: 3px;
    border: 0;
    background: transparent;
    color: var(--nexus-text-secondary);
    font-size: 9px;
    line-height: 1.1;
    text-align: center;
}

button.chronicle-participant {
    height: auto;
    border-radius: 2px;
    cursor: pointer;
}

button.chronicle-participant:hover {
    color: var(--chronicle-ink);
    background: var(--nexus-accent-surface);
    text-shadow: none;
}

.chronicle-participant img,
.chronicle-participant > i {
    width: 40px;
    height: 40px;
    border: 1px solid var(--nexus-border-subtle);
    border-radius: 2px;
    object-fit: cover;
}

.chronicle-participant > i {
    display: grid;
    place-items: center;
    color: var(--nexus-accent-bright);
    font-size: 22px;
}

.chronicle-participant--location img {
    border-radius: 2px;
}

.chronicle-event__body {
    align-self: center;
    min-width: 0;
}

.chronicle-event__type {
    margin: 0 0 4px;
    color: color-mix(in srgb, var(--augur-chronicle-event-accent, var(--nexus-accent-primary)) 72%, var(--nexus-text-primary));
    font-family: var(--nexus-heading-font);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.chronicle-event__message {
    margin: 0;
    color: var(--chronicle-ink);
    font-family: var(--nexus-body-font);
    font-size: 13px;
    line-height: 1.35;
}

.chronicle-event__goods {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
}

.chronicle-event__goods > span {
    margin-right: 2px;
    color: var(--chronicle-muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chronicle-event__goods img {
    width: 30px;
    height: 30px;
    border: 1px solid var(--nexus-border-subtle);
    border-radius: 2px;
    background-color: var(--nexus-surface-base);
    object-fit: cover;
}

.chronicle-ledger__empty {
    display: grid;
    place-items: center;
    align-content: center;
    min-height: 260px;
    padding: 30px;
    color: var(--chronicle-muted);
    text-align: center;
}

.chronicle-ledger__empty > i {
    color: var(--chronicle-gold);
    font-size: 34px;
}

.chronicle-ledger__empty h2 {
    margin: 10px 0 2px;
    border: 0;
    color: var(--chronicle-ink);
    font-family: var(--nexus-heading-font);
}

.chronicle-ledger__empty p {
    margin: 0;
}

@media (max-width: 1000px) {
    .chronicle-ledger__filters {
        grid-template-columns: minmax(190px, 2fr) repeat(3, minmax(120px, 1fr));
    }

    .chronicle-ledger__year-filter {
        max-width: none;
    }
}

@media (max-width: 720px) {
    .chronicle-ledger__filters {
        grid-template-columns: 1fr 1fr;
    }

    .chronicle-ledger__search {
        grid-column: 1 / -1;
    }

    .chronicle-year {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 8px;
    }

    .chronicle-event {
        grid-template-columns: 1fr;
    }

    .chronicle-event__participants {
        justify-content: flex-start;
        padding: 0 0 7px;
        border-right: 0;
        border-bottom: 1px solid var(--chronicle-rule);
    }
}
/* Entity Chronicle tabs reuse the regional record without turning dossiers into a second history store. */
.entity-dossier-chronicle,
.location-embedded-chronicle {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 10px;
    overflow: hidden;
}

.entity-chronicle-panel {
    --chronicle-ink: var(--nexus-text-primary);
    --chronicle-muted: var(--nexus-text-muted);
    --chronicle-rule: var(--nexus-border-subtle);
    --chronicle-paper: var(--nexus-surface-raised);
    --chronicle-paper-deep: var(--nexus-surface-base);
    --chronicle-gold: var(--nexus-accent-bright);
    --chronicle-control: #111617;
    --chronicle-control-hover: #1d2425;
    --chronicle-control-border: color-mix(in srgb, var(--nexus-accent-primary) 16%, rgba(190, 199, 196, .14));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    border: 0;
    background: transparent;
    color: var(--chronicle-ink);
}

.entity-chronicle-panel__tools {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 0 8px;
    border: 0;
    background: transparent;
}

.entity-chronicle-panel__tools label {
    min-width: 0;
}

.entity-chronicle-panel__tools select,
.entity-chronicle-panel__tools button {
    height: 28px;
    min-width: 0;
    border: 1px solid var(--chronicle-control-border);
    border-radius: 2px;
    background: var(--chronicle-control);
    color: var(--chronicle-ink);
}

.entity-chronicle-panel__tools select:hover,
.entity-chronicle-panel__tools button:hover {
    border-color: var(--nexus-border-strong);
    background: var(--chronicle-control-hover);
}

.entity-chronicle-panel__tools select:focus {
    border-color: var(--nexus-accent-primary);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--nexus-accent-primary) 28%, transparent);
    outline: none;
}

.entity-chronicle-panel__tools button {
    width: 29px;
    padding: 0;
}

.entity-chronicle-panel__tools button:disabled {
    opacity: .4;
    cursor: default;
}

.entity-chronicle-panel__type-filter {
    width: min(150px, 45%);
    margin-left: auto;
}

.entity-chronicle-panel__type-filter select {
    width: 100%;
}

.entity-chronicle-panel__scroll {
    min-height: 0;
    overflow-y: auto;
    padding: 0 3px 18px 0;
    scrollbar-color: var(--nexus-accent-primary) var(--chronicle-paper-deep);
}

.entity-chronicle-panel__tools .entity-chronicle-panel__open-full {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: auto;
    flex: 0 0 auto;
    padding: 0 8px;
    font-size: 10px;
    white-space: nowrap;
}

.entity-chronicle-panel__open-full:hover,
.entity-chronicle-region__heading button:hover {
    border-color: var(--nexus-accent-primary);
    background: var(--chronicle-control-hover);
    color: var(--chronicle-gold);
}

.entity-chronicle-region + .entity-chronicle-region {
    margin-top: 13px;
    padding-top: 11px;
    border-top: 0;
}

.entity-chronicle-region__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 3px 8px;
    color: var(--chronicle-ink);
    font-family: var(--nexus-heading-font);
}

.entity-chronicle-region__heading i {
    margin-right: 5px;
    color: var(--chronicle-gold);
}

.entity-chronicle-region__heading button {
    width: 27px;
    height: 25px;
    border: 1px solid var(--chronicle-control-border);
    border-radius: 2px;
    background: var(--chronicle-control);
    color: var(--chronicle-muted);
    padding: 0;
}

.chronicle-event-list.is-compact .chronicle-year {
    display: block;
    max-width: none;
    margin-bottom: 10px;
}

.chronicle-event-list.is-compact .chronicle-year__heading {
    display: none;
}

.chronicle-event-list.is-compact .chronicle-year__events {
    gap: 6px;
}

.chronicle-event-list.is-compact .chronicle-event {
    display: block;
    min-height: 0;
    padding: 8px;
    border-left-width: 4px;
}

.chronicle-event-list.is-compact .chronicle-event__year {
    margin: 0 0 7px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--chronicle-rule);
    color: var(--chronicle-gold);
    font-family: var(--nexus-heading-font);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.chronicle-event-list.is-compact .chronicle-event__participants {
    justify-content: flex-start;
    gap: 4px;
    margin-bottom: 7px;
    padding: 0 0 6px;
    border: 0;
    border-bottom: 1px solid var(--chronicle-rule);
}

.chronicle-event-list.is-compact .chronicle-participant {
    width: 52px;
    font-size: 8px;
}

.chronicle-event-list.is-compact .chronicle-participant img,
.chronicle-event-list.is-compact .chronicle-participant > i {
    width: 32px;
    height: 32px;
}

.chronicle-event-list.is-compact .chronicle-event__type {
    font-size: 9px;
}

.chronicle-event-list.is-compact .chronicle-event__message {
    font-size: 13px;
    line-height: 1.3;
}

.chronicle-event-list.is-compact .chronicle-event__goods img {
    width: 25px;
    height: 25px;
}

.chronicle-event-list.is-compact .chronicle-event-list__empty {
    min-height: 210px;
    padding: 20px 10px;
}
