.history-body {
  min-width: 0;
  background-attachment: scroll;
}

dialog::backdrop {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.history-main-content {
  display: flex;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 1920px;
  flex-direction: column;
}

.history-page-header {
  align-items: flex-end;
}

.history-page-description {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.history-day-panel {
  display: flex;
  min-width: 0;
  flex: 1 0 auto;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: linear-gradient(145deg, var(--surface-raised), var(--surface));
  box-shadow: var(--shadow);
}

.history-date-picker-open {
  display: grid;
  min-width: 218px;
  min-height: 62px;
  flex: 0 0 auto;
  grid-template-columns: 29px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  padding: 8px 13px;
  border: 1px solid rgba(var(--accent-rgb), 0.36);
  border-radius: 14px;
  color: var(--accent-strong);
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.13), rgba(var(--accent-rgb), 0.055));
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.history-date-picker-icon {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 9px;
  background: rgba(var(--accent-rgb), 0.12);
}

.history-date-picker-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.history-date-picker-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.history-date-picker-copy strong,
.history-date-picker-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-date-picker-copy strong {
  font-size: 12px;
  font-weight: 900;
}

.history-date-picker-copy small {
  color: rgba(210, 224, 201, 0.7);
  font-size: 10px;
  font-weight: 700;
}

.history-date-picker-arrow {
  color: rgba(var(--accent-rgb), 0.82);
  font-size: 18px;
  line-height: 1;
  text-align: center;
}

.history-date-picker-open:hover {
  border-color: rgba(var(--accent-rgb), 0.5);
  background: rgba(var(--accent-rgb), 0.13);
}

.history-date-picker-open.history-pointer-focus-suppressed:focus,
.history-date-picker-open.history-pointer-focus-suppressed:focus-visible {
  outline: none;
}

.history-day-panel {
  margin-top: 18px;
  overflow: hidden;
}

.history-panel-heading {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.history-panel-heading h2 {
  margin: 0;
  font-size: 19px;
}

.history-panel-heading .section-kicker {
  margin-bottom: 6px;
}

.history-panel-heading > span {
  flex: 0 0 auto;
  color: var(--subtle);
  font-size: 11px;
}

.history-account-heading {
  padding: 19px;
  border-bottom: 1px solid var(--border);
}

.history-account-toolbar {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(218px, 250px) minmax(168px, 205px) minmax(300px, 1fr);
  align-items: end;
  gap: 12px;
  padding: 12px 19px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(2, 8, 9, 0.16);
}

.history-account-toolbar .history-date-picker-open,
.history-account-toolbar .history-account-sort,
.history-account-toolbar .history-account-search {
  width: 100%;
}

.history-control-label {
  color: var(--subtle);
  font-size: 9px;
  font-weight: 800;
}

.history-day-status {
  max-width: min(340px, 44vw);
  overflow: hidden;
  flex: 0 0 auto;
  color: var(--subtle);
  font-size: 11px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-account-sort {
  display: grid;
  min-width: 168px;
  gap: 5px;
  color: var(--subtle);
  font-size: 9px;
  font-weight: 800;
}

.history-account-sort[hidden] {
  display: none;
}

.history-account-sort select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 34px 0 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.17);
  border-radius: 12px;
  color: var(--text);
  background-color: rgba(3, 8, 9, 0.72);
  color-scheme: dark;
  cursor: pointer;
}

.history-account-sort option,
.history-trend-card .trend-compare-picker option {
  color: #f0f6f4;
  background: #091617;
}

.history-account-sort option:checked,
.history-trend-card .trend-compare-picker option:checked {
  color: var(--accent-dark);
  background: var(--accent);
}

.history-trend-card .trend-compare-picker select {
  color-scheme: dark;
}

.history-account-sort select:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.58);
  outline: 3px solid rgba(var(--accent-rgb), 0.08);
  outline-offset: 1px;
}

.history-account-sort select:disabled {
  cursor: wait;
  opacity: 0.58;
}

.history-account-search {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 5px;
  margin: 0;
}

.history-account-search[hidden] {
  display: none;
}

.history-account-search-field {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 42px;
  align-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.17);
  border-radius: 12px;
  background: rgba(3, 8, 9, 0.5);
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.history-account-search-field:focus-within {
  border-color: rgba(var(--accent-rgb), 0.54);
  background: rgba(3, 8, 9, 0.72);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.07);
}

.history-account-search-icon {
  position: relative;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin-left: 13px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
}

.history-account-search-icon::after {
  position: absolute;
  right: -4px;
  bottom: -3px;
  width: 6px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--muted);
  content: '';
  transform: rotate(45deg);
  transform-origin: left center;
}

.history-account-search input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0 8px 0 11px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: 13px;
}

.history-account-search input::-webkit-search-cancel-button {
  display: none;
}

.history-account-search input::placeholder {
  color: var(--subtle);
}

.history-account-search input:disabled {
  cursor: wait;
  opacity: 0.56;
}

.history-account-search-clear {
  min-width: 48px;
  min-height: 32px;
  flex: 0 0 auto;
  margin-right: 5px;
  padding: 0 9px;
  border: 0;
  border-radius: 9px;
  color: var(--accent-strong);
  background: rgba(var(--accent-rgb), 0.08);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.history-account-search-clear[hidden] {
  display: none;
}

.history-search-status {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-search-status[hidden] {
  display: none;
}

.history-date-strip {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.history-date-dialog {
  --history-date-picker-panel-height: min(76dvh, 620px);
  width: min(1280px, calc(100vw - 48px));
  height: var(--history-date-picker-panel-height);
  max-width: none;
  max-height: calc(100dvh - 34px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 19px;
  color: var(--text);
  background: rgba(8, 13, 15, 0.985);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.68);
}

.history-date-dialog::backdrop {
  background: transparent;
  backdrop-filter: none;
}

.history-date-dialog:not([open]) {
  display: none;
}

.history-date-dialog-card {
  display: flex;
  height: var(--history-date-picker-panel-height);
  max-height: var(--history-date-picker-panel-height);
  flex-direction: column;
  overflow: hidden;
}

.history-date-dialog-header {
  display: flex;
  min-width: 0;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.history-date-dialog-header h2 {
  margin: 0;
  font-size: 20px;
}

.history-date-dialog-header .section-kicker {
  margin-bottom: 5px;
}

.history-date-dialog-header #history-date-status {
  display: block;
  margin-top: 5px;
  color: var(--subtle);
  font-size: 10px;
}

.history-date-months {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
  overflow-x: auto;
  padding: 12px 22px 0;
  scrollbar-width: thin;
}

.history-date-month {
  position: relative;
  z-index: 1;
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: rgba(218, 227, 229, 0.82);
  background: rgba(3, 8, 9, 0.5);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.history-date-month::before {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: rgba(194, 205, 207, 0.36);
  content: "";
}

.history-date-month[aria-selected="true"] {
  border-color: rgba(100, 210, 255, 0.34);
  color: #64d2ff;
  background: transparent;
}

.history-date-month[aria-selected="true"]::before {
  background: #0a84ff;
  box-shadow: 0 0 12px rgba(10, 132, 255, 0.72);
}

.history-date-dialog .history-date-strip {
  min-height: 0;
  max-height: min(58dvh, 520px);
  flex: 0 1 auto;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
  margin-top: 0;
  padding: 18px 22px 22px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  contain: layout paint;
}

@supports (view-transition-name: history-date-grid) {
  :root {
    view-transition-name: none;
  }

  .history-date-dialog .history-date-strip {
    view-transition-name: history-date-grid;
  }

  ::view-transition-group(history-date-grid) {
    animation: none;
  }

  ::view-transition-old(history-date-grid),
  ::view-transition-new(history-date-grid) {
    mix-blend-mode: normal;
    backface-visibility: hidden;
  }

  html[data-history-month-direction="next"]::view-transition-old(history-date-grid) {
    animation: history-month-leave-next 230ms cubic-bezier(0.4, 0, 1, 1) both;
  }

  html[data-history-month-direction="next"]::view-transition-new(history-date-grid) {
    animation: history-month-enter-next 320ms cubic-bezier(0.16, 0.82, 0.2, 1) both;
  }

  html[data-history-month-direction="previous"]::view-transition-old(history-date-grid) {
    animation: history-month-leave-previous 230ms cubic-bezier(0.4, 0, 1, 1) both;
  }

  html[data-history-month-direction="previous"]::view-transition-new(history-date-grid) {
    animation: history-month-enter-previous 320ms cubic-bezier(0.16, 0.82, 0.2, 1) both;
  }
}

@keyframes history-month-leave-next {
  to { opacity: 0; transform: translate3d(-22px, 0, 0) scale(0.992); }
}

@keyframes history-month-enter-next {
  from { opacity: 0; transform: translate3d(24px, 0, 0) scale(0.992); }
}

@keyframes history-month-leave-previous {
  to { opacity: 0; transform: translate3d(22px, 0, 0) scale(0.992); }
}

@keyframes history-month-enter-previous {
  from { opacity: 0; transform: translate3d(-24px, 0, 0) scale(0.992); }
}

.history-date-months.ui-pointer-nav > .ui-nav-pointer-indicator {
  z-index: 4;
  border-radius: 999px;
  border-color: rgba(100, 210, 255, 0.44);
  background: rgba(100, 210, 255, 0.12);
}

.history-date-strip.ui-pointer-nav > .ui-nav-pointer-indicator {
  z-index: 4;
  border-radius: 12px;
  border-color: rgba(100, 210, 255, 0.42);
  background:
    linear-gradient(110deg, rgba(100, 210, 255, 0.15), transparent 55%),
    rgba(10, 132, 255, 0.07);
}

.history-date-months.ui-pointer-nav > .history-date-month:hover,
.history-date-strip.ui-pointer-nav > .history-date-button:hover:not(:disabled) {
  border-color: transparent;
  background: transparent;
}

.history-date-dialog .history-date-button,
.history-date-dialog .history-date-skeleton {
  min-height: 70px;
}

.history-date-button {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 72px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  align-items: center;
  gap: 5px 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(3, 8, 9, 0.3);
  cursor: pointer;
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.history-date-button::after {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(194, 205, 207, 0.3);
  content: "";
}

.history-date-button:hover:not(:disabled) {
  border-color: rgba(var(--accent-rgb), 0.24);
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.045);
}

.history-date-button[aria-selected="true"] {
  border-color: rgba(100, 210, 255, 0.34);
  color: #64d2ff;
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(100, 210, 255, 0.06);
}

.history-date-button[aria-selected="true"]::after {
  background: #0a84ff;
  box-shadow: 0 0 12px rgba(10, 132, 255, 0.72);
}

.history-date-button:not(:disabled):not([aria-selected="true"]) {
  color: rgba(226, 235, 236, 0.9);
}

.history-date-button:not(:disabled) .history-date-secondary {
  color: rgba(183, 198, 200, 0.72);
}

.history-date-button:disabled {
  color: rgba(178, 191, 193, 0.58);
  background: rgba(2, 5, 6, 0.28);
  cursor: not-allowed;
  opacity: 1;
}

.history-date-button:disabled .history-date-secondary {
  color: rgba(151, 166, 168, 0.52);
}

.history-date-primary,
.history-date-secondary,
.history-date-count {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-date-primary {
  color: inherit;
  font-size: 12px;
  font-weight: 850;
}

.history-date-secondary {
  grid-column: 1;
  color: var(--subtle);
  font-size: 9px;
}

.history-date-count {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: inherit;
  font-size: 10px;
  font-weight: 800;
}

.history-date-skeleton {
  min-height: 72px;
  border-radius: 12px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.025) 25%, rgba(255, 255, 255, 0.065) 48%, rgba(255, 255, 255, 0.025) 72%);
  background-size: 260% 100%;
  animation: history-skeleton 1.25s linear infinite;
}

@keyframes history-skeleton {
  to { background-position: -160% 0; }
}

.history-day-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 19px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.08);
}

.history-day-summary[hidden] {
  display: none;
}

.history-summary-metric {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.018);
}

.history-summary-metric span,
.history-summary-metric strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-summary-metric span {
  color: var(--subtle);
  font-size: 9px;
}

.history-summary-metric strong {
  margin-top: 6px;
  color: var(--text);
  font-size: 18px;
}

.history-feedback {
  display: grid;
  min-height: 290px;
  place-items: center;
  align-content: center;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

#history-loading-state,
#history-error-state,
#history-empty-state {
  flex: 1 0 auto;
  min-height: clamp(340px, 52vh, 620px);
}

.history-feedback[hidden] {
  display: none;
}

.history-feedback strong {
  margin-top: 13px;
  color: var(--text);
  font-size: 16px;
}

.history-feedback p {
  max-width: 420px;
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.65;
}

.history-loading-state {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 44%, rgba(var(--accent-rgb), 0.055), transparent 34%),
    linear-gradient(180deg, rgba(7, 16, 17, 0.18), rgba(7, 16, 17, 0.46));
}

.history-loading-spinner {
  width: 32px;
  height: 32px;
}

.history-loading-state strong {
  margin-top: 15px;
  font-size: clamp(16px, 2vw, 20px);
}

.history-loading-state p {
  margin-top: 7px;
  color: var(--subtle);
  font-size: 11px;
}

.history-loading-progress {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 17px;
}

.history-loading-progress i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.22;
  animation: history-loading-step 1.2s ease-in-out infinite;
}

.history-loading-progress i:nth-child(2) {
  animation-delay: 160ms;
}

.history-loading-progress i:nth-child(3) {
  animation-delay: 320ms;
}

.history-account-list:not([hidden]),
#history-error-state:not([hidden]),
#history-empty-state:not([hidden]) {
  animation: history-content-enter 170ms ease-out both;
}

@keyframes history-loading-step {
  50% {
    transform: translateY(-3px);
    opacity: 0.9;
  }
}

@keyframes history-content-enter {
  from {
    transform: translateY(4px);
    opacity: 0;
  }
}

.history-feedback-symbol {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 50%;
  color: var(--accent-strong);
  background: rgba(var(--accent-rgb), 0.06);
  font-size: 18px;
  font-weight: 900;
}

.history-error-state .history-feedback-symbol {
  border-color: rgba(255, 87, 108, 0.24);
  color: #ff7183;
  background: rgba(255, 87, 108, 0.08);
}

.history-retry-button,
.history-expand-button,
.history-trend-button,
.history-dialog-close {
  min-height: 40px;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 11px;
  color: var(--accent-strong);
  background: rgba(var(--accent-rgb), 0.07);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.history-retry-button {
  margin-top: 16px;
  padding: 0 18px;
}

.history-account-list {
  display: grid;
  min-width: 0;
  gap: 10px;
  padding: 10px 12px 14px;
}

.history-account-list[hidden] {
  display: none;
}

.history-account-load-more {
  display: block;
  min-width: min(320px, calc(100% - 28px));
  min-height: 42px;
  margin: 14px auto 18px;
  padding: 8px 18px;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 999px;
  color: var(--accent-strong);
  background: rgba(8, 20, 19, 0.82);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.history-account-load-more[hidden] {
  display: none;
}

.history-account-card {
  position: relative;
  display: grid;
  min-width: 0;
  content-visibility: auto;
  contain: layout paint style;
  contain-intrinsic-block-size: auto 164px;
  grid-template-areas:
    "rank identity battle metrics actions"
    "details details details details details";
  grid-template-columns: 76px minmax(220px, 1.05fr) minmax(138px, 0.58fr) minmax(520px, 1.68fr) 174px;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  overflow: clip;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.026), rgba(255, 255, 255, 0.012));
  isolation: isolate;
}

.history-account-card:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
}

.history-account-card::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 22% 0%, rgba(var(--accent-rgb), 0.075), transparent 48%);
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
  will-change: opacity;
}

.history-account-card > * {
  position: relative;
  z-index: 1;
}

.history-account-card[hidden] {
  display: none;
}

.is-history-embedded {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  background-attachment: scroll;
  touch-action: pan-x pan-y;
}

html.is-history-embedded-root {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
}

.is-history-embedded .app-shell {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}

.is-history-embedded .mobile-menu-button,
.is-history-embedded .sidebar,
.is-history-embedded .sidebar-backdrop,
.is-history-embedded .history-page-header {
  display: none !important;
}

.is-history-embedded .history-main-content {
  display: block;
  width: 100%;
  min-height: 0;
  max-width: none;
  padding: 8px 12px 12px;
}

.is-history-embedded .history-date-dialog[open] {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(18px, 4dvh, 34px) 10px 10px;
  place-items: start center;
  border: 0;
  border-radius: 0;
  background: rgba(1, 3, 4, 0.54);
  box-shadow: none;
}

.is-history-embedded .history-date-dialog-card {
  width: min(1040px, 100%);
  height: min(76dvh, 620px);
  max-height: min(76dvh, 620px);
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 17px;
  background: rgba(8, 13, 15, 0.99);
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.58);
}

.is-history-embedded .history-account-toolbar {
  grid-template-columns: minmax(218px, 300px);
  justify-content: end;
  gap: 8px;
  padding: 8px 16px 10px;
}

.is-history-embedded .history-day-panel {
  min-height: calc(100dvh - 20px);
  flex: none;
  margin-top: 0;
  margin-bottom: 0;
}

.is-history-embedded .history-account-heading {
  padding: 13px 16px 11px;
}

.is-history-embedded .history-day-summary {
  padding: 9px 16px;
}

.is-history-embedded .history-summary-metric {
  padding: 8px 10px;
}

@media (min-width: 681px) {
  .is-history-embedded .history-date-picker-open {
    min-height: 54px;
  }
}

.is-history-embedded .history-account-card {
  grid-template-areas:
    "identity battle metrics actions"
    "details details details details";
  grid-template-columns: minmax(220px, 1.1fr) minmax(150px, 0.62fr) minmax(360px, 1.5fr) 174px;
}

.is-history-embedded .history-account-rank {
  display: none;
}

.history-account-card:hover::before {
  opacity: 1;
}

.history-account-card.is-expanded {
  border-color: rgba(var(--accent-rgb), 0.16);
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.035), rgba(255, 255, 255, 0.014));
}

.history-account-rank {
  display: grid;
  grid-area: rank;
  min-width: 0;
  justify-items: center;
  color: var(--subtle);
  font-size: 9px;
  line-height: 1.2;
}

.history-account-rank strong {
  color: var(--text);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.history-account-rank.is-top strong {
  color: var(--accent-strong);
  text-shadow: 0 0 16px rgba(var(--accent-rgb), 0.28);
}

@media (min-width: 681px) {
  .history-account-rank span {
    white-space: nowrap;
  }
}

.history-account-identity {
  display: flex;
  grid-area: identity;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.history-account-avatar-shell {
  position: relative;
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(var(--accent-rgb), 0.36);
  border-radius: 50%;
  color: var(--accent-strong);
  background: rgba(var(--accent-rgb), 0.06);
  font-size: 16px;
  font-weight: 900;
}

.history-account-avatar {
  display: block;
  width: 100%;
  height: 100%;
  grid-area: 1 / 1;
  object-fit: cover;
}

.history-account-avatar-fallback {
  grid-area: 1 / 1;
}

.history-account-copy {
  min-width: 0;
}

.history-account-name-row {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 7px;
}

.history-account-name {
  min-width: 0;
  overflow: hidden;
  margin: 0;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-status-badge {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  padding: 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 8px;
  font-weight: 850;
  white-space: nowrap;
}

.history-status-badge.is-live {
  border-color: rgba(255, 78, 101, 0.28);
  color: #ff8594;
  background: rgba(255, 78, 101, 0.09);
}

.history-status-badge.is-partial {
  border-color: rgba(255, 190, 72, 0.2);
  color: #ffd286;
  background: rgba(255, 190, 72, 0.07);
}

.history-account-id,
.history-profile-facts {
  overflow: hidden;
  margin: 4px 0 0;
  color: var(--subtle);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-rank-story {
  display: grid;
  grid-area: battle;
  min-width: 0;
  gap: 5px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.history-rank-story span {
  color: var(--subtle);
  font-size: 9px;
}

.history-rank-story .history-rank-label {
  color: rgba(208, 220, 221, 0.78);
  font-weight: 720;
}

.history-rank-story .history-rank-timeline {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.history-rank-story strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-account-metrics {
  display: grid;
  grid-area: metrics;
  min-width: 0;
  grid-template-columns:
    minmax(76px, 0.92fr)
    minmax(82px, 1.08fr)
    minmax(76px, 1fr)
    minmax(78px, 1.02fr)
    minmax(100px, 1.22fr)
    minmax(80px, 1.02fr);
}

.history-account-metric {
  min-width: 0;
  padding: 2px 6px;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.history-account-metric:first-child {
  border-left: 0;
}

.history-account-metric span,
.history-account-metric strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-account-metric span {
  color: var(--subtle);
  font-size: 8px;
}

.history-account-metric strong {
  margin-top: 5px;
  color: var(--text);
  font-size: 13px;
}

.history-card-actions {
  display: grid;
  grid-area: actions;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.history-profile-link,
.history-expand-button {
  display: inline-flex;
  min-width: 0;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid rgba(var(--accent-rgb), 0.15);
  border-radius: 11px;
  color: var(--accent-strong);
  background: rgba(var(--accent-rgb), 0.055);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.history-profile-link.is-disabled {
  color: var(--subtle);
  cursor: default;
  opacity: 0.54;
}

.history-expand-button::after {
  margin-left: 5px;
  content: "⌄";
  font-size: 14px;
  transition: transform 150ms ease;
}

.history-expand-button[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.history-account-details {
  grid-area: details;
  min-width: 0;
  margin: 5px 0 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.16);
}

.history-account-details[hidden] {
  display: none;
}

.history-session-list {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.history-session-loading {
  min-height: 54px;
  margin: 0;
  padding: 18px;
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(2, 6, 7, 0.28);
  font-size: 11px;
  text-align: center;
}

.history-session-row {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 11px;
  background: rgba(2, 6, 7, 0.34);
}

.history-session-card-header {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.history-session-header-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.history-session-more-button {
  display: none;
  width: auto;
  min-width: 0;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 9px;
  font-weight: 760;
}

.history-session-metrics {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(12, minmax(64px, 1fr));
  align-items: center;
  gap: 7px;
}

.history-session-heading {
  min-width: 0;
}

.history-session-title-row,
.history-trend-title-row {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.history-session-title-row > strong,
.history-trend-title-row > h2 {
  min-width: 0;
}

.history-session-title-row > strong {
  flex: 1 1 auto;
}

.history-abnormal-end-badge {
  position: relative;
  width: auto;
  min-width: 0;
  min-height: 0;
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid rgba(255, 92, 114, 0.46);
  border-radius: 999px;
  color: #ff9aa7;
  background: rgba(255, 92, 114, 0.105);
  box-shadow: inset 0 0 0 1px rgba(255, 160, 173, 0.035);
  font-size: 8px;
  font-weight: 820;
  line-height: 1.2;
  white-space: nowrap;
  cursor: help;
}

.history-status-badge.is-abnormal {
  border-color: rgba(255, 166, 77, 0.36);
  color: #ffc27c;
  background: rgba(255, 139, 43, 0.1);
}

.history-account-card.is-abnormal-filter-match {
  border-color: rgba(255, 166, 77, 0.32);
  box-shadow: inset 3px 0 rgba(255, 166, 77, 0.64), 0 20px 54px rgba(0, 0, 0, 0.2);
}

.history-session-row.is-suspected-abnormal-end {
  border-color: rgba(255, 166, 77, 0.4);
  background: linear-gradient(100deg, rgba(255, 139, 43, 0.09), rgba(255, 255, 255, 0.018));
  box-shadow: inset 3px 0 rgba(255, 166, 77, 0.68);
}

.history-search-empty-state.is-abnormal-filter-empty {
  min-height: 0;
  padding-block: 22px;
}

.history-trend-title-row .history-abnormal-end-badge {
  padding: 4px 8px;
  font-size: 9px;
}

.history-abnormal-end-badge[hidden] {
  display: none;
}

.history-abnormal-end-badge::after {
  position: absolute;
  z-index: 20;
  top: calc(100% + 7px);
  right: 0;
  width: min(238px, calc(100vw - 34px));
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #eef4f7;
  background: rgba(8, 13, 15, 0.98);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
  content: attr(data-tip);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.45;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.history-abnormal-end-badge:hover::after,
.history-abnormal-end-badge:focus-visible::after,
.history-abnormal-end-badge:focus::after {
  opacity: 1;
  transform: translateY(0);
}

.history-session-heading strong,
.history-session-heading span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-session-heading strong {
  color: var(--text);
  font-size: 11px;
}

.history-session-heading span {
  margin-top: 4px;
  color: var(--subtle);
  font-size: 8px;
}

.history-session-metric {
  min-width: 0;
}

.history-session-metric span,
.history-session-metric strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-session-metric span {
  color: var(--subtle);
  font-size: 8px;
}

.history-session-metric strong {
  margin-top: 4px;
  color: var(--text);
  font-size: 10px;
}

.history-trend-button {
  width: auto;
  min-width: 0;
  min-height: 32px;
  padding: 0 11px;
}

.history-trend-button:disabled {
  color: var(--subtle);
  cursor: not-allowed;
  opacity: 0.5;
}

.history-trend-dialog {
  width: min(1060px, calc(100vw - 34px));
  max-width: none;
  max-height: calc(100dvh - 34px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), 0.16);
  border-radius: 19px;
  color: var(--text);
  background: rgba(8, 13, 15, 0.98);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.68);
}

.history-trend-dialog::backdrop {
  background: rgba(1, 3, 4, 0.92);
  backdrop-filter: none;
}

.history-trend-dialog:not([open]) {
  display: none;
}

.history-trend-card {
  min-width: 0;
  max-height: calc(100dvh - 36px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.history-trend-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 13, 15, 0.96);
  backdrop-filter: none;
}

.history-trend-header h2 {
  margin: 0;
  font-size: 20px;
}

.history-trend-header .section-kicker {
  margin-bottom: 5px;
}

.history-trend-header p:last-child {
  margin: 6px 0 0;
  color: var(--subtle);
  font-size: 10px;
}

.history-dialog-close {
  width: 42px;
  height: 42px;
  min-height: 42px;
  flex: 0 0 42px;
  padding: 0;
  font-size: 25px;
  line-height: 1;
}

.history-trend-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.history-trend-summary > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(76px, auto);
  grid-template-rows: auto auto;
  gap: 3px 8px;
  min-width: 0;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.022);
}

.history-trend-summary > .trend-average-acceptance-summary {
  border-color: rgba(255, 194, 99, 0.3);
  background:
    linear-gradient(135deg, rgba(255, 194, 99, 0.105), rgba(255, 194, 99, 0.025)),
    rgba(255, 255, 255, 0.022);
  box-shadow: inset 0 0 0 1px rgba(255, 194, 99, 0.045);
}

.history-trend-summary > .trend-average-acceptance-summary span {
  color: rgba(255, 217, 153, 0.82);
}

.history-trend-summary > .trend-average-acceptance-summary strong {
  color: #ffc263;
}

.history-trend-summary span,
.history-trend-summary strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend-acceptance-summary small {
  display: block;
  margin-top: 4px;
  color: rgba(200, 207, 218, 0.66);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.25;
}

.trend-acceptance-summary small b {
  color: #ffc263;
  font: inherit;
  font-weight: 850;
}

.history-trend-summary span {
  color: var(--subtle);
  font-size: 9px;
}

.history-trend-summary strong {
  grid-column: 1;
  grid-row: 2;
  margin-top: 2px;
  font-size: 17px;
  text-align: left;
}

.history-trend-summary .trend-metric-comparison,
.history-trend-summary [data-trend-comparison] {
  display: block;
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  margin-top: 0;
  overflow: hidden;
  color: rgba(200, 207, 218, 0.62);
  font-size: 9px;
  font-weight: 720;
  line-height: 1.25;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-trend-summary [data-trend-comparison].is-up {
  color: #75e6ad;
}

.history-trend-summary [data-trend-comparison].is-down {
  color: #ff8f9d;
}

.history-trend-summary [data-trend-comparison].is-stable {
  color: #b8c2cc;
}

.history-rank-summary {
  margin: 0;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  background: rgba(var(--accent-rgb), 0.025);
  font-size: 10px;
}

.history-rank-summary[hidden] {
  display: none;
}

.history-trend-reference {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  padding: 12px 20px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(var(--accent-rgb), 0.018);
}

.history-trend-reference-item {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.024);
}

.history-trend-reference-item > span,
.history-trend-reference-item > strong,
.history-trend-reference-item > p {
  display: block;
  min-width: 0;
}

.history-trend-reference-item > span {
  color: var(--subtle);
  font-size: 9px;
  font-weight: 760;
}

.history-trend-reference-item > strong {
  margin-top: 5px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.history-trend-reference-item > p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.history-trend-reference-item.is-warning {
  border-color: rgba(255, 113, 131, 0.28);
  background: rgba(255, 113, 131, 0.055);
}

.history-trend-reference-item.is-warning > strong {
  color: #ff9aa7;
}

.history-trend-reference-item.is-advice {
  border-color: rgba(var(--accent-rgb), 0.16);
  background: rgba(var(--accent-rgb), 0.035);
}

.history-trend-reference-note {
  grid-column: 1 / -1;
  color: rgba(200, 207, 218, 0.58);
  font-size: 9px;
  line-height: 1.55;
}

.history-chart-shell {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 380px;
  place-items: stretch;
  overflow: hidden;
  cursor: crosshair;
  outline: none;
  touch-action: pan-y;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  background: radial-gradient(circle at 70% 10%, rgba(37, 244, 238, 0.045), transparent 34%), rgba(0, 0, 0, 0.08);
}

.history-chart-shell * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.history-chart-shell:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(37, 244, 238, 0.55);
}

.history-chart {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 380px;
  overflow: visible;
}

.history-grid-line {
  stroke: rgba(255, 255, 255, 0.075);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.history-grid-line.is-baseline {
  stroke: rgba(255, 255, 255, 0.15);
}

.history-axis-label {
  fill: rgba(200, 207, 218, 0.7);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 11px;
  font-weight: 600;
}

.history-chart-area {
  fill: url(#history-area-gradient);
  stroke: none;
  pointer-events: none;
}

.history-chart-line {
  fill: none;
  stroke: #25f4ee;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  filter: url(#history-line-glow);
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}

.history-trend-card > .trend-series-controls {
  padding: 0 20px;
}

.history-trend-card .trend-compare-picker {
  flex: 0 0 auto;
}

.history-trend-card > .trend-independent-scale-note {
  padding: 0 20px 14px;
}

.trend-series-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.8;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}

.trend-milestone-overlay {
  pointer-events: none;
}

.trend-milestone-label-pill,
.trend-milestone-copy-pill {
  fill: rgba(6, 17, 17, 0.88);
  stroke: rgba(255, 113, 131, 0.48);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.history-milestone-label,
.history-milestone-copy {
  fill: #ff7183;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 10px;
  font-weight: 800;
  paint-order: stroke fill;
  stroke: rgba(5, 15, 15, 0.96);
  stroke-linejoin: round;
  stroke-width: 3px;
}

.history-milestone-line {
  stroke: rgba(255, 78, 101, 0.78);
  stroke-width: 1.5;
  stroke-dasharray: 6 5;
  vector-effect: non-scaling-stroke;
}

.history-milestone-marker {
  fill: #ff4e65;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.history-milestone-marker.is-conservative {
  fill: #ffb547;
}

.trend-lane-guide {
  stroke: rgba(255, 255, 255, 0.045);
  stroke-dasharray: 2 6;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.trend-axis-label {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  paint-order: stroke fill;
  stroke: rgba(5, 15, 15, 0.92);
  stroke-linejoin: round;
  stroke-width: 1.6px;
  pointer-events: none;
}

.trend-axis-label.is-middle,
.trend-axis-label.is-interval { opacity: 0.7; }
.trend-axis-label.is-cumulative { fill: #b9ff46; }
.trend-axis-label.is-viewer { fill: #25f4ee; }
.trend-axis-label.is-likes { fill: #ff7183; }
.trend-axis-label.is-acceptance { fill: #ffc263; }

.trend-axis-tick {
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.trend-axis-tick.is-middle,
.trend-axis-tick.is-interval { opacity: 0.5; }
.trend-axis-tick.is-cumulative { stroke: rgba(185, 255, 70, 0.72); }
.trend-axis-tick.is-viewer { stroke: rgba(37, 244, 238, 0.72); }
.trend-axis-tick.is-likes { stroke: rgba(255, 113, 131, 0.72); }
.trend-axis-tick.is-acceptance { stroke: rgba(255, 194, 99, 0.72); }

.history-chart-inspector {
  pointer-events: none;
}

.history-chart-crosshair {
  stroke: rgba(255, 255, 255, 0.58);
  stroke-dasharray: 4 4;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.history-chart-marker-halo {
  fill: rgba(37, 244, 238, 0.2);
  stroke: rgba(37, 244, 238, 0.35);
  stroke-width: 1;
}

.history-chart-marker {
  fill: #fff;
  stroke: #25f4ee;
  stroke-width: 3;
}

.history-chart-tooltip {
  position: absolute;
  z-index: 4;
  min-width: 118px;
  padding: 9px 10px;
  border: 1px solid rgba(37, 244, 238, 0.25);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(8, 11, 16, 0.95);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
  font-size: 10px;
  pointer-events: none;
  backdrop-filter: blur(10px);
}

.history-chart-tooltip[hidden] {
  display: none;
}

.history-chart-tooltip > span {
  display: block;
  margin-bottom: 4px;
  white-space: nowrap;
}

.history-chart-tooltip > div {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.history-chart-tooltip strong {
  color: #fff;
  font-size: 17px;
}

.history-chart-tooltip small {
  color: #25f4ee;
  font-size: 10px;
}

.trend-tooltip-row.is-average-acceptance {
  margin-top: 2px;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 194, 99, 0.2);
}

.trend-tooltip-row.is-average-acceptance i {
  border: 1px solid var(--series-color);
  background: transparent;
}

.trend-tooltip-row.is-average-acceptance small,
.trend-tooltip-row.is-average-acceptance strong {
  color: #ffc263 !important;
}

.history-chart-feedback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 24px;
  color: var(--muted);
  background: rgba(8, 13, 15, 0.76);
  text-align: center;
  backdrop-filter: blur(3px);
}

.history-chart-feedback[hidden] {
  display: none;
}

.history-chart-feedback strong {
  margin-top: 13px;
  color: var(--text);
  font-size: 15px;
}

.history-chart-feedback p {
  max-width: 440px;
  margin: 7px 0 0;
  font-size: 11px;
  line-height: 1.65;
}

html.history-dialog-open {
  overflow: hidden;
  scrollbar-gutter: stable;
}

html.history-date-dialog-open {
  overflow: hidden;
  scrollbar-gutter: stable;
}

body.history-dialog-open:not(.is-history-embedded) {
  position: fixed;
  top: var(--history-dialog-page-scroll-offset, 0);
  right: 0;
  left: 0;
  width: var(--history-dialog-layout-width, 100%);
  max-width: none;
  overflow: hidden;
}

body.history-date-dialog-open:not(.is-history-embedded) {
  position: fixed;
  top: var(--history-date-dialog-page-scroll-offset, 0);
  right: 0;
  left: 0;
  width: var(--history-dialog-layout-width, 100%);
  max-width: none;
  overflow: hidden;
}

body.is-history-embedded.history-dialog-open .app-shell {
  overflow: hidden;
}

body.is-history-embedded.history-date-dialog-open .app-shell {
  overflow: hidden;
}

@media (min-width: 901px) {
  .history-body .sidebar {
    background: rgba(7, 13, 15, 0.96);
    backdrop-filter: none;
  }
}

@media (max-width: 1520px) {
  .history-account-card {
    grid-template-areas:
      "rank identity identity actions"
      "rank battle metrics actions"
      "details details details details";
    grid-template-columns: 74px minmax(150px, 0.6fr) minmax(520px, 1.62fr) 174px;
  }

  .history-rank-story {
    padding-top: 7px;
    padding-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 0;
  }
}

@media (max-width: 1100px) {
  .history-account-toolbar {
    grid-template-columns: minmax(218px, 1fr) minmax(168px, 0.72fr);
  }

  .history-account-search {
    grid-column: 1 / -1;
  }

  .history-account-card {
    grid-template-areas:
      "rank identity actions"
      "rank battle battle"
      "metrics metrics metrics"
      "details details details";
    grid-template-columns: 74px minmax(0, 1fr) 174px;
    gap: 10px;
  }

  .is-history-embedded .history-account-card {
    grid-template-areas:
      "identity actions"
      "battle battle"
      "metrics metrics"
      "details details";
    grid-template-columns: minmax(0, 1fr) 174px;
  }

  .history-rank-story {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
  }

  .history-session-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .history-session-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .history-session-heading {
    grid-column: 1 / -1;
  }

  .history-trend-button {
    min-height: 44px;
  }
}

@media (max-width: 900px) {
  .history-date-dialog .history-date-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .history-account-card {
    grid-template-areas:
      "rank identity actions"
      "battle battle battle"
      "metrics metrics metrics"
      "details details details";
    grid-template-columns: 74px minmax(0, 1fr) 174px;
    gap: 10px;
  }

  .history-rank-story {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
  }

  .history-session-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .history-session-heading {
    grid-column: 1 / -1;
  }

  .history-trend-button {
    min-height: 44px;
  }
}

@media (max-width: 680px) {
  .trend-series-controls button {
    min-height: 44px;
  }

  .history-trend-card .trend-compare-picker {
    min-height: 44px;
  }

  .history-main-content {
    padding-right: 0;
    padding-left: 0;
  }

  .history-page-header {
    padding-right: 14px;
    padding-left: 14px;
  }

  .history-page-description {
    font-size: 11px;
  }

  .history-day-panel {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .history-date-picker-open {
    width: 100%;
    min-width: 0;
    min-height: 58px;
    padding-inline: 13px;
  }

  .history-panel-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .history-date-dialog {
    --history-date-picker-panel-height: min(calc(100dvh - 24px), 760px);
    width: min(560px, calc(100vw - 24px));
    height: var(--history-date-picker-panel-height);
    max-width: calc(100vw - 24px);
    max-height: min(calc(100dvh - 24px), 760px);
    margin: auto;
    border: 1px solid rgba(var(--accent-rgb), 0.24);
    border-radius: 19px;
  }

  .is-history-embedded .history-date-dialog[open] {
    padding: max(12px, env(safe-area-inset-top)) 10px max(12px, env(safe-area-inset-bottom));
    place-items: center;
  }

  .history-date-dialog-card {
    height: var(--history-date-picker-panel-height);
    max-height: var(--history-date-picker-panel-height);
  }

  .history-date-dialog-header {
    padding: 15px 14px 12px;
  }

  .history-date-months {
    padding: 10px 10px 0;
  }

  .history-date-dialog .history-date-strip {
    max-height: min(62dvh, 560px);
    grid-auto-flow: row;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
    padding: 12px 10px calc(14px + env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scroll-snap-type: none;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .history-date-dialog .history-date-button,
  .history-date-dialog .history-date-skeleton {
    min-height: 68px;
  }

  .history-account-heading {
    padding: 14px;
  }

  .history-account-toolbar {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 10px 14px 12px;
  }

  .is-history-embedded .history-account-toolbar {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    padding-right: max(14px, env(safe-area-inset-right));
    padding-left: max(14px, env(safe-area-inset-left));
  }

  .history-account-search {
    grid-column: auto;
    width: 100%;
    flex: 0 0 auto;
  }

  .history-account-sort {
    width: 100%;
  }

  .history-account-search input {
    min-height: 44px;
    font-size: 16px;
  }

  .history-account-search-clear {
    min-height: 38px;
  }

  .history-day-status,
  .history-search-status {
    white-space: normal;
  }

  .history-day-status {
    max-width: 100%;
    text-align: left;
  }

  .history-search-status {
    text-align: left;
  }

  .history-day-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px 14px;
  }

  #history-loading-state,
  #history-error-state,
  #history-empty-state {
    min-height: clamp(320px, 56dvh, 520px);
    padding: 24px 16px calc(28px + env(safe-area-inset-bottom));
  }

  .history-account-card {
    grid-template-areas:
      "rank identity"
      "battle battle"
      "metrics metrics"
      "actions actions"
      "details details";
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 9px 8px;
    padding: 13px 10px;
    overflow: hidden;
  }

  .is-history-embedded .history-main-content {
    padding: 0;
  }

  .is-history-embedded .history-account-card {
    grid-template-areas:
      "identity"
      "battle"
      "metrics"
      "actions"
      "details";
    grid-template-columns: minmax(0, 1fr);
  }

  .is-history-embedded .history-rank-story,
  .is-history-embedded .history-account-metrics,
  .is-history-embedded .history-card-actions {
    padding-left: 0;
  }

  .history-account-rank {
    align-self: start;
    padding-top: 8px;
  }

  .history-account-rank strong {
    font-size: 18px;
  }

  .history-account-avatar-shell {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .history-account-name {
    max-width: 100%;
    font-size: 13px;
  }

  .history-rank-story {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    gap: 4px 8px;
    padding: 8px 0 0 50px;
  }

  .history-rank-story .history-rank-timeline {
    flex: 1 1 100%;
  }

  .history-account-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 0;
    padding-left: 50px;
  }

  .history-account-metric:nth-child(3),
  .history-account-metric:nth-child(5) {
    border-left: 0;
  }

  .history-card-actions {
    padding-left: 50px;
  }

  .history-profile-link,
  .history-expand-button {
    min-height: 44px;
  }

  .history-account-details {
    margin-right: 0;
    margin-left: 0;
    padding-top: 12px;
  }

  .history-session-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 8px;
  }

  .history-session-card-header {
    grid-column: 1 / -1;
    gap: 8px;
  }

  .history-session-header-actions {
    align-self: start;
  }

  .history-session-more-button {
    display: block;
  }

  .history-session-metrics {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .history-session-metrics > .history-session-metric:nth-child(n + 5) {
    display: none;
  }

  .history-session-row.is-secondary-open .history-session-metrics > .history-session-metric {
    display: block;
  }

  .history-session-heading {
    grid-column: 1 / -1;
  }

  .history-trend-button {
    grid-column: auto;
    min-height: 36px;
  }

  .history-trend-dialog {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
    border-radius: 15px;
  }

  .history-trend-card {
    max-height: calc(100dvh - 14px);
  }

  .history-trend-header {
    padding: 14px;
  }

  .history-trend-header h2 {
    font-size: 17px;
  }

  .history-dialog-close {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .history-trend-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px 14px;
  }

  .history-trend-summary > div {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 8px;
    padding: 8px 9px;
  }

  .history-trend-summary > div:last-child {
    grid-column: 1 / -1;
  }

  .history-trend-summary [data-trend-comparison] {
    grid-column: 2;
    grid-row: 1 / span 2;
    text-align: right;
  }

  .history-rank-summary {
    padding-right: 14px;
    padding-left: 14px;
  }

  .history-trend-reference {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 10px 14px 12px;
  }

  .history-chart-shell,
  .history-chart {
    min-height: 280px;
  }

  .history-chart-shell {
    aspect-ratio: 4 / 3;
  }

  .trend-series-line {
    stroke-width: 2.2;
  }

  .trend-axis-label {
    font-size: 10px;
    stroke-width: 1.4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(history-date-grid),
  ::view-transition-old(history-date-grid),
  ::view-transition-new(history-date-grid) {
    animation-duration: 1ms !important;
  }
}

@media (max-width: 370px) {
  .history-rank-story,
  .history-account-metrics,
  .history-card-actions {
    padding-left: 0;
  }

  .history-account-id,
  .history-profile-facts {
    max-width: calc(100vw - 110px);
  }
}

@media (pointer: coarse) {
  .history-date-picker-open,
  .history-date-button,
  .history-expand-button,
  .history-profile-link,
  .history-trend-button,
  .history-dialog-close {
    min-height: 44px;
  }

  .history-date-picker-open {
    min-height: 58px;
  }

  .history-account-search-clear {
    min-width: 52px;
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .history-date-skeleton,
  .history-loading-progress i,
  .history-account-list:not([hidden]),
  #history-error-state:not([hidden]),
  #history-empty-state:not([hidden]) {
    animation: none;
  }
}

.history-summary-metric span {
  color: rgba(210, 222, 223, 0.8);
  font-size: 10.5px;
  font-weight: 690;
}

.history-account-rank,
.history-rank-story span,
.history-account-metric span,
.history-session-heading span,
.history-session-metric span,
.history-trend-summary span {
  color: rgba(199, 213, 215, 0.76);
  font-size: 10px;
  font-weight: 670;
  line-height: 1.4;
  letter-spacing: 0.004em;
}

.history-summary-metric strong,
.history-account-metric strong,
.history-session-metric strong,
.history-trend-summary strong {
  color: rgba(245, 249, 249, 0.96);
}

.history-account-metric {
  padding-top: 4px;
  padding-bottom: 4px;
}

@media (max-width: 680px) {
  .history-summary-metric span,
  .history-account-rank,
  .history-rank-story span,
  .history-account-metric span,
  .history-session-heading span,
  .history-session-metric span,
  .history-trend-summary span {
    font-size: 10px;
  }
}
