:is(.fh-records,.fh-records-sheet) {
  --records-bg: #f7f4fb;
  --records-surface: #fff;
  --records-accent: #6d35b1;
  --records-tint: #f3ebfb;
  --records-line: #e9e0f2;
  --records-ink: #251d35;
  --records-muted: #685b7b;
  --records-positive: #08745a;
  --records-negative: #ae3055;
  --records-shadow: 0 3px 12px rgba(59, 32, 97, .06);
  color: var(--records-ink);
  font: 14px/1.5 system-ui, sans-serif;
}

.fh-records {
  box-sizing: border-box;
  width: min(100%, 430px);
  min-width: 0;
  min-height: var(--app-vh, 100dvh);
  margin: 0 auto;
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  background: var(--records-bg);
}

.fh-records--ledger {
  height: var(--app-vh, 100dvh);
  min-height: 0;
  overflow: hidden;
}

:is(.fh-records,.fh-records-sheet) button {
  color: inherit;
  font: inherit;
  cursor: pointer;
}

:is(.fh-records,.fh-records-sheet) button:disabled { opacity: .55; cursor: default; }
:is(.fh-records,.fh-records-sheet) :focus-visible { outline: 2px solid var(--records-accent); outline-offset: 2px; }
.fh-records-top { position: sticky; top: 0; z-index: 30; background: var(--records-bg); }

.fh-records-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  min-height: 57px;
  border-bottom: 1px solid var(--records-line);
  background: var(--records-surface);
}

.fh-records-header :is(h1,h2) { margin: 0; color: var(--records-ink); font-size: 18px; line-height: 1.3; font-weight: 750; }

:is(.fh-records,.fh-records-sheet) :is(.fh-records-back,.fh-records-action,.fh-records-pagination button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  padding: 6px 11px;
  border: 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}

:is(.fh-records,.fh-records-sheet) .fh-records-back { justify-self: start; background: transparent; }
:is(.fh-records,.fh-records-sheet) .fh-records-header .fh-records-action { justify-self: end; }
:is(.fh-records,.fh-records-sheet) :is(.fh-records-action,.fh-records-pagination button) { color: var(--records-accent); background: var(--records-tint); }

.fh-records-controls {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.45fr);
  gap: 8px;
  padding: 10px 12px;
  background: var(--records-surface);
  border-bottom: 1px solid var(--records-line);
}

.fh-records-controls button {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 6px;
  padding: 5px 8px;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--records-line);
  border-radius: 10px;
  background: var(--records-bg);
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.fh-records-controls button svg { flex: none; width: 15px; height: 15px; color: var(--records-accent); }
.fh-records-controls button span { min-width: 0; overflow-wrap: anywhere; }
.fh-records-control-dates { display: flex; gap: 1px 4px; flex-wrap: wrap; }
.fh-records-control-dates time { white-space: nowrap; }
.fh-records-control-dates span { color: var(--records-accent); }
@media (max-width: 359px) {
  .fh-records-controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
}
.fh-records-body { flex: 1; min-width: 0; padding: 10px 12px max(18px, env(safe-area-inset-bottom)); overflow-wrap: anywhere; }
.fh-records--ledger .fh-records-body { min-height: 0; overflow: auto; overscroll-behavior: contain; }

.fh-records-state { display: grid; justify-items: center; gap: 11px; padding: 55px 10px 20px; color: var(--records-muted); text-align: center; }
.fh-records-state p { margin: 0; font-weight: 650; }
.fh-records-state-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; color: var(--records-accent); background: var(--records-tint); }
.fh-records-state-icon svg { width: 27px; height: 27px; }
.fh-records-spinner { display: block; width: 25px; height: 25px; border: 3px solid var(--records-line); border-top-color: var(--records-accent); border-radius: 50%; animation: fh-records-spin .8s linear infinite; }
@keyframes fh-records-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .fh-records-spinner { animation: none; } }

.fh-records-card, .fh-records-summary {
  min-width: 0;
  background: var(--records-surface);
  border: 1px solid var(--records-line);
  border-radius: 13px;
  box-shadow: var(--records-shadow);
}

.fh-records-card { margin-bottom: 10px; }
.fh-records-card-body { display: grid; gap: 7px; padding: 11px 12px; }
.fh-records-line { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; }
.fh-records-card-title { font-weight: 730; font-size: 14px; }
.fh-records-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.fh-records-detail { padding: 9px 12px; background: var(--records-bg); border-radius: 0 0 13px 13px; color: var(--records-muted); font-size: 12px; border-top: 1px solid var(--records-line); }
.fh-records-detail strong { color: var(--records-ink); font-weight: 700; }

.fh-records-chip {
  display: inline-block;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--records-tint);
  color: var(--records-accent);
  font-size: 12px;
  font-weight: 730;
  overflow-wrap: anywhere;
}

.fh-records-chip:is([data-tone=win],[data-tone=draw]) { background: #e7f6ef; color: var(--records-positive); }
.fh-records-chip[data-tone=lose] { background: #fbeaf0; color: var(--records-negative); }
.fh-records-chip[data-tone=pending] { background: #fff3d9; color: #805613; }
.fh-records-chip[data-tone=cancel] { background: #f1eef5; color: var(--records-muted); }
.fh-records-positive { color: var(--records-positive); }
.fh-records-negative { color: var(--records-negative); }

.fh-records .fh-records-ledger-button {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, .82fr);
  align-items: center;
  gap: 7px;
  padding: 11px 12px;
  width: 100%;
  border: 0;
  border-radius: 13px;
  background: transparent;
  text-align: left;
  overflow-wrap: anywhere;
}

.fh-records-ledger-label { display: grid; justify-items: start; gap: 3px; min-width: 0; }
.fh-records-time, .fh-records-ledger-balance { color: var(--records-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.fh-records-ledger-balance { display: grid; gap: 2px; }
.fh-records-ledger-amount { align-self: center; text-align: right; font-size: 16px; }
.fh-records-ledger-amount::after { content: ''; display: inline-block; width: 5px; height: 5px; margin: 0 1px 3px 5px; border-right: 1.5px solid var(--records-muted); border-bottom: 1.5px solid var(--records-muted); transform: rotate(45deg); }
.fh-records-ledger-button[aria-expanded=true] .fh-records-ledger-amount::after { transform: rotate(225deg); margin-bottom: 0; }
.fh-records-ledger-detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 12px; }
.fh-records-ledger-detail > :nth-child(2) { text-align: right; }
.fh-records-ledger-note { grid-column: 1 / -1; }
@media (max-width: 359px) {
  .fh-records .fh-records-ledger-button { grid-template-columns: minmax(0, 1fr) minmax(0, .85fr); }
  .fh-records-ledger-balance { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; gap: 2px 12px; }
}

.fh-records-tail { padding: 9px 0; text-align: center; color: var(--records-muted); font-size: 12px; }
.fh-records-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 10px 12px 0; padding: 9px 0; text-align: center; }
.fh-records-summary > div + div { border-left: 1px solid var(--records-line); }
.fh-records-summary-label { font-size: 12px; color: var(--records-muted); }
.fh-records-summary-value { display: block; font-size: 15px; padding: 0 4px; overflow-wrap: anywhere; }
.fh-records-day { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 3px 8px; font-weight: 700; }
.fh-records-day-values { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--records-muted); font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 500; }
.fh-records-bet-details { display: grid; gap: 5px; padding: 6px 8px; border-radius: 9px; background: var(--records-bg); }
.fh-records .fh-records-expand { width: 100%; min-height: 42px; padding: 5px 12px; background: transparent; border: 0; border-top: 1px solid var(--records-line); border-radius: 0 0 13px 13px; font-size: 12px; color: var(--records-accent); font-weight: 700; }
.fh-records-pagination { position: sticky; bottom: 0; z-index: 30; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 12px max(8px, env(safe-area-inset-bottom)); background: var(--records-surface); border-top: 1px solid var(--records-line); }

.fh-account-period152,.fh-account-type152 { margin: 11px 12px 0; background: var(--records-surface); border: 1px solid var(--records-line); border-radius: 13px; padding: 11px; }
.fh-account-type152 { padding: 0 11px; }
.fh-account-period152 p { color: var(--records-muted); font-size: 12px; margin: 0 0 10px; }
.fh-records-options, .fh-account-options152 { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.fh-records-options--two { grid-template-columns: repeat(2,minmax(0,1fr)); }
:is(.fh-records-options,.fh-account-options152) button { background: var(--records-bg); border: 1px solid var(--records-line); border-radius: 9px; min-height: 42px; padding: 4px 6px; font-weight: 650; overflow-wrap: anywhere; }
:is(.fh-records-options,.fh-account-options152) button[aria-pressed=true] { color: var(--records-accent); border-color: #b99bd7; background: var(--records-tint); }
.fh-account-date-pair152 { margin-top: 9px; }
.fh-account-filter-row152 { display: grid; grid-template-columns: minmax(0,1fr) auto 12px; align-items: center; gap: 7px; text-align: left; width: 100%; padding: 7px 2px; min-height: 46px; background: transparent; border: 0; }
.fh-account-filter-row152 + .fh-account-filter-row152 { border-top: 1px solid var(--records-line); }
.fh-account-filter-row152 span:last-child { color: var(--records-accent); font-size: 20px; text-align: right; }
.fh-account-message152 { margin: 12px 18px; color: var(--records-negative); }

.fh-records-sheet { position: fixed; inset: auto 0 0; box-sizing: border-box; width: min(100%, 430px); max-width: none; max-height: 80dvh; margin: 0 auto; overflow: auto; background: var(--records-surface); border: 1px solid var(--records-line); border-radius: 16px 16px 0 0; padding: 0 0 max(12px, env(safe-area-inset-bottom)); }
.fh-records-sheet::backdrop { background: rgba(31, 23, 48, .42); }
.fh-records-sheet .fh-records-header { position: sticky; top: 0; z-index: 1; }
.fh-records-sheet-body, .fh-records-sheet .fh-account-options152 { padding: 12px 14px; }
.fh-records-sheet-body h3 { margin: 13px 0 8px; font-size: 14px; }
.fh-account-date-fields152, .fh-records-custom-dates { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.fh-account-date-fields152 { padding: 12px 14px; }
.fh-records-custom-dates { grid-template-columns: repeat(2,minmax(0,1fr)); margin-top: 12px; }
:is(.fh-account-date-fields152,.fh-records-custom-dates) label { display: grid; gap: 4px; color: var(--records-muted); font-size: 12px; min-width: 0; }
:is(.fh-account-date-fields152 select,.fh-records-custom-dates input) { box-sizing: border-box; width: 100%; min-width: 0; min-height: 43px; padding: 6px; border: 1px solid var(--records-line); border-radius: 9px; background: var(--records-bg); color: var(--records-ink); font: inherit; }
