/* History screen (#/history, js/history.js). Ported from docs/design/claude-design/ui_kits/app/ScreensMore.jsx HistoryScreen. */
.gct-history { display: flex; flex-direction: column; }
.gct-history [hidden] { display: none !important; }
.gct-history__head { order: -1; margin-bottom: 24px; } /* desktop: page head above the scope note */
.gct-history__head .gct-page-title { margin: 0; }
.gct-history__sub { margin-top: 4px; font: 600 14px/1.4 var(--font-sans); color: var(--fg-secondary); }
.gct-history__anon { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 20px; }
.gct-history__anon p { margin: 0; font: 700 15px/1.4 var(--font-sans); }
.gct-history__anon .gct-btn { text-decoration: none; }
.gct-history__caption { margin-bottom: 14px; font: 700 12px/1 var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-muted); }
.gct-history__upcoming { padding: 20px; margin-bottom: 20px; --histo-h: 64px; }

.gct-history__controls { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.gct-history__pills { display: flex; flex-wrap: wrap; gap: 8px; }
.gct-history__sort { display: flex; align-items: center; gap: 4px; font: 600 13px/1 var(--font-sans); color: var(--fg-muted); }
.gct-history__sort button { height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; font: 700 13px/1 var(--font-sans); color: var(--fg-secondary); cursor: pointer; }
.gct-history__sort button[aria-pressed="true"] { background: var(--color-orange-tint); color: var(--color-orange-dark); }
.gct-history__dir:not(:empty) { margin-left: 4px; }

.gct-history__list { overflow: hidden; }
.gct-history__empty { padding: 32px; text-align: center; font-weight: 600; color: var(--fg-muted); }
.gct-history__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; padding: 16px 20px; border-top: 1px solid var(--color-border); }
.gct-history__row:first-child { border-top: 0; }
.gct-history__de { font: 700 16px/1.4 var(--font-sans); text-wrap: pretty; }
.gct-history__en { margin-top: 2px; font-size: 14px; color: var(--fg-muted); }
.gct-history__actions { display: flex; align-items: flex-start; gap: 2px; }
.gct-history__fav[aria-pressed="true"] { color: var(--color-warning-dot); background: var(--color-warning-bg); border-color: var(--color-warning-border); }
.gct-history__foot { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 4px; font: 600 13px/1.3 var(--font-sans); color: var(--fg-muted); }
.gct-history__where { min-width: 0; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gct-history__grow { flex: 1; }
.gct-history__nums { display: flex; gap: 10px; font-variant-numeric: tabular-nums; }
.gct-history__hint { display: inline-flex; align-items: center; gap: 3px; }
.gct-history__pct { width: 40px; text-align: right; font-weight: 800; }
.gct-history__pct.is-good { color: var(--color-success); }
.gct-history__pct.is-mid { color: var(--fg-secondary); }
.gct-history__pct.is-bad { color: var(--color-danger); }
.gct-history__more { display: flex; margin: 16px auto 0; }

@media (max-width: 759px) {
    .gct-history__head { order: 0; margin-bottom: 18px; } /* the scope bar stays first */
    .gct-history__upcoming { padding: 16px; --histo-h: 44px; }
    .gct-history__pills { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px; max-width: calc(100% + 32px); }
    .gct-history__pills .gct-pill { flex: none; }
    .gct-history__row { padding: 14px; }
    .gct-history__actions .gct-icon-btn { width: 44px; height: 44px; }
    .gct-history__where { max-width: 200px; }
}
