.history-panel { margin-block: 16px; }
#history-repeat-comparison { scroll-margin-top: 96px; }
.history-panel h2, .history-panel h3 { margin-top: 0; }
.history-panel summary, .history-delete summary { cursor: pointer; }
.history-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-block: 14px; }
.history-filter label { display: grid; gap: 4px; min-width: 0; }
.history-filter select { min-height: 44px; width: 100%; max-width: 42rem; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
.history-chart { margin: 18px 0; }
.history-chart canvas { display: block; inline-size: 100%; block-size: 170px; margin-block: 8px; }
.history-change { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.history-export { margin-block: 16px 0; }
.history-export-preview { max-inline-size: 42rem; margin-block-start: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
.history-export-preview > p { margin: 0 0 6px; }
.history-export-actions { display: flex; flex-wrap: wrap; gap: 10px; }
[data-history-export-status]:empty { display: none; }
[data-history-export-status]:not(:empty) { margin-block-start: 8px; }
.history-export-peg { margin-block: 14px; }
.history-export-peg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 12px; margin-block: 12px; }
.history-export-peg fieldset { min-inline-size: 0; }
.history-export-peg label { display: grid; gap: 4px; margin-block: 0 10px; }
.history-export-peg p { margin-block: 8px; }
[data-peg-export-status]:empty { display: none; }
.history-delete { margin-block: 14px; }
.history-delete form { margin-top: 8px; }
.history-save-area { margin-block: 14px; }
.history-save-area > a { margin-inline: 8px; }
[data-tool-history-status]:empty, [data-tool-history-error]:empty { display: none; }
[data-tool-history-dialog] { width: min(540px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; margin: auto; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); }
[data-tool-history-dialog] h2 { margin-top: 0; }
[data-tool-history-dialog]::backdrop { background: rgb(15 37 40 / .58); }
.history-continue { margin-block: 16px; }
.history-continue .button { white-space: normal; height: auto; }
.history-measurement-fields { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.history-measurement-fields label { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }
.history-measurement-preview { max-height: min(30vh, 20rem); overflow-y: auto; margin-block: 12px; padding: 0; list-style: none; border-block-start: 1px solid var(--line); }
.history-measurement-preview li { padding: 8px 0; border-block-end: 1px solid var(--line); overflow-wrap: anywhere; }
.history-measurement-preview label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.history-measurement-preview small { display: block; margin-inline-start: 22px; }
[data-measurement-import-status]:empty, [data-measurement-import-error]:empty { display: none; }

.history-start { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; list-style: none; padding: 0; }
.history-start li { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.history-start p { margin-block: 8px 0; }
.history-save-area [role="status"]:empty { display: none; }
[data-plan-log-account] { display: none; }
[data-plan-account-enabled] [data-plan-log-account]:has([data-plan-log-save-account]:not([hidden])) { display: flex; }
