.history-shell { max-width: 1240px; padding-bottom: 64px; }
.history-intro { padding: 32px 0 24px; max-width: 850px; }
.history-intro h1 { margin: 8px 0 12px; font-size: clamp(26px, 4vw, 36px); letter-spacing: -.03em; }
.history-intro p { line-height: 1.65; }
.history-note, .history-account { color: var(--muted, #64748b); font-size: 13px; overflow-wrap: anywhere; }
.history-workspace { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 24px; align-items: start; }
.history-workspace[hidden], .history-rename[hidden] { display: none; }
.history-sidebar, .history-preview, .history-guest { padding: 24px; min-width: 0; }
.history-list-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.history-list-heading h2 { font-size: 17px; margin: 0; }
.history-search { display: flex; gap: 8px; margin-bottom: 18px; }
.history-search input, .history-rename input { min-width: 0; width: 100%; border: 1px solid #dce2e9; border-radius: 8px; padding: 10px; font: inherit; }
.history-search button { flex-shrink: 0; }
.history-list { display: grid; gap: 8px; }
.history-record { display: grid; gap: 7px; padding: 14px; border: 1px solid #e3e8ee; background: #fff; border-radius: 10px; text-align: left; font: inherit; color: inherit; cursor: pointer; width: 100%; }
.history-record:hover { background: #f6f9fc; }
.history-record[aria-current="true"] { border-color: #288777; background: #eef8f4; }
.history-record strong { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.history-record small { color: #64748b; font-size: 12px; line-height: 1.6; }
#historyMore { margin-top: 16px; width: 100%; }
.history-preview { min-height: 360px; padding: 0; overflow: hidden; }
.history-record-heading { padding: 24px 28px 0; }
.history-result-toolbar { margin: 0 28px; padding: 0; }
.history-result-toolbar .result-tabs { gap: 20px; }
.history-preview-hint { flex: 1; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.history-extras { padding: 0 28px 12px; }
.history-preview > .history-empty { margin: 24px; }
#historyRecordTitle { overflow-wrap: anywhere; font-size: 23px; line-height: 1.4; margin: 8px 0; }
.history-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0; }
.history-danger { color: #b33838; }
.history-empty { padding: 30px 8px; color: #64748b; line-height: 1.7; }
.history-status { padding: 12px 16px; border-radius: 8px; background: #edf4fb; color: #244a70; overflow-wrap: anywhere; }
.history-status[data-error="true"] { background: #fff1ef; color: #9b3636; }
.history-section { border-top: 1px solid #e6ebf0; padding: 18px 0; }
.history-section summary { font-weight: 600; cursor: pointer; line-height: 1.6; }
.history-section > div { padding-top: 12px; line-height: 1.7; }
.history-section p, .history-section li { overflow-wrap: anywhere; }
.history-prose { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.8; }
.history-rename { display: grid; gap: 12px; padding: 16px; background: #f6f8fa; border-radius: 8px; margin-bottom: 20px; }
.history-confirm { max-width: min(480px, calc(100vw - 32px)); border: 1px solid #dce2e9; border-radius: 16px; padding: 26px; }
.history-confirm::backdrop { background: #14253970; }
.history-confirm p { line-height: 1.75; }
.history-confirm form > div { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
@media (max-width: 760px) {
  .history-workspace { grid-template-columns: 1fr; gap: 16px; }
  .history-sidebar { padding: 18px; }
  .history-record-heading { padding: 20px 20px 0; }
  .history-result-toolbar { margin: 0 20px; }
  .history-preview .result { padding-left: 20px; padding-right: 20px; }
  .history-extras { padding-left: 20px; padding-right: 20px; }
  .history-list { max-height: 340px; overflow-y: auto; }
  .history-account { display: none; }
  .history-shell { padding-left: 16px; padding-right: 16px; }
}
