/* FingerWPM personal typing history. */
.history-section{width:min(1120px,100%);margin:48px auto 20px;padding:32px 0 10px;border-top:1px solid var(--line);color:var(--text);scroll-margin-top:92px}
.history-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:20px}
.history-kicker{display:block;margin-bottom:6px;color:var(--accent);font-size:11px;font-weight:800;letter-spacing:.11em;text-transform:uppercase}
.history-head h2{margin:0;color:var(--text);font-size:clamp(24px,3vw,32px);line-height:1.2;letter-spacing:-.03em}
.history-head p{margin:8px 0 0;max-width:720px;color:var(--muted);font-size:13px;line-height:1.55}
.history-refresh{min-height:38px;padding:0 13px;border:1px solid var(--line);border-radius:9px;background:transparent;color:var(--text);font-weight:700;font-size:12px}
.history-refresh:hover{border-color:rgba(47,103,255,.45);color:var(--accent)}
.history-refresh:disabled{opacity:.55;cursor:wait}
.history-guest{display:grid;justify-items:start;gap:8px;padding:22px;border:1px solid var(--line);border-radius:12px;background:rgba(255,255,255,.16)}
.guest-history-copy{display:grid;gap:7px}
.guest-history-copy>strong{font-size:16px;color:var(--text)}
.guest-history-copy>span{max-width:700px;color:var(--muted);font-size:12px;line-height:1.55}
.guest-history-dashboard{width:100%;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:8px}
.guest-history-dashboard[hidden]{display:none!important}
.guest-history-dashboard article,.guest-goal-control,.guest-goal-progress{min-width:0;padding:14px 15px;border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.22)}
.guest-history-dashboard article>span,.guest-goal-control>span{display:block;margin-bottom:6px;color:var(--muted);font-size:10px;font-weight:800;letter-spacing:.07em;text-transform:uppercase}
.guest-history-dashboard article>strong{display:block;color:var(--text);font-size:22px;line-height:1.1}
.guest-goal-control select{width:100%;min-height:32px;border:1px solid var(--line);border-radius:7px;background:var(--paper);color:var(--text);padding:0 8px}
.guest-goal-progress{display:grid;align-content:center;gap:10px}
.guest-progress-track{height:8px;overflow:hidden;border-radius:999px;background:var(--line)}
.guest-progress-track span{display:block;width:0;height:100%;border-radius:inherit;background:var(--accent);transition:width .2s ease}
.guest-goal-progress>strong{color:var(--muted);font-size:11px}
.guest-history-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:4px}
.history-guest button{min-height:39px;padding:0 14px;border:0;border-radius:9px;background:var(--accent);color:#fff;font-weight:800;font-size:12px}
.history-guest button:hover{filter:brightness(.96)}
.history-guest button:focus-visible,.guest-goal-control select:focus-visible{outline:3px solid rgba(47,103,255,.25);outline-offset:2px}
.history-guest button:disabled{opacity:.55;cursor:not-allowed}
.history-guest .guest-clear-button{border:1px solid var(--line);background:transparent;color:var(--text)}
.history-guest .guest-login-button{border:1px solid var(--line);background:transparent;color:var(--text)}
.guest-login-button:hover,.guest-clear-button:hover{border-color:var(--accent)!important;color:var(--accent)!important}
.history-guest .history-status{min-height:18px;padding:0;color:var(--muted)}
.history-guest .history-status.is-error{color:var(--bad)}
.history-account[hidden],.history-guest[hidden]{display:none!important}
.history-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:18px}
.history-summary article{padding:15px 16px;border:1px solid var(--line);border-radius:11px;background:rgba(255,255,255,.16)}
.history-summary span{display:block;margin-bottom:5px;color:var(--muted);font-size:10px;font-weight:800;letter-spacing:.07em;text-transform:uppercase}
.history-summary strong{display:block;color:var(--text);font-size:23px;line-height:1.1;letter-spacing:-.025em}
.history-filters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:14px}
.history-filters label>span{display:block;margin:0 0 6px;color:var(--muted);font-size:10px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.history-filters select{width:100%;height:42px;border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.28);color:var(--text);padding:0 11px;outline:none}
.history-filters select:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(47,103,255,.10)}
.history-status{min-height:25px;padding:3px 0 7px;color:var(--muted);font-size:12px}
.history-status.is-error{color:var(--bad)}
.history-table-wrap{overflow:hidden;border:1px solid var(--line);border-radius:12px;background:rgba(255,255,255,.16)}
.history-table{width:100%;border-collapse:collapse;table-layout:fixed;min-width:0;font-size:11px}
.history-table th,.history-table td{padding:10px 6px;border-bottom:1px solid var(--line);text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.history-table th:nth-child(1),.history-table td:nth-child(1){width:14%;white-space:normal;line-height:1.25}
.history-table th:nth-child(2),.history-table td:nth-child(2){width:8%}
.history-table th:nth-child(3),.history-table td:nth-child(3){width:9%}
.history-table th:nth-child(4),.history-table td:nth-child(4){width:8%}
.history-table th:nth-child(5),.history-table td:nth-child(5){width:6%}
.history-table th:nth-child(6),.history-table td:nth-child(6){width:9%}
.history-table th:nth-child(7),.history-table td:nth-child(7){width:9%}
.history-table th:nth-child(8),.history-table td:nth-child(8){width:9%}
.history-table th:nth-child(9),.history-table td:nth-child(9){width:10%}
.history-table th:nth-child(10),.history-table td:nth-child(10){width:9%}
.history-table th:nth-child(11),.history-table td:nth-child(11){width:9%}
.history-table th{background:var(--paper);color:var(--muted);font-size:9px;font-weight:800;letter-spacing:.06em;text-transform:uppercase}
.history-table tbody tr:last-child td{border-bottom:0}
.history-table tbody tr:hover{background:rgba(47,103,255,.05)}
.history-table .history-net{font-weight:900;color:var(--accent);font-size:14px}
.history-empty td{text-align:center!important;padding:30px 16px!important;color:var(--muted)}
.history-pagination{display:flex;align-items:center;justify-content:center;gap:12px;margin-top:14px}
.history-pagination button{min-height:35px;padding:0 12px;border:1px solid var(--line);border-radius:8px;background:transparent;color:var(--text);font-weight:700;font-size:11px}
.history-pagination button:disabled{opacity:.45;cursor:not-allowed}
.history-pagination span{min-width:120px;text-align:center;color:var(--muted);font-size:11px}
.history-note{margin:12px 2px 0;color:var(--muted);font-size:11px;line-height:1.5}
.auth-history-btn{width:100%;min-height:38px;padding:8px 9px;border:0;border-radius:8px;background:transparent;color:var(--text);text-align:left;font-weight:700}
.auth-history-btn:hover{background:var(--accent-soft);color:var(--accent)}
body.theme-dark .history-table-wrap,body.theme-dark .history-summary article,body.theme-dark .history-guest,body.theme-dark .guest-history-dashboard article,body.theme-dark .guest-goal-control,body.theme-dark .guest-goal-progress{background:#172131;border-color:#41516a}
body.theme-dark .history-table th{background:#1c2738;border-color:#41516a}
body.theme-dark .history-table th,body.theme-dark .history-table td{border-bottom-color:#344258}
body.theme-dark .history-filters select,body.theme-dark .history-refresh,body.theme-dark .history-pagination button,body.theme-dark .guest-goal-control select{background:#151d2b;border-color:#41516a;color:#edf3fb}
body.theme-dark .auth-history-btn{color:#edf3fb}
html[dir="rtl"] .history-table th,html[dir="rtl"] .history-table td,html[dir="rtl"] .auth-history-btn{text-align:right}
@media(max-width:760px){
  .history-section{margin-top:42px;padding-top:28px;scroll-margin-top:76px}
  .history-head{display:block}
  .history-head h2{font-size:25px}
  .history-refresh{margin-top:12px}
  .history-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
  .guest-history-dashboard{grid-template-columns:repeat(2,minmax(0,1fr))}
  .history-filters{grid-template-columns:1fr 1fr}
  .history-table{font-size:10.5px}
  .history-table th,.history-table td{padding:9px 5px}
  .history-table th:nth-child(3),.history-table td:nth-child(3),
  .history-table th:nth-child(5),.history-table td:nth-child(5),
  .history-table th:nth-child(6),.history-table td:nth-child(6),
  .history-table th:nth-child(7),.history-table td:nth-child(7),
  .history-table th:nth-child(8),.history-table td:nth-child(8),
  .history-table th:nth-child(10),.history-table td:nth-child(10){display:none}
  .history-table th:nth-child(1),.history-table td:nth-child(1){width:34%}
  .history-table th:nth-child(2),.history-table td:nth-child(2){width:16%}
  .history-table th:nth-child(4),.history-table td:nth-child(4){width:16%}
  .history-table th:nth-child(9),.history-table td:nth-child(9){width:20%}
  .history-table th:nth-child(11),.history-table td:nth-child(11){width:14%}
}
@media(max-width:480px){
  .history-guest{padding:17px}
  .guest-history-dashboard{grid-template-columns:1fr 1fr}
  .guest-history-actions{align-items:stretch;flex-direction:column;width:100%}
  .guest-history-actions button{width:100%}
  .history-filters{grid-template-columns:1fr}
  .history-table th:nth-child(9),.history-table td:nth-child(9){display:none}
  .history-table th:nth-child(1),.history-table td:nth-child(1){width:46%}
  .history-table th:nth-child(2),.history-table td:nth-child(2){width:20%}
  .history-table th:nth-child(4),.history-table td:nth-child(4){width:20%}
  .history-table th:nth-child(11),.history-table td:nth-child(11){width:14%}
}
