/* Standalone balance history; the host removes the bottom dock on this route. */
.app-shell.history-screen { padding-top: calc(18px + var(--tg-safe-top)); padding-bottom: calc(28px + max(env(safe-area-inset-bottom), var(--tg-safe-bottom))); }
.app-shell.history-screen > .app-header { display: none; }
.history-screen #main { display: block; height: auto; min-height: 0; }
.history-page { color: #f5f6fa; }
.history-page-heading { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; }
.history-page-heading h1 { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: -.5px; }
.history-back { display: grid; place-items: center; flex: 0 0 44px; width: 44px; min-height: 40px; height: 40px; padding: 0; border: 1px solid #ffffff0b; border-radius: 13px; background: #23262d; color: #cbd2df; }
.history-back svg { width: 23px; height: 23px; }
.history-back:active:not(:disabled) { transform: none; opacity: .8; }
.history-filters { padding: 0; border: 0; border-radius: 0; background: transparent; }
.history-filter-top { display: flex; align-items: center; gap: 8px; }
.history-kind-filters { display: grid; grid-template-columns: minmax(48px,.65fr) minmax(0,1.3fr) minmax(0,1fr); flex: 1; min-width: 0; gap: 0; padding:4px; border-radius:var(--ui-radius-control,12px); background:var(--ui-control,#252930); }
.history-kind-filters button { min-width: 0; min-height: 32px; padding: 7px 6px; border: 0; border-radius: 8px; background: transparent; color: var(--ui-muted,#a8adba); font-size: 13px; font-weight: 650; line-height: 1.3; white-space: normal; overflow-wrap: anywhere; }
.history-kind-filters button[aria-pressed="true"] { background:var(--ui-control-selected,#343941); color:var(--ui-text,#fff); }
.history-kind-filters button:active:not(:disabled) { transform: none; }
.history-sort { display: grid; place-items: center; flex: 0 0 40px; width: 40px; min-height: 40px; height: 40px; padding: 0; border: 1px solid #ffffff0b; border-radius: 9px; background: #23262d; color: #a8adba; }
.history-sort svg { width: 20px; height: 20px; }
.history-sort[aria-pressed="true"] { color: #209aff; border-color: #209aff40; }
.history-sort[data-sort="amount-asc"] svg { transform: scaleY(-1); }
.history-sort:active:not(:disabled) { transform: none; }
.history-filter-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; margin-top: 8px; }
.history-filter-bottom > .wc-control { width: 150px; }
.history-filter-bottom > select { width: 150px; min-width: 0; min-height: 40px; padding: 7px 11px; border: 1px solid #ffffff0b; border-radius: 9px; background: #23262d; color: #d2d8e4; font-size: 13px; }
.history-filter-bottom .wc-control > .wc-trigger { min-height: 40px; padding: 7px 10px; border-radius: 9px; background: #23262d; font-size: 13px; }
.history-reset { min-width: 0; min-height: 40px; padding: 6px 0 6px 10px; background: transparent; color: #209aff; font-size: 13px; overflow-wrap: anywhere; }
.history-reset[hidden], .history-custom-range[hidden] { display: none; }
.history-date-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 14px; }
.history-date-fields > label { display: grid; gap: 7px; min-width: 0; color: #a8b1c4; font-size: 12px; }
.history-date-fields input { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 10px 11px; border: 1px solid #414752; border-radius: 10px; background: #191b1f; color: #d2d8e4; font-size: 16px; color-scheme: dark; }
.history-date-fields .wc-control > .wc-trigger { min-height: 44px; gap: 7px; padding: 10px 11px; border-color: #414752; border-radius: 10px; background: #191b1f; font-size: 13px; }
.history-date-fields .wc-icon { width: 16px; height: 16px; }
.history-range-error { margin: 10px 0 0; color: #ed8892; font-size: 12px; line-height: 1.45; }
.history-range-error:empty { display: none; }
.history-results { margin-top: 20px; }
.history-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin: 0 0 20px; }
.history-summary > div { min-width: 0; }
.history-summary dt { margin: 0 0 7px; color: #98a2b3; font-size: 12px; line-height: 1.4; }
.history-summary dd { margin: 0; color: #f5f6fa; font-size: clamp(23px, 7.5vw, 30px); line-height: 1.15; font-weight: 650; letter-spacing: -.7px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.history-summary dd.history-summary-incoming { color: #209aff; }
.history-summary dd span { font-size: .65em; letter-spacing: 0; }
.history-day + .history-day { margin-top: 20px; }
.history-day h2 { margin: 0 0 10px 2px; color: #a8adba; font-size: 13px; font-weight: 550; line-height: 1.4; }
.history-entries { padding: 0 14px; margin: 0; list-style: none; border: 1px solid #ffffff0b; border-radius: 16px; background: #1d1f23; }
.history-entry { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 17px 0; }
.history-entry + .history-entry { border-top: 1px solid #ffffff09; }
.history-entry-copy { flex: 1; min-width: 0; }
.history-entry-copy strong { display: block; font-size: 13px; font-weight: 550; line-height: 1.45; overflow-wrap: anywhere; }
.history-entry-copy p { margin: 5px 0 0; color: #a8adba; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.history-entry-amount { flex: 0 0 auto; max-width: 50%; color: #a8b1c4; font-size: 14px; font-weight: 650; line-height: 1.45; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.history-entry-amount.is-positive { color: #209aff; }
.history-entry-amount.is-negative { color: #e8ecf4; }
.history-empty { display: grid; place-items: center; gap: 9px; min-height: 180px; padding: 28px 20px; border: 1px solid #ffffff0b; border-radius: 17px; background: #1d1f23; text-align: center; }
.history-empty strong { font-size: 16px; font-weight: 600; }
.history-empty p { max-width: 240px; color: #98a2b3; font-size: 13px; line-height: 1.5; }

.dock-wrap[hidden] { display: none; }
.app-shell.detail-screen { padding-bottom: calc(28px + max(env(safe-area-inset-bottom), var(--tg-safe-bottom))); min-height: 100dvh; }
