/* Existing history controls and canvas hooks, in the Seafoam Camellia palette. */
.history-app-header { position: sticky; z-index: 20; top: 0; color: var(--ink); }
.history-app-header-inner { display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; align-items: center; width: min(760px, 100%); min-height: 56px; margin-inline: auto; padding: 4px 12px; border-bottom: 4px solid var(--teal); background: var(--paper); }
.history-app-header strong { overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; }
.history-back { display: flex; min-height: 44px; align-items: center; font-size: 14px; }
.history-page-shell { width: min(760px, 100%); min-height: calc(100vh - 140px); margin: 0 auto; background: var(--paper); }
.history-filter-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); min-height: 48px; border-bottom: 1px solid var(--line); }
.history-filter-row > strong { display: grid; place-items: center; background: var(--yellow); font-size: 14px; }
.history-chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; }
.history-condition-chips { min-width: 0; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-inline: contain; }
.history-condition-group { display: none; }
[data-history-trend="sx"] [data-history-condition-group="sx"],
[data-history-trend="wx"] [data-history-condition-group="wx"],
[data-history-trend="tail"] [data-history-condition-group="tail"] { display: contents; }
.history-chip { display: inline-flex; flex: none; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 3px; background: var(--paper); color: var(--ink); font-size: 14px; }
.history-chip:hover { border-color: var(--rose); }
.history-chip.is-active { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.history-log-card { margin-top: 14px; }
.history-log-scroll { overflow-x: auto; overscroll-behavior-inline: contain; }
.history-log-list { min-width: 344px; font-variant-numeric: tabular-nums; }
.history-log-header, .history-log-row { display: grid; grid-template-columns: minmax(62px, 1.18fr) repeat(7, minmax(40px, 1fr)); }
.history-log-header { min-height: 42px; border-bottom: 3px solid var(--rose); background: var(--yellow); }
.history-log-heading { display: grid; place-items: center; padding: 7px 2px; border-right: 1px solid var(--line); font-size: 12px; white-space: nowrap; }
.history-log-body { position: relative; }
.history-log-row { min-height: 66px; border-bottom: 1px solid var(--line); }
.history-issue-cell, .history-ball-cell { position: relative; z-index: 2; display: grid; align-content: center; justify-items: center; min-width: 0; padding: 6px 2px; border-right: 1px solid var(--line); }
.history-issue-cell { background: var(--surface); }
.history-issue-cell strong { font-size: 12px; white-space: nowrap; }
.history-special-heading, .history-ball-cell.is-special-cell { border-left: 2px solid var(--rose); }
.history-ball { display: grid; width: clamp(27px, 7.4vw, 34px); aspect-ratio: 1; place-items: center; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 750; }
.history-ball-red { background: var(--ball-red); color: #000; }
.history-ball-green { background: var(--ball-green); color: #101010; }
.history-ball-blue { background: var(--ball-blue); color: #fff; }
.history-ball-cell small { margin-top: 3px; font-size: 11px; line-height: 1.1; white-space: nowrap; }
.history-ball.is-trend-match { outline: 3px solid var(--ink); outline-offset: 2px; }
.history-trend-canvas { position: absolute; z-index: 1; inset: 0 auto auto 0; pointer-events: none; }
.history-empty { display: grid; min-height: 160px; place-items: center; color: var(--muted); }
.history-load-zone { padding: 12px; text-align: center; }
.history-load-more { width: 100%; min-height: 40px; border: 0; background: var(--teal); color: var(--ink); }
.history-load-more:disabled { cursor: wait; opacity: .6; }
.history-load-status { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.history-pagination { display: flex; justify-content: center; gap: 16px; padding: 12px; }
.history-page-shell.is-enhanced .history-pagination { display: none; }
.history-footer { width: min(760px, 100%); margin-inline: auto; padding: 24px 12px; border-top: 1px solid var(--ink); background: var(--paper); color: var(--ink); text-align: center; font-size: 12px; }
