/* The same visual language as the final account and the orders workspace. */
.public-history {
  --history-ink:#111827; --history-muted:#737c8e; --history-line:#e4e7ee;
  --history-brand:#7c3aed; --history-brand-dark:#6425d0;
  --history-shadow:0 1px 2px #0f172a08,0 8px 25px #0f172a0b;
  min-width:0; color:var(--history-ink);
  background:radial-gradient(circle at 0 0,#7c3aed17,transparent 30rem),radial-gradient(circle at 100% 22%,#4f46e50e,transparent 32rem),#f7f8fc;
  background-attachment:fixed;
  font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
}
.public-history *, .public-history *::before, .public-history *::after { box-sizing:border-box; }
.public-history [hidden] { display:none!important; }
.public-history button, .public-history input { font:inherit; }
.public-history :is(button,a,input):focus-visible { outline:3px solid #ba9cfb; outline-offset:3px; }
.public-history a, .public-history button { -webkit-tap-highlight-color:transparent; }
.public-history .history-icon { width:19px; height:19px; flex-shrink:0; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.public-history .history-sprite { position:absolute; width:0; height:0; overflow:hidden; }
.public-history .history-skip-link { position:fixed; top:-80px; left:16px; z-index:110; padding:12px 18px; border-radius:12px; background:#fff; color:var(--history-brand); box-shadow:var(--history-shadow); }
.public-history .history-skip-link:focus { top:12px; }

/* Shared brand proportions and the account's segmented navigation. */
.public-history .control-bar { padding:0; border-bottom:1px solid #e2e8f0dc; background:#ffffffdb; box-shadow:0 1px 0 #ffffffbf; backdrop-filter:blur(22px) saturate(165%); }
.public-history .control-bar__inner { max-width:1380px; min-height:88px; padding:12px 32px; justify-content:space-between; gap:24px; }
.public-history .control-bar__logo { flex:0 0 auto; justify-content:flex-start; }
.public-history .control-bar__logo-icon { width:58px; height:58px; border-radius:15px; background:linear-gradient(145deg,#fff,#f2edff); box-shadow:0 0 0 1px #7c3aed2e,0 8px 22px #7c3aed26; }
.public-history .control-bar__logo-text { font-size:34px; color:#151128; }
.public-history .control-bar__logo-text span { color:var(--history-brand); }
.public-history .header-actions { display:flex; flex-wrap:nowrap; justify-content:center; gap:4px; width:auto; margin:0; padding:5px; border:1px solid #e8eaf0; border-radius:16px; background:#f5f6fa; }
.public-history .header-actions a { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:40px; height:auto; padding:10px 14px; border:1px solid transparent; border-radius:11px; color:#5f6879; background:transparent; font-size:12px; font-weight:650; line-height:1.4; text-decoration:none; white-space:nowrap; }
.public-history .header-actions a .history-icon { width:16px; height:16px; color:var(--history-brand); }
.public-history .header-actions a[aria-current=page] { color:var(--history-brand-dark); border-color:#ebe6f5; background:#fff; box-shadow:0 4px 14px #261b4a12; }
.public-history .header-actions a:hover { color:var(--history-brand-dark); background:#fff; transform:none; }
.public-history .history-telegram { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:42px; padding:10px 14px; border:1px solid #b9e1f8; border-radius:14px; background:linear-gradient(145deg,#f5fbff,#e8f6ff); color:#087bb5; font-size:12px; font-weight:700; text-decoration:none; white-space:nowrap; }
.public-history .history-telegram:hover { background:#e1f4ff; border-color:#5dbce8; }
.public-history .history-telegram .history-icon { width:17px; height:17px; }

/* Compact heading: title on the left, catalogue information on the right. */
.public-history .history-page { max-width:1344px; margin:24px auto 0; padding:0 32px 28px; }
.public-history .history-heading { display:flex; justify-content:space-between; align-items:flex-end; gap:20px; margin-bottom:22px; }
.public-history .history-heading__copy { min-width:0; }
.public-history .history-heading h1 { margin:0; color:#111322; font-size:clamp(30px,3.1vw,40px); font-weight:800; letter-spacing:-1.8px; line-height:1.15; }
.public-history .history-heading__meta { display:flex; flex-wrap:wrap; align-items:center; gap:12px; flex-shrink:0; padding-bottom:4px; color:#637081; font-size:11px; }
.public-history .history-heading__meta > span { display:inline-flex; align-items:center; gap:6px; }
.public-history .history-heading__meta .history-icon { width:14px; height:14px; color:#059669; }
.public-history .history-count { padding:7px 10px; border:1px solid #e4dcf7; border-radius:10px; background:#ffffffbd; color:var(--history-brand-dark); font-weight:650; }
.public-history .history-count .history-icon { color:var(--history-brand); }
.public-history .history-toolbar-status { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }

/* Selection stays available while browsing all pages. */
.public-history .history-selection { position:sticky; top:calc(var(--history-header-height,88px) + 10px); z-index:5; display:flex; align-items:center; justify-content:space-between; gap:18px; padding:15px 18px; margin-bottom:22px; border:1px solid var(--history-line); border-radius:19px; background:#ffffffed; box-shadow:var(--history-shadow); backdrop-filter:blur(18px); }
.public-history .history-selection > label { display:flex; align-items:center; flex-shrink:0; gap:10px; cursor:pointer; }
.public-history .history-selection label input { width:21px; height:21px; margin:0; accent-color:var(--history-brand); cursor:pointer; }
.public-history .history-selection label span { display:flex; flex-direction:column; gap:4px; }
.public-history .history-selection strong { font-size:12px; color:#252435; }
.public-history .history-selection small { color:var(--history-muted); font-size:10px; }
.public-history .history-selection__actions { display:flex; align-items:center; flex-shrink:0; gap:8px; }
.public-history .history-selection__actions > span { margin-right:3px; color:var(--history-brand); font-size:11px; white-space:nowrap; }
.public-history .history-selection button, .public-history #loadMoreHistory { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:38px; padding:9px 12px; border:1px solid #dfe2ea; border-radius:11px; background:#fff; color:#5f6879; font-size:11px; font-weight:650; cursor:pointer; transition:border-color .18s,background .18s; }
.public-history .history-selection button:hover, .public-history #loadMoreHistory:hover { border-color:#bda5ee; background:#f8f5ff; }
.public-history .history-selection #downloadHistoryXlsx { background:linear-gradient(135deg,#8b5cf6,#6d28d9 72%,#5b21b6); border-color:var(--history-brand); box-shadow:0 5px 14px #7c3aed22; color:#fff; }
.public-history .history-selection #downloadHistoryXlsx::before { content:"↓"; font-size:17px; line-height:1; }
.public-history .history-selection #downloadHistoryXlsx:hover { background:#6425d0; }
.public-history .history-selection button:disabled { opacity:.45; cursor:default; box-shadow:none; }
.public-history .history-selection .history-pagination { display:flex; flex:1 1 auto; flex-wrap:nowrap; justify-content:center; min-width:0; overflow-x:auto; gap:5px; margin:0; padding:3px; scrollbar-width:thin; }
.public-history .history-pagination a { display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; min-width:34px; height:36px; padding:0 9px; border:1px solid transparent; border-radius:10px; background:transparent; color:#788194; font-size:12px; font-weight:650; box-shadow:none; white-space:nowrap; }
.public-history .history-pagination .history-pagination__arrow { min-width:0!important; }
.public-history .history-pagination a:hover { transform:none; background:#f2edff; color:var(--history-brand-dark); }
.public-history .history-pagination a.is-active { color:var(--history-brand-dark); background:#f0eaff; border-color:#e0d4fb; }
.public-history .history-pagination > span { display:flex; align-items:center; color:#8d96a8; font-size:12px; }
.public-history #historyExportStatus { padding:13px 16px; margin:0 0 20px; border:1px solid #e2d6fb; border-radius:13px; background:#f3eeff; color:var(--history-brand-dark); font-size:13px; line-height:1.6; overflow-wrap:anywhere; }

/* Large square photos and clear card titles, as in the account library. */
.public-history .history-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:20px; align-items:stretch; }
.public-history .history-page-divider { display:flex; align-items:center; gap:16px; margin:28px 0 22px; color:#8d96a8; font-size:11px; text-align:center; }
.public-history .history-page-divider::before, .public-history .history-page-divider::after { content:""; flex:1; height:1px; background:var(--history-line); }
.public-history .history-page-batch:first-child .history-page-divider { display:none; }
.public-history .history-card { position:relative; min-width:0; overflow:hidden; border:1px solid var(--history-line); border-radius:24px; background:#fff; box-shadow:var(--history-shadow); transition:border-color .18s,box-shadow .18s,transform .18s; }
.public-history .history-card:hover { transform:translateY(-3px); border-color:#d3c4ef; box-shadow:0 16px 35px #281e4612; }
.public-history .history-card.is-selected { border-color:var(--history-brand); box-shadow:0 0 0 2px #7c3aed2e,0 12px 28px #7c3aed12; }
.public-history .history-card__content { display:flex; height:100%; flex-direction:column; text-decoration:none; color:inherit; }
.public-history .history-card__visual { margin:8px 8px 0; overflow:hidden; border-radius:18px; background:linear-gradient(140deg,#f1edfc,#f8f9fb); aspect-ratio:1; }
.public-history .history-card img, .public-history .history-card__placeholder, .public-history .history-card .avatar-failure-placeholder { display:block; width:100%; height:100%; min-height:0; padding:0; object-fit:contain; background:transparent; }
.public-history .history-card__placeholder, .public-history .history-card .avatar-failure-placeholder { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; padding:24px 18px; color:#8c84a5; font-size:12px; line-height:1.6; text-align:center; }
.public-history .history-card .avatar-failure-placeholder { background:linear-gradient(140deg,#fff9ed,#fff1dd); color:#a16b21; }
.public-history .history-card .avatar-failure-placeholder span { color:#9a7b52; font-size:11px; }
.public-history .history-card__body { display:flex; flex:1; flex-direction:column; min-width:0; padding:16px; }
.public-history .history-card time { margin:0 0 9px; color:#8d96a8; font-size:10px; line-height:1.5; }
.public-history .history-card h2 { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; margin:0 0 17px; color:#252435; font-size:14px; font-weight:650; line-height:1.55; overflow-wrap:anywhere; }
.public-history .history-card__open { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:auto; padding-top:13px; border-top:1px solid #eef0f5; color:var(--history-brand); font-size:11px; font-weight:650; }
.public-history .history-card__open svg { flex-shrink:0; width:16px; height:16px; }
.public-history .history-card__select { position:absolute; right:18px; top:18px; z-index:2; cursor:pointer; }
.public-history .history-card__select input { position:absolute; width:30px; height:30px; margin:0; opacity:0; cursor:pointer; }
.public-history .history-card__select span { display:grid; place-items:center; width:30px; height:30px; border:1px solid #ddd8eb; border-radius:10px; background:#fffffff2; color:transparent; box-shadow:0 3px 10px #21133f12; font-size:16px; }
.public-history .history-card__select input:checked + span { background:var(--history-brand); border-color:var(--history-brand); color:#fff; }
.public-history .history-card__select input:focus-visible + span { outline:3px solid #bd94ff; outline-offset:3px; }
.public-history .history-card__select input:disabled + span { opacity:.5; }
.public-history .history-card__archive { top:18px; left:18px; right:auto; }
.public-history .empty-state { padding:60px 24px; border:1px solid var(--history-line); border-radius:24px; background:#ffffffb8; color:var(--history-muted); font-size:14px; text-align:center; }
.public-history #historySentinel { display:flex; align-items:center; justify-content:center; min-height:46px; margin:24px 0; }
.public-history #loadMoreHistory { min-height:44px; padding:11px 24px; font-size:12px; }
.public-history .history-footer { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:18px; padding:24px 0 0; border-top:1px solid var(--history-line); color:#8d96a8; font-size:11px; }
.public-history .history-footer strong { color:#5f6879; }
.public-history .history-footer a { display:inline-flex; align-items:center; gap:8px; color:var(--history-brand); text-decoration:none; font-weight:650; }
.public-history .history-footer .history-icon { width:15px; height:15px; }

@media(max-width:1100px) {
  .public-history .control-bar__inner { gap:18px; padding:12px 24px; }
  .public-history .control-bar__logo-icon { width:46px; height:46px; }
  .public-history .control-bar__logo-text { font-size:28px; }
  .public-history .history-page { padding:0 24px 28px; }
  .public-history .history-heading { gap:18px; }
  .public-history .history-heading h1 { font-size:36px; }
  .public-history .history-selection { flex-wrap:wrap; gap:12px 20px; }
  .public-history .history-selection .history-pagination { flex-basis:100%; order:3; justify-content:center; }
  .public-history .history-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
}
@media(max-width:800px) {
  .public-history .control-bar__inner { flex-wrap:wrap; gap:14px; }
  .public-history .header-actions { order:3; flex-basis:100%; }
  .public-history .header-actions a { flex:1; }
  .public-history .history-telegram { margin-left:auto; }
  .public-history .history-heading { flex-direction:column; align-items:flex-start; gap:13px; margin-bottom:20px; }
  .public-history .history-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
}
@media(max-width:520px) {
  .public-history .control-bar__inner { padding:12px 16px; gap:12px; }
  .public-history .control-bar__logo { gap:8px; }
  .public-history .control-bar__logo-icon { width:38px; height:38px; border-radius:11px; }
  .public-history .control-bar__logo-text { font-size:23px; }
  .public-history .history-telegram { width:38px; min-height:38px; padding:8px; border-radius:11px; }
  .public-history .history-telegram > span { display:none; }
  .public-history .header-actions a { min-height:38px; padding:9px 10px; font-size:11px; }
  .public-history .history-page { margin-top:20px; padding:0 12px 24px; }
  .public-history .history-heading h1 { max-width:330px; font-size:33px; letter-spacing:-1.2px; }
  .public-history .history-heading__meta { gap:10px; padding-bottom:0; font-size:10px; }
  .public-history .history-selection { top:calc(var(--history-header-height,120px) + 6px); gap:12px; padding:13px; margin-bottom:18px; border-radius:16px; }
  .public-history .history-selection > label { flex:1; }
  .public-history .history-selection strong { font-size:11px; }
  .public-history .history-selection small { font-size:10px; }
  .public-history .history-selection__actions { width:100%; gap:7px; }
  .public-history .history-selection__actions > span { font-size:10px; margin-right:auto; }
  .public-history .history-selection button { font-size:10px; padding:8px 9px; min-height:38px; }
  .public-history .history-selection .history-pagination { justify-content:flex-start; gap:4px; padding:1px 0; }
  .public-history .history-pagination a { min-width:32px; height:34px; padding:0 8px; font-size:11px; }
  .public-history .history-grid { gap:12px; }
  .public-history .history-card { border-radius:18px; }
  .public-history .history-card__visual { margin:6px 6px 0; border-radius:13px; }
  .public-history .history-card__body { padding:12px 10px; }
  .public-history .history-card time { font-size:9px; margin-bottom:7px; }
  .public-history .history-card h2 { font-size:12px; margin-bottom:12px; }
  .public-history .history-card__open { font-size:10px; padding-top:10px; gap:3px; }
  .public-history .history-card__open svg { width:13px; height:13px; }
  .public-history .history-card__select, .public-history .history-card__archive { top:13px; }
  .public-history .history-card__select { right:13px; }
  .public-history .history-card__archive { left:13px; width:28px; height:28px; }
  .public-history .history-card__select input, .public-history .history-card__select span { width:28px; height:28px; border-radius:9px; }
  .public-history .history-card__placeholder, .public-history .history-card .avatar-failure-placeholder { padding:10px; font-size:10px; }
  .public-history .history-card .avatar-failure-placeholder span { font-size:9px; }
  .public-history .history-page-divider { margin:22px 0 18px; }
  .public-history .history-footer { justify-content:center; text-align:center; font-size:10px; gap:12px; }
}
@media(max-width:374px) {
  .public-history .control-bar__logo-text { font-size:21px; }
  .public-history .history-heading h1 { font-size:29px; }
  .public-history .history-heading__meta { gap:8px; font-size:9px; }
  .public-history .history-selection__actions { flex-wrap:wrap; }
  .public-history .history-selection button { padding:8px; }
  .public-history .history-card__open { font-size:9px; }
}
@media(prefers-reduced-motion:reduce) {
  .public-history *, .public-history *::before, .public-history *::after { transition:none!important; animation:none!important; scroll-behavior:auto!important; }
}

/* Three public sections fit the same segmented header on narrow screens. */
@media(max-width:1000px) {
  .public-history .control-bar__inner { flex-wrap:wrap; }
  .public-history .header-actions { order:3; flex-basis:100%; }
  .public-history .header-actions a { flex:1; }
}
@media(max-width:374px) {
  .public-history .header-actions a { gap:5px; padding:9px 6px; font-size:10px; }
  .public-history .header-actions a svg { display:none; }
}
