/* History search replaces the loaded-count label; no additional control row. */
.history-module .history-nav{grid-template-columns:42px minmax(0,1fr) 42px;overflow:visible;gap:5px;padding:3px;margin-bottom:10px;position:relative;z-index:4}
.history-module .history-nav .history-arrow{height:38px;min-height:38px;width:42px;padding:0;border-radius:7px;font-size:23px}
.history-search-control{position:relative;min-width:0}
.history-search-control input{box-sizing:border-box;width:100%;min-width:0;height:38px;min-height:38px;padding:5px 32px 5px 10px;border:1px solid #cbbdde;border-radius:7px;background:white;font-size:14px}
.history-search-control input::-webkit-search-cancel-button{display:none}
.history-search-clear{position:absolute;right:2px;top:2px;width:32px;height:34px;padding:0;border:0;background:transparent;color:#5b3b7f;font-size:23px}
.history-search-clear[hidden],.history-exercise-options[hidden],.history-related-results[hidden]{display:none}
.history-exercise-options{position:absolute;left:0;right:0;top:41px;max-height:280px;overflow:auto;background:white;border:1px solid #cbbdde;border-radius:9px;box-shadow:0 8px 22px #30204026;z-index:10}
.history-exercise-options button,.history-related-results button{display:block;width:100%;text-align:left;padding:9px 10px;border:0;border-bottom:1px solid #eee;background:white;color:#263348}
.history-exercise-options button:hover,.history-exercise-options button:focus-visible,.history-related-results button:focus-visible{background:#f2eafa}
.history-exercise-options strong,.history-exercise-options small,.history-related-results strong,.history-related-results small{display:block}
.history-exercise-options small,.history-related-results small{font-size:11px;color:#6c6574;margin-top:3px}
.history-exercise-options p{margin:10px;font-size:13px}
.history-explorer{padding:12px;border:1px solid #d5c8e5;border-radius:12px;background:#fff;margin:0 0 14px;box-shadow:0 3px 12px #45256f09}
.history-explorer-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}
.history-explorer-heading h2{font-size:17px;margin:0;color:#45256f;min-width:0}
.history-explorer-heading select{flex:0 0 auto;min-height:30px;height:30px;max-width:112px;padding:3px 6px;border:1px solid #cbbdde;border-radius:6px;background:#faf7fe;font-size:12px}
.history-graph-toolbar{display:flex;align-items:center;gap:5px;margin-top:8px;flex-wrap:nowrap}
.history-graph-toolbar button{display:flex;align-items:center;gap:4px;background:#f5f5f8;border:1px solid #ddd;border-radius:5px;padding:5px 6px;font-size:11px;white-space:nowrap;min-height:29px}
.history-graph-toolbar button[aria-pressed=false]{opacity:.45}
.history-graph-toolbar i{width:8px;height:8px;border-radius:50%;flex-shrink:0}.history-graph-toolbar i.tsvr{background:#dc5272}.history-graph-toolbar i.tevr{background:#438ed7}
.history-graph-toolbar>small{margin-left:auto;color:#6c6574;font-size:10px;white-space:nowrap}
.history-volume-chart{display:block;width:100%;height:auto;min-height:150px;margin-top:8px;overflow:visible}
.history-volume-chart text{font-size:12px;fill:#71657b}.history-chart-grid{stroke:#e8e1ee;stroke-width:1;fill:none}.history-line{fill:none;stroke-width:2.5;stroke-linejoin:round}.history-line.tsvr{stroke:#dc5272}.history-line.tevr{stroke:#438ed7}.history-point.tsvr{fill:#dc5272}.history-point.tevr{fill:#438ed7}.history-point{stroke:white;stroke-width:1;cursor:pointer}.history-volume-chart g[role=button]:focus-visible{outline:none}.history-volume-chart g[role=button]:focus-visible circle{stroke:#45256f;stroke-width:3}.history-missing-point{fill:#fff;stroke:#777;stroke-width:1.5}
.history-pr-summary{margin-top:9px;padding:8px 10px;border:1px solid #dccd9b;background:#fff8df;border-radius:7px}.history-pr-summary strong,.history-pr-summary small{display:block}.history-pr-summary strong{font-size:14px;color:#60460d}.history-pr-summary small{font-size:11px;color:#74603c;margin-top:3px;line-height:1.4}
.history-explorer-message{font-size:12px;color:#766582;margin:8px 0}.history-explorer-message button{margin-left:6px}.history-point-summary{font-size:12px;color:#45256f;min-height:0}.history-point-summary:empty{display:none}
.is-exercise-search .history-workout-body,.is-exercise-search .history-date-title,.is-exercise-search .history-time,.is-exercise-search .history-header-actions{display:none}
.history-related-controls{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:9px 0}.history-related-controls button,.history-more-records{border:1px solid #cbbdde;border-radius:6px;background:#f3ecfa;color:#45256f;font-size:12px;padding:6px 9px;min-height:32px}.history-related-controls small{font-size:10px;color:#777;text-align:right;max-width:150px}
.history-related-results{border:1px solid #ddd;border-radius:7px;overflow:hidden;margin-bottom:10px}.history-related-results p{font-size:11px;padding:0 9px}
.history-search-records{display:grid;gap:8px}.history-search-record{padding:10px;border:1px solid #ded8e6;border-radius:9px;background:#fcfbfe;scroll-margin-top:90px}.history-search-record.is-highlighted{border-color:#8054b6;box-shadow:0 0 0 2px #bfa4dc55}.history-search-record header{display:flex;gap:7px;align-items:center}.history-search-record header button{border:0;background:transparent;padding:0;color:#45256f;font-weight:700;font-size:14px;text-align:left;min-height:32px}.history-search-record header small{font-weight:400;color:#777;font-size:10px}.history-pr-badge{background:#e9bd3f;color:#433204;border-radius:4px;padding:2px 5px;font-weight:800;font-size:10px}
.history-record-volumes{display:flex;gap:10px;align-items:center;font-size:12px;margin:4px 0}.history-record-volumes .tsvr{color:#ab3255}.history-record-volumes .tevr{color:#286fa7}.history-record-volumes small{font-size:10px}.history-set-preview{font-size:12px;font-weight:400;color:#495567;margin:6px 0;line-height:1.5;overflow-wrap:anywhere}.history-search-record details{font-size:12px}.history-search-record summary{color:#655479;cursor:pointer}.history-search-record table{width:100%;text-align:left;border-collapse:collapse;margin-top:8px}.history-search-record th,.history-search-record td{padding:5px;border-bottom:1px solid #e4deeb}.history-formula-details{font-size:11px;color:#777}.history-exercise-note{white-space:pre-wrap;overflow-wrap:anywhere}.history-volume-unavailable{font-size:11px;color:#936024}.history-more-records{display:block;margin:10px auto 0}
@media(max-width:400px){.history-explorer{padding:9px}.history-graph-toolbar button{font-size:10px;padding:4px}.history-graph-toolbar>small{font-size:9px}.history-explorer-heading h2{font-size:15px}.history-module .history-nav{grid-template-columns:38px minmax(0,1fr) 38px}.history-module .history-nav .history-arrow{width:38px}.history-record-volumes{gap:7px}}
@media(max-width:640px){.history-volume-chart text{font-size:18px}}

/* Workout navigation belongs to the dated workout, independently of exercise search. */
.history-module .history-top{margin-bottom:12px}
.history-search-row{position:relative;z-index:4;margin:0 0 10px}
.history-module .history-nav{display:grid;grid-template-columns:36px minmax(0,1fr) 36px;gap:5px;padding:3px;margin:12px 0 0}
.history-module .history-nav .history-arrow{width:36px;height:34px;min-height:34px;font-size:22px}
.history-module .history-nav .history-date-title{margin:0;min-width:0;white-space:nowrap;text-align:center;font-size:clamp(11px,3.1vw,16px);font-weight:600;line-height:34px}
.history-module .history-time{margin:4px 0 10px;text-align:center;font-size:11px}
.history-module .history-volume-notes-row{display:grid;grid-template-columns:minmax(0,3fr) minmax(72px,1fr);align-items:center;gap:8px;margin:8px 0 12px}
.history-module .history-volume-notes-row .workout-volume-summary{min-width:0;margin:0;padding:9px}
.history-module .history-volume-notes-row .workout-notes-open{width:100%;min-width:0;margin:0;padding:8px 4px;font-size:12px;white-space:nowrap}
.history-module .history-volume-notes-row .workout-volume-labels{gap:4px;font-size:clamp(8px,1.8vw,10px);flex-wrap:wrap}
.history-module .history-volume-notes-row .workout-volume-heading{gap:4px}
.history-module .history-volume-notes-row .workout-volume-heading strong{font-size:12px}
@media(max-width:360px){.history-module .history-nav{grid-template-columns:30px minmax(0,1fr) 30px;gap:3px}.history-module .history-nav .history-arrow{width:30px}.history-module .history-nav .history-date-title{font-size:10.5px}}

.history-module .history-volume-notes-row .workout-notes-open{grid-column:2;grid-row:1;justify-self:stretch}

/* Compact notes tile and dated-workout controls. */
.history-module .history-volume-notes-row{grid-template-columns:minmax(0,1fr) 58px;align-items:stretch}
.history-module .history-volume-notes-row .workout-notes-open{height:100%;white-space:normal;line-height:1.25;padding:8px 12px;align-self:stretch;font-size:12px}
.history-module .history-nav .history-date-title{font-size:clamp(15px,calc(3.1vw + 4px),20px)}
.history-module .history-workout-meta-row{display:flex;justify-content:flex-end;align-items:center;gap:12px;width:100%;margin-top:5px}
.history-module .history-workout-meta-row .history-collapse-all{margin:0;min-height:34px;font-size:12px;padding:6px 10px;border:1px solid #cbbdde;border-radius:8px;background:#f7f3fc;color:#45256f;white-space:nowrap}
@media(max-width:360px){.history-module .history-nav .history-date-title{font-size:14.5px}.history-module .history-volume-notes-row{grid-template-columns:minmax(0,1fr) 54px}.history-module .history-volume-notes-row .workout-notes-open{padding:8px 10px}}

.history-module .history-workout-meta-row{justify-content:space-between}.history-module .history-workout-meta-row .history-collapse-all{margin-left:auto}.history-module .history-time .history-position{display:inline;font-size:inherit;color:inherit;font-weight:400}
/* History refinement: date +3pt and clear circular touch targets. */
.history-module .history-nav{grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:8px}
.history-module .history-nav .history-date-title{font-size:clamp(19px,calc(3.1vw + 8px),24px);line-height:1.25;white-space:normal;overflow-wrap:anywhere}
.history-module .history-nav .history-arrow{width:44px;height:44px;min-height:44px;border:0;border-radius:50%;background:transparent;box-shadow:0 3px 9px rgba(69,37,111,.18);cursor:pointer}
.history-module .history-nav .history-arrow:not(:disabled){background:transparent}
.history-module .history-nav .history-arrow:focus-visible{outline:2px solid var(--history-purple);outline-offset:3px}
.history-module .history-nav .history-arrow:disabled{box-shadow:none;cursor:default}
@media(max-width:360px){.history-module .history-nav .history-date-title{font-size:18.5px}}

.history-module .add-history-exercise{display:block;width:100%;min-height:48px;margin:14px 0 8px;padding:10px;border:1px solid #cbbdde;border-radius:10px;background:#f7f3fc;color:#45256f;font:inherit;font-weight:800;cursor:pointer}
.history-module .history-record.history-post-added{border-left:4px solid #d69424;background:#fffaf0}
.history-added-badge{display:block;width:fit-content;margin-top:5px;padding:3px 7px;border-radius:6px;background:#ffedc2;color:#775018;font-size:11px;font-weight:750;line-height:1.3}
.history-add-exercise-dialog{box-sizing:border-box;width:min(600px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:85dvh;padding:16px;border:0;border-radius:14px;overflow-x:hidden;color:#253449;background:#fff}
.history-add-exercise-dialog::backdrop{background:rgba(4,12,24,.66)}
.history-add-exercise-dialog header{display:flex;align-items:center;justify-content:space-between;gap:10px}
.history-add-exercise-dialog h2{margin:0;font-size:20px}.close-history-exercise-picker{width:44px;min-height:44px;border:0;border-radius:50%;font-size:24px;background:#f4eff9}
.history-add-exercise-dialog label{display:grid;gap:6px;margin-top:12px;font-size:14px}
.history-add-exercise-dialog input{box-sizing:border-box;width:100%;min-width:0;min-height:44px;padding:9px;border:1px solid #cbbdde;border-radius:8px;font-size:16px}
.history-add-results{display:grid;gap:6px}.history-add-option{min-width:0;min-height:48px;padding:10px;border:1px solid #e0d6ed;border-radius:8px;background:#faf7ff;color:#45256f;text-align:left;white-space:normal;overflow-wrap:anywhere;font:inherit;cursor:pointer}
.history-add-status{font-size:13px}.history-add-option:focus-visible{outline:2px solid #65409a}
