/* Shared journal, latest-event strip and focus detail accents. */
#battleJournal { background: #20191d; color: #f3ede1; border-color: #a78b54; }
#battleJournal .journal-tabs button[aria-pressed="true"] { color: #f3ede1; box-shadow: inset 0 -2px #b99a5e; background: #642b35; }
#battleJournal #journalSummary { color: #c4b6a5; }
.battle-timeline { padding: 4px 8px 16px 0; font: 14px/1.55 system-ui, sans-serif; letter-spacing: 0; }
.timeline-turn { padding: 0 0 14px; }
#battleJournal .timeline-turn-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 8px 0 4px; padding: 7px 0; border-bottom: 1px solid #a78b545e; color: #e1c991; font-size: 14px; line-height: 1.5; }
.timeline-count { flex-shrink: 0; color: #b9aca2; font: 12px/1.5 system-ui, sans-serif; }
.timeline-events { margin: 0 0 0 11px; padding: 0 0 0 15px; list-style: none; border-left: 1px solid #a78b5466; }
.timeline-event { position: relative; min-width: 0; padding: 3px 0; border-bottom: 1px solid #f3ede115; }
.timeline-event::before { content: ""; position: absolute; left: -18px; top: 20px; width: 5px; height: 5px; box-sizing: border-box; border-radius: 50%; background: #a78b54; border: 1px solid #c1a778; }
.timeline-kind-attack::before, .timeline-kind-damage::before { background: #8e3e4c; }
.timeline-detail { min-width: 0; }
.timeline-event-summary { display: grid; grid-template-columns: 64px minmax(0, 1fr) 16px; align-items: start; gap: 8px; padding: 9px 3px; cursor: pointer; list-style: none; border-radius: 3px; font-weight: 400; }
.timeline-event-summary::-webkit-details-marker { display: none; }
.timeline-event-summary:hover { background: #f3ede108; }
.timeline-event-summary:focus-visible, .timeline-card-link:focus-visible, .battle-latest-control:focus-visible { outline: 2px solid #ddbd74; outline-offset: 2px; }
.timeline-category { display: flex; align-items: center; gap: 5px; color: #d6bb84; font-size: 12px; line-height: 22px; }
.timeline-category svg, .timeline-chevron, .battle-latest-control svg { display: block; width: 16px; height: 16px; flex: 0 0 16px; margin-top: 3px; }
.timeline-kind-attack .timeline-category, .timeline-kind-damage .timeline-category { color: #e4a1a7; }
.timeline-kind-heal .timeline-category { color: #a5cec2; }
.timeline-kind-draw .timeline-category { color: #adc9d6; }
.timeline-excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; color: #f3ede1; }
.timeline-chevron { color: #b8a17a; }
.timeline-detail[open] .timeline-chevron { transform: rotate(90deg); }
.timeline-detail[open] .timeline-excerpt { -webkit-line-clamp: 1; color: #c6bdb4; }
.timeline-full-text { margin: 2px 5px 12px 75px; color: #fff8eb; white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline-card-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 3px 12px 75px; }
#battleJournal .timeline-card-link { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; padding: 0 8px 0 0; border: 1px solid #a78b545e; border-radius: 4px; background: #302328; color: #f3ede1; text-align: left; font: 12px/1.5 system-ui, sans-serif; letter-spacing: 0; box-shadow: none; }
#battleJournal button.timeline-card-link:hover { background: #512b34; border-color: #d5b676; }
.timeline-card-art { display: grid; place-items: center; position: relative; overflow: hidden; width: 40px; height: 52px; flex: 0 0 40px; background: #161519; color: #b99a5e; }
.timeline-card-art svg { width: 20px; height: 20px; }
.timeline-card-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.timeline-card-caption { min-width: 0; overflow-wrap: anywhere; }
.battle-latest-events { list-style: none; margin: 0; padding: 0; }
/* Parent supplies --battle-latest-bottom to clear its hand and action controls. */
.battle-latest-strip { position: absolute; left: 48%; bottom: var(--battle-latest-bottom, 184px); transform: translateX(-50%); width: min(320px, 30%); max-height: 102px; overflow: hidden; z-index: 8; padding: 3px 9px; border-block: 1px solid #b99a5e66; background: #21171ce8; }
.battle-latest-event { padding: 0; margin: 0; }
.battle-latest-control { display: flex; align-items: start; width: 100%; min-width: 0; gap: 7px; padding: 6px 0; background: transparent; border: 0; border-bottom: 1px solid #ad92543d; border-radius: 0; color: #eee5d7; text-align: left; font: 12px/1.5 system-ui, sans-serif; letter-spacing: 0; }
.battle-latest-control svg { color: #c4a467; }
.battle-latest-control span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.battle-card-status { margin-top: 10px; padding-top: 8px; border-top: 1px solid #b89a6159; color: #eee5d7; font: 12px/1.6 system-ui, sans-serif; letter-spacing: 0; }
.battle-card-status h3 { margin: 0 0 6px; color: #dbc18c; font-size: 12px; line-height: 1.5; }
.card-status-stats { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 10px; margin: 0; }
.card-status-stats dt { color: #c9bda9; }
.card-status-stats dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.card-status-evolved { margin: 5px 0; color: #dcc18a; }
.card-status-modifiers { list-style: none; margin: 6px 0 0; padding: 0; }
.card-status-modifiers li { padding: 3px 0; overflow-wrap: anywhere; }
.card-status-modifiers .is-temporary { color: #acd0d8; }
.card-status-modifiers .is-inactive { color: #d7a4a8; }
@media (max-width: 600px) {
  .battle-timeline { font-size: 13px; padding-right: 3px; }
  .timeline-event-summary { grid-template-columns: 55px minmax(0, 1fr) 14px; gap: 5px; }
  .timeline-full-text, .timeline-card-links { margin-left: 4px; }
  .timeline-card-links { gap: 6px; }
  .timeline-events { padding-left: 12px; margin-left: 4px; }
  .timeline-event::before { left: -15px; }
}
@media (max-width: 1050px), (max-height: 600px) { .battle-latest-strip { display: none; } }
@media (max-height: 500px) {
  .theme-feijin #battleJournal { padding: 10px 12px; max-height: calc(100dvh - 16px); }
  #battleJournal > header h2 { font-size: 18px; line-height: 1.3; }
  .theme-feijin #battleJournal > header .collection-icon { width: 30px; height: 30px; min-height: 30px; flex-basis: 30px; padding: 6px; }
  #battleJournal .journal-tabs { gap: 4px; margin: 5px 0; padding-bottom: 4px; }
  #battleJournal .journal-tabs button { min-height: 28px; padding: 4px 8px; font-size: 12px; line-height: 18px; }
  #battleJournal #journalSearch { min-height: 28px; height: 28px; padding: 3px 8px; font-size: 12px; }
  #battleJournal #journalSummary { min-height: 18px; font-size: 11px; line-height: 18px; }
  #battleJournal #journalContent { max-height: calc(100dvh - 154px); }
  #battleJournal .timeline-turn-heading { margin-top: 3px; padding: 4px 0; }
  .timeline-event-summary { padding-block: 6px; }
}
