.nav-icon-chart,
.nav-icon-ranking,
.nav-icon-log {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-icon-chart svg,
.nav-icon-ranking svg,
.nav-icon-log svg {
  width: 16px;
  height: 16px;
}

.nav-icon-chart svg,
.nav-icon-ranking svg {
  fill: currentColor;
}

.nav-icon-log svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.analytics-page {
  width: min(1200px, calc(100% - 32px));
  margin: 28px auto 0;
  padding-bottom: 42px;
}

.analytics-shell {
  display: grid;
  gap: 18px;
}

.analytics-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 2px 2px;
}

.analytics-eyebrow {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 11px;
  letter-spacing: 0.16em;
  font-weight: 600;
}

.analytics-heading h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
}

.analytics-subtitle {
  margin: 7px 0 0;
  color: var(--muted);
}

.analytics-controls {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.analytics-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.analytics-controls input {
  min-width: 148px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--el-border-radius-base);
  padding: 0 9px;
  color: var(--text);
  background: var(--panel);
  outline: none;
}

.analytics-controls input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(47, 143, 232, 0.16);
}

.analytics-controls .btn {
  height: 34px;
  padding: 0 14px;
}

.analytics-message {
  min-height: 18px;
  margin: -3px 0 -3px;
  color: var(--muted);
  font-size: 13px;
}

.analytics-message.is-error {
  color: var(--red);
}

.analytics-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.analytics-summary-card,
.analytics-card {
  border: 1px solid #4f4f4f;
  border-radius: var(--el-border-radius-base);
  background: var(--panel);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.analytics-summary-card {
  position: relative;
  min-height: 112px;
  overflow: hidden;
  padding: 18px 18px 15px;
  display: grid;
  align-content: space-between;
  gap: 6px;
}

.analytics-summary-card::after {
  position: absolute;
  right: -20px;
  bottom: -34px;
  width: 105px;
  height: 105px;
  border: 18px solid rgba(47, 143, 232, 0.1);
  border-radius: 50%;
  content: "";
}

.analytics-summary-card span,
.analytics-summary-card small {
  color: var(--muted);
}

.analytics-summary-card span {
  font-size: 13px;
}

.analytics-summary-card strong {
  font-size: 28px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.analytics-summary-card small {
  font-size: 11px;
}

.analytics-summary-card.is-success::after { border-color: rgba(90, 200, 54, 0.15); }
.analytics-summary-card.is-success strong { color: var(--green); }
.analytics-summary-card.is-failure::after { border-color: rgba(255, 102, 108, 0.15); }
.analytics-summary-card.is-failure strong { color: var(--red); }
.analytics-summary-card.is-rate::after { border-color: rgba(240, 160, 50, 0.16); }
.analytics-summary-card.is-rate strong { color: var(--orange); }
.analytics-summary-card.is-history::after { border-color: rgba(145, 112, 255, 0.16); }
.analytics-summary-card.is-history strong { color: #a98bff; }
.analytics-summary-card.is-today::after { border-color: rgba(37, 194, 160, 0.16); }
.analytics-summary-card.is-today strong { color: #35c9aa; }
.analytics-summary-card.is-month::after { border-color: rgba(47, 143, 232, 0.18); }
.analytics-summary-card.is-month strong { color: #5aaeff; }

.analytics-card {
  min-width: 0;
  overflow: hidden;
}

.analytics-card-head {
  min-height: 72px;
  padding: 17px 20px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(128, 128, 128, 0.18);
}

.analytics-card-head h2 {
  margin: 0;
  font-size: 17px;
}

.analytics-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.analytics-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.legend-dot {
  width: 9px;
  height: 9px;
  margin-right: 5px;
  display: inline-block;
  border-radius: 50%;
  vertical-align: -1px;
}

.legend-dot.success { background: var(--green); }
.legend-dot.failure { background: var(--red); }

.analytics-chart-scroll {
  overflow-x: auto;
  padding: 18px 20px 13px;
}

.monthly-bar-chart {
  --chart-height: 250px;
  min-width: 720px;
  height: calc(var(--chart-height) + 29px);
  padding: 0 5px;
  display: grid;
  grid-template-columns: repeat(var(--day-count, 31), minmax(20px, 1fr));
  align-items: end;
  gap: 5px;
  background-image: linear-gradient(to bottom, rgba(128, 128, 128, 0.16) 1px, transparent 1px);
  background-size: 100% 25%;
  border-bottom: 1px solid rgba(128, 128, 128, 0.35);
}

.daily-bar-group {
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: var(--chart-height) 24px;
  align-items: end;
  gap: 5px;
}

.daily-bar-columns {
  min-height: 0;
  height: var(--chart-height);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}

.daily-bar {
  position: relative;
  width: min(12px, 42%);
  min-height: 0;
  height: var(--bar-height, 0%);
  border-radius: 4px 4px 0 0;
  transition: height 0.35s ease, filter 0.2s ease;
}

.daily-bar:hover { filter: brightness(1.22); }
.daily-bar.success { background: linear-gradient(180deg, #83df66, #4aa932); }
.daily-bar.failure { background: linear-gradient(180deg, #ff8a8f, #d74c55); }
.daily-bar-value {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  display: none;
  color: var(--text);
  font-size: 10px;
  transform: translateX(-50%);
}
.daily-bar:hover .daily-bar-value { display: block; }
.daily-bar-day {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.analytics-chart-empty {
  padding: 18px 20px 21px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.hourly-line-wrap {
  min-height: 280px;
  padding: 14px 18px 7px;
}

#hourlyLineChart {
  width: 100%;
  min-height: 260px;
  overflow: visible;
}

.hourly-grid-line { stroke: rgba(128, 128, 128, 0.2); stroke-width: 1; }
.hourly-axis-label { fill: var(--muted); font-size: 11px; }
.hourly-axis-label.y { text-anchor: end; }
.hourly-axis-label.x { text-anchor: middle; }
.hourly-line-area { fill: rgba(47, 143, 232, 0.11); }
.hourly-line-path { fill: none; stroke: var(--blue); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.hourly-line-point { fill: var(--panel); stroke: var(--blue); stroke-width: 2; }
.hourly-line-point:hover { fill: var(--blue); }

.analytics-total-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(47, 143, 232, 0.34);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--blue);
  background: rgba(47, 143, 232, 0.09);
  font-size: 12px;
  white-space: nowrap;
}

.ranking-page-grid {
  display: grid;
  min-width: 0;
  gap: 18px;
}

.ranking-card,
.hot-link-card {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.hot-link-ranking-table {
  min-width: 1120px;
}

.hot-link-ranking-table .ranking-provider {
  min-width: 120px;
}

.hot-link-cell {
  width: 32%;
  min-width: 260px;
  max-width: 380px;
}

.hot-link-url {
  display: block;
  max-width: 360px;
  overflow: hidden;
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.hot-link-url:hover {
  text-decoration: underline;
}

.hot-link-file-name {
  display: block;
  width: 150px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hot-link-size {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.parse-log-card {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.parse-log-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.parse-log-table {
  min-width: 1120px;
}

.parse-log-provider-cell {
  width: 210px;
  max-width: 210px;
}

.parse-log-provider-cell .ranking-provider {
  min-width: 0;
  max-width: 210px;
}

.parse-log-provider-cell .ranking-provider-name {
  min-width: 0;
  max-width: 108px;
}

.parse-log-link-cell {
  width: 34%;
  min-width: 300px;
  max-width: 460px;
}

.parse-log-url,
.parse-log-file-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.parse-log-url {
  max-width: 500px;
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

a.parse-log-url:hover {
  text-decoration: underline;
}

.parse-log-file-name {
  width: 240px;
  max-width: 240px;
}

.parse-log-index,
.parse-log-size,
.parse-log-time {
  font-variant-numeric: tabular-nums;
}

.parse-log-size,
.parse-log-time {
  color: var(--muted);
}

.parse-log-result {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  padding: 4px 9px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
}

.parse-log-result.is-success {
  color: var(--green);
  background: rgba(54, 195, 132, 0.09);
}

.parse-log-result.is-failure {
  color: var(--red);
  background: rgba(255, 102, 108, 0.09);
}

.ranking-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.provider-ranking-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 650px;
}

.provider-ranking-table th,
.provider-ranking-table td {
  height: 52px;
  padding: 8px 20px;
  border-bottom: 1px solid rgba(128, 128, 128, 0.16);
  text-align: left;
  white-space: nowrap;
}

.provider-ranking-table th {
  height: 38px;
  color: var(--muted);
  background: rgba(128, 128, 128, 0.06);
  font-size: 11px;
  font-weight: 400;
}

.provider-ranking-table td {
  font-size: 13px;
}

.provider-ranking-table tbody tr:last-child td { border-bottom: 0; }
.provider-ranking-table tbody tr:hover { background: rgba(47, 143, 232, 0.06); }

.ranking-rank {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.ranking-rank.is-top {
  color: var(--orange);
  font-weight: 600;
}

.ranking-provider {
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.ranking-provider img {
  width: 25px;
  height: 25px;
  object-fit: contain;
}

.ranking-provider-placeholder {
  width: 25px;
  height: 25px;
  display: inline-block;
  border-radius: 6px;
  background: rgba(128, 128, 128, 0.18);
}

.ranking-provider-name { overflow: hidden; text-overflow: ellipsis; }
.ranking-number { font-variant-numeric: tabular-nums; }
.ranking-number.success { color: var(--green); }
.ranking-number.failure { color: var(--red); }

.ranking-rate {
  min-width: 130px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ranking-rate-track {
  width: 70px;
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(128, 128, 128, 0.2);
}

.ranking-rate-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.analytics-total-badge.is-failure {
  border-color: rgba(255, 102, 108, 0.34);
  color: var(--red);
  background: rgba(255, 102, 108, 0.09);
}

.failure-record-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.failure-reason-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.failure-reason-table th,
.failure-reason-table td {
  min-width: 0;
  overflow: hidden;
  padding-left: 12px;
  padding-right: 12px;
  vertical-align: middle;
}

.failure-reason-table th:nth-child(1),
.failure-reason-table td:nth-child(1) { width: 58px; }
.failure-reason-table th:nth-child(2),
.failure-reason-table td:nth-child(2) { width: 130px; }
.failure-reason-table th:nth-child(3),
.failure-reason-table td:nth-child(3) { width: 23%; }
.failure-reason-table th:nth-child(4),
.failure-reason-table td:nth-child(4) { width: 135px; }
.failure-reason-table th:nth-child(6),
.failure-reason-table td:nth-child(6) { width: 68px; }
.failure-reason-table th:nth-child(7),
.failure-reason-table td:nth-child(7) { width: 145px; }

.failure-reason-table .ranking-provider,
.failure-type {
  min-width: 0;
}

.failure-reason-table .ranking-provider-name,
.failure-type strong,
.failure-type code {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.failure-type {
  display: grid;
  gap: 4px;
}

.failure-type strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.failure-type code {
  width: auto;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
}

.failure-reason-table th:nth-child(5),
.failure-reason-table td.failure-reason-detail {
  white-space: normal;
}

.failure-share-cell {
  width: auto;
  min-width: 0;
  max-width: none;
}

.failure-share-url {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

a.failure-share-url:hover {
  text-decoration: underline;
}

.failure-share-url.is-empty {
  color: var(--muted);
}

.failure-reason-detail span {
  display: block;
  max-width: 100%;
  color: var(--text);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.failure-retry-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 22px;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 11px;
}

.failure-retry-badge.is-yes {
  color: var(--orange);
  background: rgba(240, 160, 50, 0.08);
}

.failure-retry-badge.is-no {
  color: var(--muted);
  background: rgba(128, 128, 128, 0.08);
}

.failure-last-time {
  color: var(--muted);
  font-size: 12px !important;
  font-variant-numeric: tabular-nums;
}

.failure-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-height: 58px;
  padding: 10px 18px;
  border-top: 1px solid rgba(128, 128, 128, 0.16);
}

.failure-pagination[hidden] {
  display: none;
}

.failure-pagination .btn {
  min-width: 76px;
  padding: 7px 12px;
}

.failure-pagination .btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.failure-page-info {
  min-width: 150px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1100px) {
  .analytics-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .analytics-heading { align-items: flex-start; flex-direction: column; }
  .analytics-controls { width: 100%; justify-content: flex-start; }

  .failure-record-scroll {
    overflow: visible;
    padding: 0 12px 12px;
    box-sizing: border-box;
  }

  .failure-reason-table,
  .failure-reason-table tbody,
  .failure-reason-table tr,
  .failure-reason-table td {
    display: block;
    width: 100%;
  }

  .failure-reason-table thead {
    display: none;
  }

  .failure-reason-table tbody {
    display: grid;
    gap: 12px;
  }

  .failure-reason-table tr {
    overflow: hidden;
    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: 10px;
    background: rgba(128, 128, 128, 0.035);
  }

  .failure-reason-table td,
  .failure-reason-table td:nth-child(n) {
    width: auto;
    min-height: 42px;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    border-bottom: 1px solid rgba(128, 128, 128, 0.13);
    white-space: normal;
  }

  .failure-reason-table td:last-child {
    border-bottom: 0;
  }

  .failure-reason-table td::before {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.55;
  }

  .failure-reason-table td:nth-child(1)::before { content: "序号"; }
  .failure-reason-table td:nth-child(2)::before { content: "网盘"; }
  .failure-reason-table td:nth-child(3)::before { content: "解析链接"; }
  .failure-reason-table td:nth-child(4)::before { content: "失败类型"; }
  .failure-reason-table td:nth-child(5)::before { content: "详细原因"; }
  .failure-reason-table td:nth-child(6)::before { content: "可重试"; }
  .failure-reason-table td:nth-child(7)::before { content: "发生时间"; }

  .failure-reason-table td > * {
    min-width: 0;
  }

  .failure-reason-table .ranking-provider,
  .failure-reason-table .ranking-provider-name,
  .failure-type {
    width: max-content;
  }

  .failure-share-url {
    -webkit-line-clamp: 3;
  }
}

@media (max-width: 760px) {
  .analytics-page { width: calc(100% - 20px); margin-top: 18px; }
  .analytics-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-card-head { padding-left: 14px; padding-right: 14px; flex-direction: column; }
  .analytics-legend { align-self: flex-start; }
  .analytics-chart-scroll { padding-left: 12px; padding-right: 12px; }
  .hourly-line-wrap { padding-left: 7px; padding-right: 7px; }
  .provider-ranking-table th, .provider-ranking-table td { padding-left: 12px; padding-right: 12px; }
  .failure-pagination { justify-content: space-between; padding-left: 12px; padding-right: 12px; }
}

@media (max-width: 480px) {
  .analytics-summary-grid { grid-template-columns: 1fr; gap: 8px; }
  .analytics-summary-card { min-height: 105px; padding: 14px 13px; }
  .analytics-summary-card strong { font-size: 23px; }
  .analytics-controls label { flex: 1 1 130px; }
  .analytics-controls input { width: 100%; min-width: 0; }
  .analytics-controls .btn { flex: 1 1 100%; }
}

body.theme-light .analytics-summary-card,
body.theme-light .analytics-card {
  border-color: #cfd6e0;
  box-shadow: 0 10px 24px rgba(30, 41, 59, 0.1);
}

body.theme-light .analytics-controls input {
  border-color: #c9d1dc;
  background: #fff;
  color: #20242a;
}

body.theme-light .provider-ranking-table th { background: #f7f8fa; }
body.theme-light .provider-ranking-table tbody tr:hover { background: #f3f8ff; }

/* Keep ranking tables inside their cards on narrow viewports. */
.hot-link-ranking-table,
.parse-log-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.hot-link-ranking-table th,
.hot-link-ranking-table td,
.parse-log-table th,
.parse-log-table td {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hot-link-ranking-table th,
.hot-link-ranking-table td {
  padding-left: 8px;
  padding-right: 8px;
}

.hot-link-ranking-table th:nth-child(1),
.hot-link-ranking-table td:nth-child(1) { width: 6%; }
.hot-link-ranking-table th:nth-child(2),
.hot-link-ranking-table td:nth-child(2) { width: 20%; }
.hot-link-ranking-table th:nth-child(3),
.hot-link-ranking-table td:nth-child(3) { width: 13%; }
.hot-link-ranking-table th:nth-child(4),
.hot-link-ranking-table td:nth-child(4) { width: 9%; }
.hot-link-ranking-table th:nth-child(5),
.hot-link-ranking-table td:nth-child(5) { width: 15%; }
.hot-link-ranking-table th:nth-child(6),
.hot-link-ranking-table td:nth-child(6) { width: 8%; }
.hot-link-ranking-table th:nth-child(7),
.hot-link-ranking-table td:nth-child(7) { width: 7%; }
.hot-link-ranking-table th:nth-child(8),
.hot-link-ranking-table td:nth-child(8) { width: 7%; }
.hot-link-ranking-table th:nth-child(9),
.hot-link-ranking-table td:nth-child(9) { width: 15%; }

.hot-link-ranking-table .ranking-provider,
.hot-link-ranking-table .ranking-provider-name,
.hot-link-cell,
.hot-link-url,
.hot-link-file-name {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.parse-log-table th,
.parse-log-table td {
  padding-left: 10px;
  padding-right: 10px;
}

.parse-log-table th:nth-child(1),
.parse-log-table td:nth-child(1) { width: 7%; }
.parse-log-table th:nth-child(2),
.parse-log-table td:nth-child(2) { width: 14%; }
.parse-log-table th:nth-child(3),
.parse-log-table td:nth-child(3) { width: 30%; }
.parse-log-table th:nth-child(4),
.parse-log-table td:nth-child(4) { width: 18%; }
.parse-log-table th:nth-child(5),
.parse-log-table td:nth-child(5) { width: 9%; }
.parse-log-table th:nth-child(6),
.parse-log-table td:nth-child(6) { width: 9%; }
.parse-log-table th:nth-child(7),
.parse-log-table td:nth-child(7) { width: 13%; }

.parse-log-table .ranking-provider,
.parse-log-table .ranking-provider-name,
.parse-log-link-cell,
.parse-log-url,
.parse-log-file-name {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 760px) {
  .hot-link-ranking-table th,
  .hot-link-ranking-table td,
  .parse-log-table th,
  .parse-log-table td {
    padding-left: 6px;
    padding-right: 6px;
    font-size: 12px;
  }
}
/* On mobile, analytics tables stay as tables and expose their complete
   contents through the card's horizontal scrollbar instead of truncating
   columns or converting failure rows into stacked cards. */
@media (max-width: 760px) {
  .ranking-scroll,
  .parse-log-scroll,
  .failure-record-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }

  .hot-link-ranking-table,
  .parse-log-table,
  .failure-reason-table {
    width: max-content;
    table-layout: auto;
  }

  .hot-link-ranking-table {
    min-width: 1520px;
  }

  .hot-link-ranking-table th,
  .hot-link-ranking-table td,
  .parse-log-table th,
  .parse-log-table td,
  .failure-reason-table th,
  .failure-reason-table td {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
  }

  .hot-link-ranking-table th:nth-child(n),
  .hot-link-ranking-table td:nth-child(n),
  .parse-log-table th:nth-child(n),
  .parse-log-table td:nth-child(n) {
    width: auto;
  }

  .hot-link-ranking-table th:nth-child(1),
  .hot-link-ranking-table td:nth-child(1) { min-width: 64px; }
  .hot-link-ranking-table th:nth-child(2),
  .hot-link-ranking-table td:nth-child(2) { min-width: 420px; }
  .hot-link-ranking-table th:nth-child(3),
  .hot-link-ranking-table td:nth-child(3) { min-width: 240px; }
  .hot-link-ranking-table th:nth-child(4),
  .hot-link-ranking-table td:nth-child(4) { min-width: 100px; }
  .hot-link-ranking-table th:nth-child(5),
  .hot-link-ranking-table td:nth-child(5) { min-width: 160px; }
  .hot-link-ranking-table th:nth-child(6),
  .hot-link-ranking-table td:nth-child(6),
  .hot-link-ranking-table th:nth-child(7),
  .hot-link-ranking-table td:nth-child(7),
  .hot-link-ranking-table th:nth-child(8),
  .hot-link-ranking-table td:nth-child(8) { min-width: 90px; }
  .hot-link-ranking-table th:nth-child(9),
  .hot-link-ranking-table td:nth-child(9) { min-width: 180px; }

  .hot-link-ranking-table .ranking-provider,
  .hot-link-ranking-table .ranking-provider-name,
  .hot-link-cell,
  .hot-link-url,
  .hot-link-file-name {
    width: auto;
    min-width: 0;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
  }

  .hot-link-ranking-table .ranking-provider,
  .hot-link-ranking-table .ranking-provider-name {
    width: max-content;
    min-width: max-content;
  }

  .hot-link-cell { min-width: 420px; }
  .hot-link-file-name { min-width: 220px; }
  .hot-link-url { white-space: nowrap; }

  .parse-log-table {
    min-width: 1320px;
  }

  .parse-log-table th:nth-child(1),
  .parse-log-table td:nth-child(1) { min-width: 64px; }
  .parse-log-table th:nth-child(2),
  .parse-log-table td:nth-child(2) { min-width: 180px; }
  .parse-log-table th:nth-child(3),
  .parse-log-table td:nth-child(3) { min-width: 450px; }
  .parse-log-table th:nth-child(4),
  .parse-log-table td:nth-child(4) { min-width: 260px; }
  .parse-log-table th:nth-child(5),
  .parse-log-table td:nth-child(5) { min-width: 100px; }
  .parse-log-table th:nth-child(6),
  .parse-log-table td:nth-child(6) { min-width: 90px; }
  .parse-log-table th:nth-child(7),
  .parse-log-table td:nth-child(7) { min-width: 180px; }

  .parse-log-table .ranking-provider,
  .parse-log-table .ranking-provider-name,
  .parse-log-link-cell,
  .parse-log-url,
  .parse-log-file-name {
    width: auto;
    min-width: 0;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
  }

  .parse-log-table .ranking-provider,
  .parse-log-table .ranking-provider-name {
    width: max-content;
    min-width: max-content;
  }

  .parse-log-link-cell { min-width: 450px; }
  .parse-log-file-name { min-width: 260px; }
  .parse-log-url { white-space: nowrap; }

  /* Undo the narrow-screen card layout for failure records. */
  .failure-record-scroll {
    padding: 0;
  }

  .failure-reason-table {
    min-width: 1520px;
    display: table;
  }

  .failure-reason-table thead {
    display: table-header-group;
  }

  .failure-reason-table tbody {
    display: table-row-group;
  }

  .failure-reason-table tr {
    display: table-row;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .failure-reason-table th,
  .failure-reason-table td,
  .failure-reason-table td:nth-child(n) {
    display: table-cell !important;
    width: auto;
    min-height: 0;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(128, 128, 128, 0.16);
    white-space: nowrap;
    vertical-align: middle;
  }

  .failure-reason-table td::before {
    display: none;
    content: none;
  }

  .failure-reason-table td:nth-child(1) { min-width: 64px; }
  .failure-reason-table td:nth-child(2) { min-width: 180px; }
  .failure-reason-table td:nth-child(3) { min-width: 420px; }
  .failure-reason-table td:nth-child(4) { min-width: 180px; }
  .failure-reason-table td:nth-child(5) {
    min-width: 420px;
    white-space: normal;
  }
  .failure-reason-table td:nth-child(6) { min-width: 90px; }
  .failure-reason-table td:nth-child(7) { min-width: 180px; }

  .failure-reason-table .ranking-provider,
  .failure-reason-table .ranking-provider-name,
  .failure-type strong,
  .failure-type code {
    min-width: 0;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
  }

  .failure-reason-table .ranking-provider,
  .failure-reason-table .ranking-provider-name,
  .failure-type {
    width: max-content;
  }

  .failure-share-url {
    display: block;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    -webkit-line-clamp: unset;
  }

  .failure-reason-detail span {
    max-width: none;
    overflow: visible;
    overflow-wrap: anywhere;
    white-space: normal;
  }
}
/* Keep all analytics filters and refresh actions on one row on mobile. */
@media (max-width: 760px) {
  .analytics-controls {
    width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .analytics-controls label {
    flex: 0 0 132px;
    width: 132px;
    min-width: 132px;
    display: grid;
    grid-template-rows: auto 34px;
    gap: 5px;
  }

  .analytics-controls input {
    display: block;
    width: 132px;
    min-width: 132px;
    max-width: 132px;
  }

  .analytics-controls .btn {
    flex: 0 0 auto;
    align-self: flex-end;
    height: 34px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
  }
}
/* Center the selected date/month value inside mobile filter inputs. */
@media (max-width: 760px) {
  .analytics-controls input[type="date"],
  .analytics-controls input[type="month"] {
    text-align: center;
    text-align-last: center;
    padding-left: 4px;
    padding-right: 4px;
  }

  .analytics-controls input[type="date"]::-webkit-datetime-edit,
  .analytics-controls input[type="month"]::-webkit-datetime-edit {
    text-align: center;
  }
}
/* Mobile native date/month fields: center the value in the visible edit area. */
@media (max-width: 760px) {
  .analytics-controls input[type="date"]::-webkit-datetime-edit,
  .analytics-controls input[type="month"]::-webkit-datetime-edit {
    display: flex !important;
    align-items: center;
    justify-content: center !important;
    width: 100% !important;
    text-align: center !important;
  }

  .analytics-controls input[type="date"]::-webkit-datetime-edit-fields-wrapper,
  .analytics-controls input[type="month"]::-webkit-datetime-edit-fields-wrapper {
    display: flex !important;
    align-items: center;
    justify-content: center !important;
    width: 100% !important;
    text-align: center !important;
  }

  .analytics-controls input[type="date"]::-webkit-datetime-edit-year-field,
  .analytics-controls input[type="date"]::-webkit-datetime-edit-month-field,
  .analytics-controls input[type="date"]::-webkit-datetime-edit-day-field,
  .analytics-controls input[type="month"]::-webkit-datetime-edit-year-field,
  .analytics-controls input[type="month"]::-webkit-datetime-edit-month-field {
    text-align: center !important;
  }
}
/* Mobile filters: keep the selected date/month value centered without relying on
   browser-specific native date-field text alignment. */
.analytics-input-shell {
  position: relative;
  display: block;
  width: 100%;
  min-width: 148px;
  height: 34px;
}

.analytics-input-shell .analytics-date-value {
  display: none;
}

@media (max-width: 760px) {
  .analytics-input-shell {
    width: 132px;
    min-width: 132px;
    height: 34px;
  }

  .analytics-input-shell input[type="date"],
  .analytics-input-shell input[type="month"] {
    position: relative;
    z-index: 1;
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
    caret-color: transparent;
    text-align: center;
  }

  .analytics-input-shell .analytics-date-value {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px 0 4px;
    color: var(--text);
    font: inherit;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
  }
}

/* Keep the overlay text centered in the full input box; the native picker icon
   remains visible at the right edge. */
@media (max-width: 760px) {
  .analytics-input-shell .analytics-date-value {
    padding-left: 4px;
    padding-right: 4px;
  }
}
