.history-modal-open { overflow: hidden; }
.transaction-history { width: min(960px,calc(100% - 24px)); max-height: calc(100dvh - 28px); margin: auto; padding: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; border: 1px solid #bcdbf4; border-radius: 24px; color: #173b63; background: #f4f8fe; box-shadow: 0 25px 90px #031b496b; font-size: 14px; }
.transaction-history::-webkit-scrollbar { display: none; }
.transaction-history::backdrop { background: #031a3bc9; }
.history-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 24px; background: linear-gradient(135deg,transparent 65%,#4fa8f319 65% 74%,transparent 74% 83%,#4fa8f310 83%),linear-gradient(110deg,#175b9c,#082c58 85%); }
.history-heading-copy { display: flex; align-items: center; gap: 14px; }
.history-heading-art { display: grid; place-items: center; flex: 0 0 60px; height: 60px; border: 1px solid #9dccf344; border-radius: 18px; background: #a6d5ff12; }
.history-heading-art img { width: 50px; height: 50px; object-fit: contain; }
.transaction-history .history-heading h2 { margin: 0; padding: 0; color: #fff; font-size: 24px; line-height: 1.35; }
.transaction-history .history-heading p { margin: 6px 0 0; color: #bddaf4; font-size: 13px; line-height: 1.6; }
.history-close { display: grid; place-items: center; flex: 0 0 34px; height: 34px; padding: 0; border: 1px solid #afdafb66; border-radius: 50%; color: #e6f5ff; background: #ffffff08; font-size: 26px; line-height: 1; }
.history-close:hover { background: #ffffff20; }
.history-content { padding: 22px 24px 18px; }
.history-mode-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
#history-mode-label { color: #234e79; font-weight: 800; font-size: 15px; }
#history-example-toggle { min-height: 34px; padding: 6px 12px; border: 1px solid #bdd7ee; border-radius: 9px; color: #236caa; background: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; }
#history-example-toggle:hover { background: #e7f2ff; }
.transaction-history .history-example-note { margin: 0 0 14px; padding: 10px 13px; border: 1px solid #d7caa0; border-radius: 11px; color: #82661c; background: #fff8e6; font-size: 13px; line-height: 1.6; }
.history-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 22px; }
.history-stat { position: relative; display: grid; gap: 7px; min-width: 0; padding: 17px 18px; overflow: hidden; border: 1px solid #cee0f2; border-radius: 16px; background: linear-gradient(135deg,#fff,#eef5ff); box-shadow: 0 3px 10px #114b7d05; }
.history-stat::before { position: absolute; inset: 16px auto 16px 0; width: 3px; border-radius: 0 5px 5px 0; background: #4192d3; content: ''; }
.history-stat > span { font-size: 13px; color: #54789a; }
.history-stat strong { min-width: 0; color: #154a7c; font: 800 clamp(19px,2vw,25px)/1.2 Tahoma,sans-serif; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.history-stat small { color: #8299af; font-size: 12px; }
.history-stat--deposit::before { background: #2ca67a; }
.history-stat--deposit strong { color: #187253; }
.history-stat--withdraw::before { background: #dca64e; }
.history-stat--withdraw strong { color: #946719; }
.history-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.history-filters { display: flex; gap: 4px; padding: 4px; border: 1px solid #cadff2; border-radius: 12px; background: #e6eff9; }
.history-filters button { min-height: 35px; min-width: 88px; padding: 7px 13px; border: 1px solid transparent; border-radius: 9px; color: #6382a0; background: transparent; font-size: 14px; font-weight: 700; }
.history-filters button[aria-pressed="true"] { color: #fff; border-color: #348bc6; background: linear-gradient(135deg,#1e82ca,#0b539b); box-shadow: 0 3px 8px #1b62952b; }
.history-period-label { display: flex; align-items: center; gap: 9px; color: #63809b; font-size: 13px; }
#history-period { min-height: 40px; padding: 8px 34px 8px 12px; appearance: none; border: 1px solid #c6dbed; border-radius: 10px; color: #2a587e; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%234c779c' stroke-width='1.8'/%3E%3C/svg%3E") right 12px center / 10px no-repeat; font: inherit; cursor: pointer; }
.history-table-wrap { overflow: hidden; border: 1px solid #cedff0; border-radius: 15px; background: #fff; }
.history-table { width: 100%; border-collapse: collapse; text-align: left; }
.history-table th { padding: 14px 12px; border-bottom: 1px solid #c9dff2; color: #557797; background: #e9f2fc; font-size: 12px; font-weight: 700; white-space: nowrap; }
.history-table td { padding: 16px 12px; border-bottom: 1px solid #e6eef6; font-size: 13px; vertical-align: middle; }
.history-table tbody tr:last-child td { border-bottom: 0; }
.history-table tbody tr:nth-child(even) { background: #fbfdff; }
.history-table tbody tr:hover { background: #f2f8ff; }
.history-date { display: block; color: #2d5276; white-space: nowrap; font-size: 13px; }
.history-time { display: block; margin-top: 5px; color: #8a9eb1; font-size: 12px; }
.history-reference { color: #5a7c9b; font: 11px/1.5 Tahoma,sans-serif; overflow-wrap: anywhere; }
.history-type { display: inline-flex; align-items: center; gap: 7px; color: #346387; font-size: 13px; white-space: nowrap; }
.history-type img { width: 27px; height: 27px; object-fit: contain; }
.history-table .history-money-heading, .history-table .history-amount { text-align: right; }
.history-table .history-amount { color: #205b8c; font: 700 15px/1.4 Tahoma,sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
.history-bank { display: flex; align-items: center; gap: 7px; }
.history-bank img { width: 27px; height: 27px; padding: 4px; flex-shrink: 0; border-radius: 7px; }
.history-bank strong { display: block; color: #3b6284; font: 700 12px/1.5 Tahoma,sans-serif; }
.history-bank small { color: #8a9daf; font-size: 11px; white-space: nowrap; }
.history-status { display: inline-flex; align-items: center; justify-content: center; min-height: 27px; padding: 5px 9px; border: 1px solid #b9d7ef; border-radius: 7px; color: #2b76aa; background: #edf6ff; font-size: 12px; font-weight: 700; line-height: 1.4; white-space: nowrap; }
.history-status--completed { color: #24815e; border-color: #b9e3d2; background: #edfaf4; }
.history-status--pending { color: #a37822; border-color: #f0ddb1; background: #fff8e9; }
.history-status--failed { color: #bb5a67; border-color: #efcbd1; background: #fff2f4; }
.history-empty { padding: 36px 20px; text-align: center; }
.history-empty > span { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 14px; border: 1px solid #cce2f6; border-radius: 18px; color: #6b9ec6; background: #edf6ff; }
.history-empty svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.history-empty h3 { margin: 0 0 7px; color: #315f86; font-size: 16px; }
.transaction-history .history-empty p { margin: 0; color: #8aa0b5; font-size: 13px; line-height: 1.6; }
.history-table-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.transaction-history #history-count { margin: 0; color: #7d96ad; font-size: 12px; }
.history-pagination { display: flex; align-items: center; gap: 10px; color: #6d8aa4; font: 12px/1 Tahoma,sans-serif; }
.history-pagination button { min-height: 34px; padding: 7px 10px; border: 1px solid #c8ddef; border-radius: 8px; color: #336b98; background: #fff; font-size: 12px; }
.history-pagination button:disabled { color: #a8bbcb; border-color: #dce7f1; background: #f3f7fb; cursor: default; }
.transaction-history .history-storage-note { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid #dce7f2; color: #8a9fb2; text-align: center; font-size: 12px; line-height: 1.7; }
.history-result-link { margin-top: 13px; padding: 8px; border: 0; color: #286fac; background: transparent; font-size: 13px; font-weight: 700; }
.transaction-history :focus-visible { outline: 2px solid #2b94db; outline-offset: 3px; }
.history-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 700px) {
  .transaction-history { width: calc(100% - 18px); max-height: calc(100dvh - 18px); border-radius: 21px; }
  .history-heading { padding: 19px 16px; gap: 7px; }
  .history-heading-copy { gap: 10px; }
  .history-heading-art { flex-basis: 44px; height: 44px; border-radius: 13px; }
  .history-heading-art img { width: 39px; height: 39px; }
  .transaction-history .history-heading h2 { font-size: 20px; }
  .transaction-history .history-heading p { font-size: 12px; }
  .history-close { flex-basis: 30px; height: 30px; }
  .history-content { padding: 16px 13px; }
  .history-summary { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin-bottom: 16px; }
  .history-stat { padding: 12px 8px 12px 11px; border-radius: 12px; gap: 8px; }
  .history-stat:first-child { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 9px 13px; }
  .history-stat strong { font-size: clamp(15px,4.4vw,21px); white-space: nowrap; overflow-wrap: normal; }
  #history-mode-label { font-size: 13px; }
  .history-stat > span { font-size: 12px; }
  .history-stat small { display: none; }
  .history-toolbar { flex-wrap: wrap; }
  .history-filters { width: 100%; }
  .history-filters button { flex: 1; min-width: 0; }
  .history-period-label { width: 100%; justify-content: space-between; }
  #history-period { min-width: 146px; }
  .history-table-wrap { border: 0; border-radius: 0; background: transparent; }
  .history-table, .history-table tbody { display: block; }
  .history-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .history-table tbody { display: grid; gap: 10px; }
  .history-table tbody tr { display: grid; grid-template-columns: 1fr 1fr; min-width: 0; padding: 12px; border: 1px solid #cee1f1; border-radius: 14px; background: #fff; box-shadow: 0 3px 8px #0c4b7e05; }
  .history-table td { display: block; min-width: 0; padding: 8px 0; border: 0; }
  .history-table td::before { display: block; margin-bottom: 7px; color: #8b9fb1; font-size: 11px; content: attr(data-label); }
  .history-table .history-date-cell { grid-column: 1; grid-row: 3; border-top: 1px solid #eaf0f6; padding-top: 12px; }
  .history-time { display: inline; margin-left: 6px; font-size: 11px; }
  .history-date { display: inline; font-size: 12px; }
  .history-table .history-reference-cell { grid-column: 1 / -1; grid-row: 4; padding-bottom: 0; }
  .history-reference-cell::before { display: inline!important; margin-right: 7px; }
  .history-table .history-type-cell { grid-column: 1; grid-row: 1; }
  .history-table .history-type-cell::before { display: none; }
  .history-table .history-amount { grid-column: 2; grid-row: 1; font-size: 19px; align-self: center; }
  .history-table .history-amount::before { display: none; }
  .history-table .history-bank-cell { grid-column: 1; grid-row: 2; }
  .history-table .history-status-cell { grid-column: 2; grid-row: 2; text-align: right; }
  .history-table td.history-status-cell::before { text-align: right; }
  .history-table .history-date-cell { grid-column: 1 / -1; }
  .history-table .history-date-cell::before { display: none; }
  .history-empty { padding: 35px 12px; border: 1px solid #d4e3f1; border-radius: 14px; background: #fff; }
  .history-table-footer { flex-wrap: wrap; }
}
