#offlineHistoryScreen {
    --offline-history-max-width: 920px;
    min-height: var(--app-height, 100dvh); display: flex; flex-direction: column;
    background: #eef1f4; color: #202a34;
}
#offlineHistoryScreen .offline-history-shell { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
#offlineHistoryScreen .offline-history-toolbar { position: sticky; top: 0; z-index: 20; display: grid; gap: 14px; padding: calc(43px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 15px max(16px, env(safe-area-inset-left, 0px)); background: rgba(238,241,244,.94); border-bottom: 1px solid #dce2e7; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
#offlineHistoryScreen .offline-history-toolbar-row { width: min(100%, var(--offline-history-max-width)); margin-inline: auto; display: grid; grid-template-columns: 44px minmax(0,1fr) auto; gap: 12px; align-items: center; }
#offlineHistoryScreen .offline-history-toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
#offlineHistoryScreen .offline-history-heading { min-width: 0; }
#offlineHistoryScreen .offline-history-overline { margin-bottom: 3px; color: #8b97a3; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
#offlineHistoryScreen .offline-history-title { overflow-wrap: anywhere; font-size: 18px; font-weight: 750; line-height: 1.25; }
#offlineHistoryScreen .offline-history-count { color: #73808d; font-size: 12px; font-weight: 700; white-space: nowrap; }
#offlineHistoryScreen .offline-history-button { width: 44px; min-width: 44px; height: 44px; padding: 0; border: 1px solid #d9e0e6; border-radius: 12px; background: #f8fafb; color: #4d5b68; display: grid; place-items: center; cursor: pointer; transition: all .18s ease; }
#offlineHistoryScreen .offline-history-button:hover, #offlineHistoryScreen .offline-history-button:focus-visible { border-color: #aebac5; background: #fff; color: #202a34; }
#offlineHistoryScreen .offline-history-button.danger { border-color: #efcaca; background: #fff7f7; color: #c44949; }
#offlineHistoryScreen .offline-history-button.danger:hover, #offlineHistoryScreen .offline-history-button.danger:focus-visible { border-color: #d88989; background: #fff; color: #a93636; }
#offlineHistoryScreen .offline-history-button i { font-size: 19px; }
#offlineHistoryScreen .offline-history-search { display: flex; align-items: center; gap: 10px; width: min(100%, var(--offline-history-max-width)); min-height: 50px; margin-inline: auto; padding: 0 13px; border: 1px solid #d6dde3; border-radius: 14px; background: #fff; box-sizing: border-box; box-shadow: 0 5px 16px rgba(41,53,65,.06); transition: border-color .18s ease, box-shadow .18s ease; }
#offlineHistoryScreen .offline-history-search:focus-within { border-color: #7e8d9b; box-shadow: 0 0 0 4px rgba(83,102,120,.12), 0 8px 20px rgba(41,53,65,.08); }
#offlineHistoryScreen .offline-history-search > i { color: #657483; font-size: 20px; }
#offlineHistoryScreen .offline-history-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #27333e; font-size: 15px; }
#offlineHistoryScreen .offline-history-search input::placeholder { color: #9ba6b0; }
#offlineHistoryScreen .offline-history-search-clear { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #a0aab4; cursor: pointer; }
#offlineHistoryScreen .offline-history-search-clear:hover, #offlineHistoryScreen .offline-history-search-clear:focus-visible { background: #eef1f4; color: #4d5b68; }
#offlineHistoryScreen .offline-history-filters { width: min(100%, var(--offline-history-max-width)); margin-inline: auto; display: flex; gap: 8px; }
#offlineHistoryScreen .offline-history-filter { min-height: 30px; padding: 0 12px; border: 1px solid #d9e0e6; border-radius: 999px; background: #f8fafb; color: #6c7a87; font-size: 12px; font-weight: 650; cursor: pointer; transition: all .18s ease; }
#offlineHistoryScreen .offline-history-filter:hover { border-color: #aebac5; color: #354352; }
#offlineHistoryScreen .offline-history-filter.is-active { border-color: #30404e; background: #30404e; color: #fff; }
#offlineHistoryScreen .offline-history-content { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 18px max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
#offlineHistoryScreen .offline-history-list { width: min(100%, var(--offline-history-max-width)); max-width: var(--offline-history-max-width); margin-inline: auto; display: flex; flex-direction: column; gap: 22px; }
#offlineHistoryScreen .offline-history-group { display: flex; flex-direction: column; gap: 9px; }
#offlineHistoryScreen .offline-history-date { align-self: flex-start; padding: 4px 9px; border-radius: 6px; background: #dfe5ea; color: #5f6d7a; font-size: 11px; font-weight: 800; letter-spacing: .03em; }
#offlineHistoryScreen .offline-history-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: end; }
#offlineHistoryScreen .offline-history-item.is-sent { justify-items: end; }
#offlineHistoryScreen .offline-history-item.is-received { justify-items: start; }
#offlineHistoryScreen .offline-history-bubble { max-width: min(100%,680px); padding: 13px 15px; border: 1px solid #e0e5e9; border-radius: 14px; background: #fff; box-shadow: 0 4px 12px rgba(38,51,63,.055); overflow-wrap: anywhere; white-space: pre-wrap; line-height: 1.65; }
#offlineHistoryScreen .offline-history-item.is-sent .offline-history-bubble { border-color: #cbded4; background: #e8f3ed; }
#offlineHistoryScreen .offline-history-actions { display: flex; gap: 3px; justify-content: flex-end; }
#offlineHistoryScreen .offline-history-action-btn { width: 44px; min-width: 44px; min-height: 44px; height: 44px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: #85919c; display: grid; place-items: center; cursor: pointer; }
#offlineHistoryScreen .offline-history-action-btn:hover, #offlineHistoryScreen .offline-history-action-btn:focus-visible { background: #e1e7ec; color: #3f4d59; }
#offlineHistoryScreen .offline-history-action-btn.delete:hover, #offlineHistoryScreen .offline-history-action-btn.delete:focus-visible { color: #c44949; }
#offlineHistoryScreen .offline-history-action-btn i { font-size: 16px; }
#offlineHistoryScreen .offline-history-state { width: min(100%,420px); margin: clamp(24px,8vh,64px) auto; padding: 28px 20px; border: 1px dashed #cfd7de; border-radius: 14px; background: rgba(255,255,255,.56); text-align: center; }
#offlineHistoryScreen .offline-history-state > i { display: block; margin-bottom: 10px; color: #94a1ad; font-size: 32px; }
#offlineHistoryScreen .offline-history-state h3 { margin: 0 0 6px; color: #4a5865; font-size: 16px; }
#offlineHistoryScreen .offline-history-state p { margin: 0; color: #7c8995; font-size: 13px; line-height: 1.6; }
#offlineHistoryScreen .offline-history-empty { padding: 40px; color: #7c8995; text-align: center; }
#offlineHistoryScreen .offline-history-load-more { width: min(100%, 240px); min-height: 44px; margin: 2px auto 0; border: 0; border-radius: 10px; background: #30404e; color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }
#offlineHistoryScreen .offline-history-load-more:disabled { opacity: .56; cursor: default; }
@media (max-width: 560px) {
    #offlineHistoryScreen .offline-history-toolbar-row { grid-template-columns: 42px minmax(0,1fr); gap: 10px; }
    #offlineHistoryScreen .offline-history-toolbar-actions { grid-column: 2; }
    #offlineHistoryScreen .offline-history-count { display: block; margin-top: -4px; }
    #offlineHistoryScreen .offline-history-item { grid-template-columns: minmax(0,1fr); }
    #offlineHistoryScreen .offline-history-actions { justify-content: flex-start; }
    #offlineHistoryScreen .offline-history-bubble { max-width: 100%; }
}
