/* History keeps saved data read-only; screen layout is separate from the A4 paper. */
.history-topbar { gap: 32px; }
.history-topbar .rx-account { gap: 10px; }
.history-active { color: var(--blue); background: var(--blue-soft); }
.history-workspace { max-width: 1120px; }
.history-page-heading { gap: 20px; }
.history-page-heading .button { flex-shrink: 0; }
.history-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.history-search-bar { display: flex; align-items: end; justify-content: space-between; gap: 22px; padding: 22px; border-bottom: 1px solid var(--border); }
.history-search-label { flex: 1; max-width: 640px; min-width: 0; font-size: 12px; font-weight: 600; }
.history-search-label > span { display: block; margin-bottom: 9px; }
.history-search-input { display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft); }
.history-search-input:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.history-search-input .icon { color: var(--muted); width: 18px; height: 18px; }
.history-search-input input { flex: 1; width: 100%; min-width: 0; padding: 12px 0; color: var(--text); background: transparent; border: 0; outline: 0; font-size: 14px; }
.history-count { margin: 0 0 13px; color: var(--muted); font-size: 12px; flex-shrink: 0; }
.history-list { list-style: none; padding: 0; margin: 0; }
.history-list > li + li { border-top: 1px solid var(--border); }
.history-row { width: 100%; display: flex; align-items: center; gap: 18px; padding: 18px 22px; border: 0; text-align: left; background: var(--surface); color: var(--text); }
.history-row:hover { background: var(--surface-soft); }
.history-row:focus-visible { outline: 2px solid var(--blue); outline-offset: -3px; }
.history-row-name { display: block; font-size: 15px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.history-row-info { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.history-row-content { min-width: 0; flex: 1; }
.history-row-type { flex-shrink: 0; font-size: 11px; line-height: 1.5; color: var(--blue); background: var(--blue-soft); padding: 5px 10px; border-radius: 20px; }
.history-row .history-chevron { color: var(--muted); width: 17px; height: 17px; }
.history-message { margin: 0; padding: 44px 24px; text-align: center; color: var(--muted); line-height: 1.7; }
.history-message p { margin: 0 0 12px; }
.history-empty-icon { width: 30px !important; height: 30px !important; margin-bottom: 14px; color: var(--blue); }
.history-empty-text { font-size: 12px; }
.history-pagination { display: flex; align-items: center; justify-content: center; gap: 22px; padding: 18px; border-top: 1px solid var(--border); }
.history-pagination > span { color: var(--muted); font-size: 12px; text-align: center; }
.history-detail-dialog { width: min(1160px, calc(100vw - 24px)); max-width: calc(100vw - 24px); }
.history-detail-dialog h2 { overflow-wrap: anywhere; min-width: 0; }
.history-detail-dialog .rx-dialog-description { overflow-wrap: anywhere; }
#history-preview-container { min-width: 0; max-width: 100%; max-height: 65vh; max-height: 65dvh; overflow: auto; overscroll-behavior: contain; background: #d8dce3; border: 1px solid var(--border); border-radius: 8px; padding: 15px; }
#history-preview-container:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
#history-preview-container .rx-print-root { display: block; position: static; visibility: visible; }
#history-preview-container .rx-print-page { margin: 0 auto 14px !important; box-shadow: 0 2px 12px #0002; }
.history-detail-pages { margin-right: auto; color: var(--muted); font-size: 12px; }
.history-bottom-note { color: var(--muted); text-align: right; font-size: 11px; line-height: 1.6; margin: 17px 0 0; }
@media (max-width: 850px) {
  .history-topbar { gap: 20px; }
  .history-topbar .rx-account > span { display: none; }
  .history-workspace { padding: 28px 20px; }
  .history-page-heading h1 { font-size: 25px; }
}
@media (max-width: 560px) {
  .history-topbar { height: auto; min-height: 78px; padding: 13px 15px; gap: 8px 14px; flex-wrap: wrap; }
  .history-topbar .brand { font-size: 21px; }
  .history-topbar .brand-mark { width: 30px; height: 30px; font-size: 25px; }
  .history-topbar .rx-account { gap: 3px; }
  .history-topbar .rx-main-nav { order: 3; height: 32px; width: 100%; gap: 24px; }
  .history-topbar .rx-main-nav a { font-size: 12px; padding: 0; }
  .history-topbar .rx-text-button { padding-left: 8px; }
  .history-workspace { padding: 23px 14px; }
  .history-page-heading { align-items: start; flex-direction: column; gap: 16px; margin-bottom: 20px; }
  .history-page-heading h1 { font-size: 24px; }
  .history-page-heading p { font-size: 13px; }
  .history-search-bar { padding: 18px 15px; flex-direction: column; align-items: stretch; gap: 12px; }
  .history-count { margin: 0; }
  .history-row { padding: 16px 15px; gap: 10px; }
  .history-row-name { font-size: 14px; }
  .history-row-info { font-size: 11px; }
  .history-row-type { font-size: 10px; padding: 4px 7px; max-width: 80px; text-align: center; }
  .history-row .history-chevron { display: none; }
  .history-pagination { gap: 12px; padding: 15px 10px; }
  .history-pagination .button { font-size: 12px; padding: 10px 13px; }
  .history-detail-dialog { padding: 18px 15px; }
  .history-detail-dialog .rx-dialog-actions { gap: 8px; }
  .history-detail-pages { width: 100%; }
  .history-detail-dialog .rx-dialog-heading h2 { font-size: 17px; }
  #history-preview-container { padding: 10px; }
}
