.history-source-hidden { display:none !important; }
.unified-history { margin:22px 0; }
.unified-history > summary { cursor:pointer; padding:18px; font-weight:600; }
.unified-history > summary::after { content:'⌄'; margin-left:auto; }
.unified-history:not([open]) > summary::after { content:'›'; }
.unified-history-body { padding:0 18px 18px; }
.unified-epoch { display:grid; grid-template-columns:1fr auto; gap:8px 16px; padding:18px 0; border-bottom:1px solid var(--border); font-size:13px; }
.unified-epoch > strong { font-size:20px; font-variant-numeric:tabular-nums; }
.unified-epoch [data-mood="gain"] { color:var(--success,#07886d); }
.unified-epoch [data-mood="loss"] { color:var(--danger,#c94058); }
.unified-epoch p { margin:0; color:var(--text-secondary); font-size:12px; }
.unified-epoch a { color:var(--accent); text-decoration:none; min-height:32px; }
.unified-epoch > p { align-self:center; }
.epoch-source-tools { display:flex; align-items:center; justify-content:flex-end; gap:2px; }
.epoch-source-tools > a { display:inline-flex; align-items:center; min-height:44px; }
.epoch-source-info { display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; padding:0; border:0; border-radius:50%; background:transparent; color:var(--text-secondary); font:inherit; font-size:18px; line-height:1; cursor:pointer; }
.epoch-source-info:hover,.epoch-source-info[aria-expanded="true"] { color:var(--accent); background:var(--bg-card); }
.epoch-source-info:focus-visible { outline:2px solid var(--accent); outline-offset:-5px; }
.epoch-source-glyph { display:inline-flex; align-items:center; justify-content:center; width:16px; height:16px; box-sizing:border-box; border:1px solid currentColor; border-radius:50%; font:600 11px/1 Arial,sans-serif; }
.epoch-source-help { position:fixed; z-index:1200; width:300px; max-width:calc(100vw - 24px); max-height:calc(100vh - 24px); overflow:auto; box-sizing:border-box; padding:16px; border:1px solid var(--border); border-radius:12px; background:var(--bg-card,#fff); color:var(--text-primary,#222); box-shadow:0 8px 32px #0002; font-size:12px; line-height:1.5; }
.epoch-source-help[hidden] { display:none; }
.epoch-source-help > strong { font-size:13px; }
.epoch-source-help > p { margin:8px 0 0; }
.epoch-source-help > code { display:block; margin-top:10px; white-space:pre-line; overflow-wrap:anywhere; color:var(--text-primary,#222); font-size:12px; }
.unified-epoch-detail { grid-column:1/-1; }
.epoch-annual { display:flex; align-items:center; gap:2px; grid-column:1/-1; color:var(--text-secondary); font-size:11px; line-height:1.5; }
.epoch-annual[hidden] { display:none; }
.epoch-annual .epoch-source-info { flex:0 0 44px; }
.unified-history #epoch-history-refresh { margin-top:18px; min-height:44px; }
/* Compact plan rows only. Keep the full app and independent forks unchanged. */
body.eiko-plan #epoch-history { margin:12px 0; }
body.eiko-plan #epoch-history > summary { padding:10px 0; min-height:44px; }
body.eiko-plan #epoch-history .unified-history-body { padding:0; }
.unified-epoch-compact { grid-template-areas:'date result' 'benchmark pace' 'footer footer'; gap:0 12px; padding:8px 0; }
.unified-epoch-compact > time { grid-area:date; align-self:center; }
.unified-epoch-compact > strong { grid-area:result; justify-self:end; line-height:1.3; }
.unified-epoch-compact > p { grid-area:benchmark; }
.unified-epoch-compact > .epoch-annual { grid-area:pace; }
.unified-epoch-compact > .epoch-footer { grid-area:footer; position:relative; min-height:44px; }
.epoch-footer > .epoch-source-tools { position:absolute; inset-inline-end:0; top:0; }
.epoch-footer .accum-breakdown { margin:0; padding:0; border:0; }
.epoch-footer .accum-breakdown > summary { display:flex; align-items:center; min-height:44px; box-sizing:border-box; width:calc(100% - 120px); padding:0; }
.epoch-footer .accum-breakdown[open] { padding-bottom:8px; }
@media(max-width:800px) {
 .unified-epoch-compact { grid-template-areas:'date result' 'benchmark benchmark' 'pace pace' 'footer footer'; }
}
.plan-replay { padding:16px; margin:0 0 22px; border:1px solid var(--border); border-radius:14px; background:var(--bg-card); }
.plan-replay > summary { cursor:pointer; font-size:14px; min-height:28px; }
.plan-replay label { display:block; margin:14px 0 6px; font-size:12px; color:var(--text-secondary); }
.plan-replay input,.plan-replay select { display:block; width:100%; box-sizing:border-box; min-height:44px; padding:10px; border:1px solid var(--border); border-radius:8px; background:var(--bg-primary); color:var(--text-primary); font:inherit; }
.plan-replay button { margin-top:12px; }
.plan-replay small { display:block; margin-top:12px; color:var(--text-secondary); font-size:11px; line-height:1.5; }
#plan-replay-output p { display:flex; align-items:baseline; justify-content:space-between; gap:12px; font-size:13px; margin:14px 0; }
#plan-replay-output strong { text-align:right; overflow-wrap:anywhere; }
#plan-budget-status { font-size:12px; color:var(--text-secondary); line-height:1.6; }
