.history-heading { margin:30px 0; }
.history-heading h1 { margin-bottom:10px; }
.history-filters { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.history-filters label { display:flex; flex-direction:column; gap:6px; font-size:13px; font-weight:600; min-width:0; }
.history-filters input,.history-filters select,.history-filters button { width:100%; min-width:0; padding:11px; border:1px solid var(--line); border-radius:8px; background:white; color:var(--ink); font:inherit; }
.history-filters button { background:var(--brand); color:white; cursor:pointer; border-color:var(--brand); width:auto; }
.history-filters :is(input,select,button):focus-visible { outline:3px solid var(--brand); outline-offset:3px; }
.filter-actions { display:flex; align-items:center; gap:18px; grid-column:1/-1; flex-wrap:wrap; }
.filter-help { grid-column:1/-1; margin:0; }
.history-result-heading,.history-row { display:flex; justify-content:space-between; align-items:flex-start; gap:18px; }
.history-result-heading { margin:22px 0 12px; }
.history-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.history-lesson h2 { font-size:21px; margin:5px 0; }
.history-lesson h2 a { color:var(--ink); }
.history-lesson p { margin:6px 0; }
.history-lesson,.revision { min-width:0; overflow-wrap:anywhere; }
.revision-link { font-size:12px; flex-shrink:0; }
.selected-analysis { border-top:1px solid var(--line); padding-top:12px; }
.history-focus { font-size:14px; }
.history-lesson .insight-link { display:inline-block; margin-top:14px; font-size:13px; }
.pagination { display:flex; justify-content:center; gap:28px; margin:30px 0; }
.revision h2 { font-size:18px; }
@media(max-width:900px) { .history-list { grid-template-columns:1fr; } }
@media(max-width:600px) { .history-filters { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; } .search-field { grid-column:1/-1; } .history-filters label:has(select) { grid-column:1/-1; } .history-result-heading { flex-wrap:wrap; gap:0; } .pagination { gap:18px; font-size:13px; } }

/* History-only presentation. Revision pages and Lesson Insight retain their styles. */
.history-page { --bg:#f7f8fc; --ink:#172033; --muted:#626c85; --brand:#6046d6; --line:#e2e6ef; background:var(--bg); font-size:14px; }
.history-page .shell { max-width:1200px; padding:24px 28px 28px; }
.history-page .topbar { margin:0 0 28px; }
.history-page .brand-link { font-size:23px; letter-spacing:-.04em; }
.history-page .brand-mark { width:36px; height:36px; border-radius:10px; }
.history-page .import-link { display:inline-flex; align-items:center; min-height:38px; border:1px solid #d4cbee; background:#fff; padding:6px 14px; border-radius:8px; text-decoration:none; font-size:13px; font-weight:600; }
.history-page .history-heading { margin:0 0 22px; }
.history-page .history-heading .eyebrow { font-size:12px; margin:0 0 9px; }
.history-page .history-heading h1 { font-size:32px; font-weight:700; letter-spacing:-.035em; margin:0 0 6px; }
.history-page .history-heading>p:last-child { font-size:15px; margin:0; }
.history-icon { width:18px; height:18px; flex-shrink:0; }
.history-page .history-filters { display:flex; align-items:center; gap:8px; padding:10px; border:1px solid var(--line); border-radius:11px; background:#fff; position:relative; }
.history-page .history-filters label { font-weight:400; }
.history-page .search-field { flex:1 1 340px; display:flex; flex-direction:row; align-items:center; min-width:220px; gap:8px; padding-left:10px; background:#fafbfe; border:1px solid var(--line); border-radius:7px; }
.history-page .search-field input { width:100%; height:38px; padding:7px 6px 7px 0; font-size:13px; border:0; background:transparent; }
.history-page .history-filters input::placeholder { color:#68718a; opacity:1; }
.history-page .filter-select { display:flex; position:relative; flex-direction:row; align-items:center; flex:0 1 144px; min-width:106px; gap:0; }
.history-page .filter-select>.history-icon { position:absolute; left:10px; pointer-events:none; }
.history-page .filter-select select { height:40px; padding:7px 27px 7px 35px; font-size:13px; appearance:none; text-overflow:ellipsis; }
.history-page .select-chevron { position:absolute; right:10px; pointer-events:none; color:var(--muted); }
.history-page .is-active select,.history-page .date-filter.is-active>summary { background:#f6f3ff; border-color:#c9beef; color:#5137bc; }
.history-page .date-filter { flex:0 0 auto; }
.history-page .date-filter>summary { list-style:none; display:flex; align-items:center; gap:9px; min-height:40px; padding:7px 11px; border:1px solid var(--line); border-radius:7px; cursor:pointer; font-size:13px; }
.history-page .date-filter>summary::-webkit-details-marker { display:none; }
.history-page .date-panel { position:absolute; z-index:5; top:calc(100% + 8px); left:calc(34% - 10px); width:320px; max-width:calc(100% - 20px); padding:18px; border:1px solid var(--line); border-radius:10px; box-shadow:0 6px 24px #17203312; background:#fff; }
.history-page .date-panel h2 { font-size:14px; margin:0 0 12px; }
.history-page .date-panel label { margin:10px 0; font-size:12px; }
.history-page .date-panel input { height:38px; padding:7px 9px; }
.history-page .date-presets { display:flex; flex-wrap:wrap; gap:5px; }
.history-page .date-panel button { background:#fff; color:var(--brand); border:1px solid var(--line); border-radius:6px; font-size:12px; padding:7px 9px; min-height:36px; }
.history-page .date-actions { display:flex; justify-content:space-between; margin-top:14px; gap:10px; }
.history-page .date-actions [data-date-apply] { background:var(--brand); color:#fff; border-color:var(--brand); padding-inline:18px; }
.history-page .date-error { color:#a02a39; font-size:12px; }
.history-page .clear-filters { display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; min-height:36px; padding:0 10px; font-size:12px; text-decoration:none; white-space:nowrap; }
.history-page .clear-filters:hover,.history-page .revision-link:hover { text-decoration:underline; }
.history-page .history-result-heading { align-items:center; margin:26px 0 14px; font-size:14px; }
.history-page .history-result-heading p { margin:0; }
.history-page .history-sort { color:var(--muted); font-size:12px; }
.history-page .history-sort span { color:#414d69; }
.history-page .history-list { grid-template-columns:minmax(0,1fr); gap:14px; }
.history-page .history-lesson { display:grid; grid-template-columns:minmax(200px,.9fr) minmax(0,2.6fr); gap:28px; padding:22px 24px; border:1px solid var(--line); border-radius:12px; box-shadow:none; background:#fff; }
.history-page .lesson-identity { border-right:1px solid var(--line); padding-right:26px; min-width:0; }
.history-page .history-lesson .eyebrow { font-size:13px; margin:0 0 7px; letter-spacing:.02em; }
.history-page .history-lesson h2 { font-size:21px; margin:0 0 6px; line-height:1.4; }
.history-page .history-lesson h2 a { color:var(--ink); text-decoration:none; }
.history-page .history-lesson h2 a:hover { text-decoration:underline; }
.history-page .lesson-key { font-size:12px; color:var(--muted); }
.history-page .lesson-summary { position:relative; min-width:0; }
.history-page .selected-analysis { border:0; padding:0 95px 0 0; color:var(--muted); font-size:12px; margin:0 0 18px; overflow-wrap:anywhere; }
.history-page .revision-link { position:absolute; right:0; top:-7px; min-height:36px; display:flex; align-items:center; font-size:12px; text-underline-offset:3px; }
.history-page .lesson-counts { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:16px 0 12px; }
.history-page .lesson-counts strong { font-size:17px; margin-right:6px; }
.history-page .badge { padding:3px 9px; line-height:20px; font-size:12px; margin:0; border-radius:6px; font-weight:600; }
.history-page .badge.p1 { color:#6345ca; background:#f0ebff; }
.history-page .badge.p2 { color:#3371b0; background:#edf4fd; }
.history-page .badge.p3 { color:#626c80; background:#f0f2f6; }
.history-page .history-focus { display:flex; align-items:center; gap:12px; min-width:0; margin:10px 0 0; font-size:13px; color:#54607a; }
.history-page .history-focus>span:not(.more-count) { white-space:nowrap; text-overflow:ellipsis; overflow:hidden; }
.history-page .more-count { flex-shrink:0; white-space:nowrap; }
.history-page .skill-summary { font-size:12px; }
.history-page .pending-badge { font-size:9px; color:#706a60; background:#f5f3ed; padding:2px 4px; border-radius:4px; }
.history-page .history-lesson .insight-link { display:inline-flex; align-items:center; justify-content:space-between; gap:10px; min-height:38px; padding:7px 12px; margin-top:18px; font-size:12px; font-weight:600; border-radius:7px; text-decoration:none; background:#f1edff; color:#583dcc; }
.history-page .insight-link:hover { background:#e9e2ff; }
.history-page .pagination { align-items:center; gap:26px; margin:26px 0 18px; font-size:13px; }
.history-page .pagination>a,.history-page .pagination>span { display:flex; align-items:center; justify-content:center; min-height:36px; text-decoration:none; }
.history-page .pagination .current-page { min-width:36px; border-radius:8px; background:var(--brand); color:#fff; }
.history-page .page-footer { margin-top:12px; padding-top:8px; border:0; font-size:12px; }
.history-page .notice { font-size:13px; margin:40px 0 0; }
.history-page .empty { box-shadow:none; border-radius:12px; }
.history-page :is(a,button,input,select,summary):focus-visible { outline:3px solid #8063e0; outline-offset:3px; }
@media(max-width:1050px) {
  .history-page .history-filters { flex-wrap:wrap; }
  .history-page .search-field { flex-basis:100%; }
  .history-page .filter-select { flex:1; }
  .history-page .date-panel { left:10px; }
}
@media(max-width:650px) {
  .history-page .shell { padding:20px 16px; }
  .history-page .topbar { margin-bottom:24px; gap:12px; }
  .history-page .brand-link { font-size:21px; }
  .history-page .import-link { font-size:12px; padding:5px 9px; }
  .history-page .history-heading h1 { font-size:29px; }
  .history-page .history-heading>p:last-child { font-size:13px; }
  .history-page .history-filters { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .history-page .history-filters label:has(select) { grid-column:auto; }
  .history-page .search-field { grid-column:1/-1; min-width:0; }
  .history-page .filter-select { min-width:0; }
  .history-page .date-filter>summary { justify-content:space-between; }
  .history-page .clear-filters { grid-column:1/-1; justify-self:end; }
  .history-page .history-result-heading { gap:8px; margin-top:22px; align-items:flex-start; }
  .history-page .history-sort { font-size:11px; }
  .history-page .history-lesson { grid-template-columns:minmax(0,1fr); padding:20px; gap:18px; }
  .history-page .lesson-identity { padding:0 0 16px; border-right:0; border-bottom:1px solid var(--line); }
  .history-page .history-lesson h2 { font-size:20px; }
  .history-page .selected-analysis { font-size:11px; padding-right:80px; }
  .history-page .lesson-counts { gap:6px; }
  .history-page .lesson-counts strong { font-size:16px; flex-basis:100%; margin-bottom:3px; }
  .history-page .history-focus { gap:8px; font-size:12px; }
  .history-page .skill-summary { font-size:11px; }
}
