/* Canonical theme and rhythm tokens. Components must consume these, not redefine root colors. */
:root {
  color-scheme: light;
  --bg: #f2f3ee;
  --bg-gradient: radial-gradient(ellipse at top left, #fcfcf8, transparent 65%), var(--bg);
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --surface-warm: #f8faf9;
  --surface-cool: #f1f6f4;
  --soft: #eaf0eb;
  --toolbar-surface: #fbfcf9;
  --filter-surface: #f7f9f5;
  --note-surface: #f1f5f0;
  --line: #d5ded8;
  --line-strong: #a7bdb3;
  --hairline: rgba(255, 255, 255, 0.9);
  --scrollbar-thumb: rgba(57, 92, 84, 0.42);
  --scrollbar-thumb-hover: rgba(15, 118, 110, 0.68);
  --text: #14211d;
  --text-secondary: #2d4841;
  --muted: #526761;
  --accent: #0f766e;
  --accent-strong: #075b57;
  --accent-fill: #0b4f47;
  --accent-fill-hover: #0d5c52;
  --on-accent: #f2fffb;
  --accent-warm: #9a6b0a;
  --accent-soft: rgba(15, 118, 110, 0.08);
  --focus-ring: rgba(15, 118, 110, 0.4);
  --rank: #9a6b0a;
  --seal: #c73842;
  --good: #087454;
  --bad: #b4444e;
  --status-move: #8653b9;
  --trend-primary: #9a6b0a;
  --power-num: #9a6b0a;
  --shadow-sm: 0 1px 3px rgba(23, 35, 31, 0.07);
  --shadow: 0 5px 16px rgba(23, 35, 31, 0.085), 0 1px 3px rgba(23, 35, 31, 0.035);
  --shadow-lg: 0 13px 32px rgba(23, 35, 31, 0.105), 0 3px 8px rgba(23, 35, 31, 0.045);
  --shadow-float: 0 18px 44px rgba(23, 35, 31, 0.11), 0 4px 10px rgba(23, 35, 31, 0.04);
  --card-radius: 10px;
  --card-padding-y: 8px;
  --card-padding-x: 12px;
  --card-row-height: 60px;
  --ink: var(--text);
  --metric-surface: #ffffff;
  --metric-border: #d4e5df;
  --metric-label: #4c6b62;
  --metric-value: #243f36;
  --detail-surface: #f5f7f6;
  --detail-line: #e1e7e4;
  --detail-highlight: rgba(255, 255, 255, .75);
  --detail-hover: #edf2ef;
  --detail-hover-line: #c6d3cc;
  --detail-caption: #526761;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --type-caption: 12px;
  --type-body: 14px;
  --type-heading: 20px;
  --motion-fast: 120ms;
  --motion-standard: 180ms;
  --motion-slow: 240ms;
  --layer-toolbar: 20;
  --layer-popover: 40;
  --layer-dialog: 60;
}
:root[data-theme="dark"] {
  --status-move: #c084fc;
  color-scheme: dark;
  --bg: #0b100e;
  --bg-gradient: radial-gradient(1100px 700px at 18% -12%, #15211d 0%, #0b100e 56%);
  --surface: #151d1a;
  --surface-raised: #1c2622;
  --surface-sunken: #101613;
  --surface-hover: #192420;
  --panel: var(--surface);
  --panel-solid: var(--surface);
  --surface-warm: var(--surface-raised);
  --surface-cool: var(--surface-sunken);
  --soft: #25302c;
  --toolbar-surface: var(--surface);
  --filter-surface: var(--surface);
  --note-surface: rgba(99, 197, 185, 0.05);
  --line: rgba(224, 238, 233, 0.14);
  --line-strong: rgba(224, 238, 233, 0.26);
  --hairline: rgba(255, 255, 255, 0.06);
  --scrollbar-thumb: rgba(154, 171, 163, 0.38);
  --scrollbar-thumb-hover: rgba(111, 208, 193, 0.62);
  --text: #eff4f2;
  --text-secondary: #c2cec9;
  --muted: #9aaba3;
  --accent: #6fd0c1;
  --accent-strong: #9ee6da;
  --accent-warm: #e6bc68;
  --accent-soft: rgba(99, 197, 185, 0.12);
  --focus-ring: rgba(111, 208, 193, 0.38);
  --rank: #e0b45d;
  --seal: #ed6858;
  --good: #62c997;
  --bad: #ed7466;
  --trend-primary: #e6bc68;
  --power-num: #e6bc68;
  --shadow-sm: 0 0 0 transparent;
  --shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 8px 24px rgba(0,0,0,.42);
  --shadow-lg: inset 0 1px 0 rgba(255,255,255,.05), 0 18px 48px rgba(0,0,0,.55);
  --shadow-float: var(--shadow-lg);
  --metric-surface: var(--surface-sunken);
  --metric-border: #354b41;
  --metric-label: #9cbbad;
  --metric-value: #e0eee6;
  --detail-surface: var(--surface-sunken);
  --detail-line: #303936;
  --detail-highlight: rgba(255, 255, 255, .025);
  --detail-hover: var(--surface-hover);
  --detail-hover-line: #455249;
  --detail-caption: var(--muted);
}





* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.availability-notice {
  min-width: 0;
  margin: 0 0 8px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent-warm);
  border-radius: 8px;
  background: var(--panel-solid);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.availability-notice > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  list-style: none;
  cursor: pointer;
}
.availability-notice > summary::-webkit-details-marker { display: none; }
.availability-notice > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.availability-notice-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.availability-notice-action { flex-shrink: 0; white-space: nowrap; color: var(--accent); }
.availability-notice-action::after { content: '⌄'; display: inline-block; margin-left: 5px; }
.availability-notice[open] .availability-notice-action::after { transform: rotate(180deg); }
.availability-notice > .availability-notice-text { margin: 0; padding: 8px 10px 10px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app-shell {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  padding: 8px 0 28px;
}

.sticky-toolbar {
  position: relative;
  z-index: 1;
  padding: 8px 0 6px;
}

.sticky-toolbar.is-quality-open {
  z-index: 40;
}

.sticky-toolbar,
.toolbar-card,
.filter-shell {
  min-width: 0;
}

.toolbar-card,
.filter-shell {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.toolbar-card {
  position: relative;
  padding: 8px;
}

.filter-shell {
  position: sticky;
  top: 8px;
  z-index: 18;
  padding: 7px;
  background: var(--panel-solid);
  box-shadow: var(--shadow-lg);
  scroll-margin-top: 8px;
}

.mobile-filter-toggle {
  display: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 42px;
  margin-bottom: 7px;
  padding: 2px 3px 5px;
}

.title-cluster {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 10px;
  overflow: hidden;
}

.title-cluster > div {
  min-width: 0;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 2px solid var(--seal);
  border-radius: 6px;
  background: color-mix(in srgb, var(--seal) 5%, transparent);
  color: var(--seal);
  box-shadow: inset 0 0 4px color-mix(in srgb, var(--seal) 20%, transparent), 0 0 6px color-mix(in srgb, var(--seal) 16%, transparent);
  font-family: "KaiTi", "STKaiti", "SimSun", serif;
  font-size: 22px;
  font-weight: 600;
  transform: rotate(-5deg);
  margin-right: 2px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

h1 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
}

.topbar p {
  overflow: hidden;
  max-width: min(760px, 72vw);
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button,
select,
input {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-solid);
  color: var(--text);
  font: inherit;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

button {
  min-height: 36px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

button:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow);
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 48px;
  min-height: 36px;
  padding: 0;
}

.toolbar-icon {
  display: block;
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.toolbar-icon[hidden] {
  display: none;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  overflow: hidden;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}

.mode-tab {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  box-shadow: none;
}

.mode-tab.is-active {
  background: var(--panel-solid);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

:root:not([data-theme="dark"]) .mode-tab.is-active {
  box-shadow: inset 0 -2px 0 var(--accent), var(--shadow-sm);
}

.mode-tab:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.filters {
  display: grid;
  position: relative;
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(180px, 1.35fr) 40px;
  gap: 7px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.filter-field {
  position: relative;
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.filter-caption {
  line-height: 1.2;
}

.filter-action-field {
  display: flex;
  align-items: end;
  justify-content: center;
  min-width: 40px;
}

.filter-action-field button {
  display: grid;
  width: 36px;
  height: 36px;
  min-height: 36px;
  place-items: center;
  padding: 0;
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}

.filter-action-field button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
  transform: none;
}

.filter-action-field svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.filter-action-field[hidden] {
  display: none !important;
}

.filters.is-change-mode {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.filters.is-guild-compare-mode {
  grid-template-columns: minmax(180px, 0.8fr) repeat(2, minmax(150px, 1fr)) 40px;
}

.change-range-field {
  min-width: 0;
}

.change-range-quick {
  display: flex;
  grid-column: 1 / -1;
  grid-row: 2;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 34px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.change-range-field[hidden],
.change-range-quick[hidden] {
  display: none !important;
}

.change-range-buttons {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
}

.change-range-mobile-select {
  display: none;
}

.change-range-buttons button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel-solid);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.change-range-buttons button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.change-range-buttons .range-reset-button {
  margin-left: 4px;
  border-style: dashed;
  color: var(--muted);
}

.date-status {
  position: absolute;
  top: 0;
  right: 0;
  min-height: 14px;
  color: var(--bad);
  font-size: 11px;
  line-height: 1.15;
}

select,
input {
  width: 100%;
  min-height: 34px;
  padding: 0 9px;
  border-color: var(--line-strong);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.62) inset;
  font-size: 13px;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  display: block;
  background: transparent;
  bottom: 0;
  color: transparent;
  cursor: pointer;
  height: auto;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  width: auto;
  z-index: 1;
}

input[type="date"] {
  position: relative;
}

.date-field::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 9px;
  width: 16px;
  height: 16px;
  background-color: var(--muted);
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>') no-repeat center;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>') no-repeat center;
  mask-size: contain;
  -webkit-mask-size: contain;
  pointer-events: none;
  z-index: 2;
  transition: background-color 0.2s;
}

.date-field:hover::after {
  background-color: var(--accent);
}

.search-field {
  grid-column: span 1;
}

.ranking-panel {
  position: relative;
  min-height: 120px;
  margin-top: 9px;
  overflow-x: clip;
  overflow-y: visible;
}

.ranking-busy {
  position: sticky;
  top: calc(var(--sticky-filter-height, 0px) + 8px);
  z-index: 24;
  display: flex;
  width: 100%;
  max-width: 100%;
  min-height: 32px;
  margin: 0 auto 10px;
  padding: 6px 12px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-left: 3px solid var(--accent);
  border-radius: 0 7px 7px 0;
  background: var(--accent-soft);
  box-shadow: none;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.ranking-busy[hidden] {
  display: none;
}

.ranking-busy-spinner {
  align-self: flex-start;
  margin-top: 3px;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 2px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spinner-spin 0.8s linear infinite;
}

.ranking-list.is-refreshing {
  pointer-events: none;
}

.ranking-list {
  display: grid;
  gap: 6px;
}

.ranking-item {
  position: relative;
  display: grid;
  min-width: 0;
}

.ranking-item > .ranking-card {
  width: 100%;
}

.ranking-item > .player-card {
  padding-right: 48px;
}

.ranking-item.is-expanded > .ranking-card {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.ranking-card {
  display: grid;
  position: relative;
  grid-template-columns: 46px minmax(150px, 1.18fr) minmax(108px, 0.66fr) minmax(120px, 0.72fr) minmax(220px, 1fr);
  gap: 7px;
  align-items: center;
  scroll-margin-top: calc(var(--sticky-filter-height, 0px) + 12px);
  min-height: var(--card-row-height);
  padding: var(--card-padding-y) var(--card-padding-x);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.ranking-card::before {
  content: none;
}

.ranking-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  z-index: 2;
}

.ranking-card[role="button"] {
  cursor: pointer;
}

.ranking-card[role="button"]:focus-visible,
.daily-change-row:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring), var(--shadow-lg);
  z-index: 3;
}

.archive-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.archive-icon svg {
  color: var(--muted);
  transition: color 0.2s;
}
.ranking-card:hover .archive-icon svg {
  color: var(--accent);
}

.ranking-card.is-private {
  background: transparent;
  opacity: 1;
}

.ranking-card.is-private .power-block strong {
  color: var(--muted);
  font-weight: 600;
}

.guild-card {
  grid-template-columns: 46px minmax(150px, 1.18fr) minmax(118px, 0.66fr) minmax(292px, 1.25fr) 108px;
}

.archive-card {
  grid-template-columns: 46px minmax(150px, 1.18fr) minmax(108px, 0.66fr) minmax(132px, 0.78fr) minmax(184px, 0.92fr);
  cursor: pointer;
}

.archive-aliases {
  grid-column: 2 / -1;
  overflow: hidden;
  margin-top: -2px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface-cool);
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-rank {
  color: var(--rank);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.rank-main {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--soft);
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.rank-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.player-block,
.guild-block,
.power-block,
.card-action {
  min-width: 0;
}

.player-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.duplicate-role-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-cool);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.detail-name-line {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
}

.player-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.player-meta span:not(.class-badge):not(.privacy-pill) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.class-badge,
.privacy-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.privacy-pill {
  min-width: 34px;
  background: var(--surface-cool);
  color: var(--muted);
  border: 1px solid var(--line);
}

/* 门派徽章颜色：背景淡染 + 文字与主题墨色混合，明暗主题自动适配 */
.class-badge {
  background: color-mix(in srgb, var(--class-color, #64748b) 10%, transparent);
  color: color-mix(in srgb, var(--class-color, #64748b) 60%, var(--text));
}

.guild-rename-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 6px;
  border: 1px solid color-mix(in srgb, var(--accent-warm) 32%, var(--line));
  border-radius: 5px;
  background: color-mix(in srgb, var(--accent-warm) 9%, var(--panel));
  color: color-mix(in srgb, var(--accent-warm) 85%, var(--text));
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.guild-former-name {
  max-width: 180px;
  color: var(--muted);
}

/* 门派色源：一行一个门派；改色/加门派只动这里 */
.class-wanxiang { --class-color: #2563eb; }
.class-gaibang { --class-color: #16a34a; }
.class-wudu { --class-color: #4f46e5; }
.class-conglong { --class-color: #b45309; }
.class-tangmen { --class-color: #9333ea; }
.class-tianxiang { --class-color: #db2777; }
.class-taibai { --class-color: #0284c7; }
.class-shaolin { --class-color: #ca8a04; }
.class-zhenwu { --class-color: #1e40af; }
.class-shendao { --class-color: #dc2626; }
.class-shenwei { --class-color: #ea580c; }
.class-yihua { --class-color: #475569; }
.class-changsheng { --class-color: #ca8a04; }
.class-xueyi { --class-color: #e11d48; }
.class-default { --class-color: #64748b; }

.power-block {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.power-block strong {
  display: block;
  color: var(--power-num);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", "Microsoft YaHei UI", sans-serif;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.power-block span,
.guild-block span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.guild-block strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guild-block span {
  text-align: center;
}

.card-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-cool);
}

.card-metric {
  min-width: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.card-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.card-metric strong {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-metric {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px;
  align-items: baseline;
  text-align: left;
}

.compact-metric span,
.compact-metric strong {
  display: inline;
  margin: 0;
}

.card-action {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.inline-trend-toggle {
  display: inline-grid;
  position: relative;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.ranking-item > .inline-trend-toggle {
  position: absolute;
  top: 14px;
  right: 9px;
  z-index: 4;
}

.inline-trend-toggle svg {
  width: 17px;
  height: 17px;
}

.inline-trend-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.inline-trend-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.inline-trend-panel {
  min-width: 0;
  overflow: hidden;
  margin-top: -1px;
  border: 1px solid var(--line);
  border-top-color: var(--line-strong);
  border-radius: 0 0 10px 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.inline-trend-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 190px;
  color: var(--muted);
  font-size: 12px;
}

.change-action {
  display: inline-flex;
  position: relative;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 68px;
  min-height: 30px;
  padding: 0 7px;
  border-color: var(--line-strong);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: none;
}

.change-action svg {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
}

.change-action:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: none;
}

:root[data-theme="dark"] .change-action {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line-strong));
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  color: color-mix(in srgb, var(--accent-strong) 72%, var(--text-secondary));
  box-shadow: none;
}

:root[data-theme="dark"] .change-action:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: none;
}

:root[data-theme="dark"] .change-action:active {
  transform: translateY(0);
  background: var(--accent-soft);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.32);
}

:root[data-theme="dark"] .change-action:focus-visible {
  border-color: var(--accent);
  color: var(--accent-strong);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.card-note {
  grid-column: 2 / -1;
  overflow: hidden;
  height: 24px;
  padding: 2px 10px;
  border-radius: 6px;
  background: var(--soft);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: italic;
}

.player-card-aside {
  display: contents;
}

.player-card-aside .player-metrics {
  display: flex;
  grid-column: 2;
  grid-row: 1;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.player-card-aside .card-note {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  min-width: 0;
  height: 22px;
  margin: 0;
  line-height: 18px;
}

.player-card-aside:not(.has-metrics) .card-note {
  grid-column: 1 / -1;
}

.muted {
  color: var(--muted);
}

.delta-up {
  color: var(--good);
}

.delta-down {
  color: var(--bad);
}

.card-metric .delta-up {
  color: var(--good);
}

.card-metric .delta-down {
  color: var(--bad);
}

.card-metric .muted {
  color: var(--muted);
}

.empty {
  padding: 48px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.empty-error {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.empty-error strong {
  color: var(--text-secondary);
  font-size: 15px;
}

.empty-error button {
  min-height: 36px;
  padding-inline: 16px;
}

.guild-period-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
}

.guild-period-metrics .compact-metric {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  min-height: 42px;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-cool);
  text-align: center;
}

.guild-period-metrics .compact-metric > span,
.guild-period-metrics .compact-metric > strong {
  display: block;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guild-gap-value,
.guild-summit {
  color: var(--text-secondary);
}

.guild-summit {
  font-weight: 800;
}

.mobile-guild-change-action {
  display: none;
}

.ranking-error-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--bad) 45%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--bad) 7%, var(--panel-solid));
  color: var(--text-secondary);
  font-size: 13px;
}

.ranking-error-banner[hidden] {
  display: none;
}

.ranking-error-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.ranking-error-actions button {
  min-height: 30px;
  padding: 0 10px;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  color: var(--muted);
  gap: 16px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spinner-spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes spinner-spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 14px;
  font-weight: 500;
}

/* 全局动效降级：用户偏好减少动态时，关停全部过渡/动画/平滑滚动 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}


.change-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--panel-solid);
  box-shadow: var(--shadow-float);
}

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

.change-dialog::backdrop {
  background: rgba(5, 10, 16, 0.52);
}

body.dialog-fallback-open {
  overflow: hidden;
}

body.dialog-fallback-open::before {
  content: "";
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  inset: 0;
  z-index: 90;
  background: rgba(5, 10, 16, 0.52);
}

.change-dialog.is-fallback-open {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 100;
  display: block;
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  transform: translate(-50%, -50%);
}

.change-dialog.is-drawer {
  margin: 12px 12px 12px auto;
  width: min(460px, calc(100vw - 24px));
  height: fit-content;
  max-height: calc(100dvh - 24px);
  border-radius: 12px;
  animation: drawer-slide-in var(--motion-slow) cubic-bezier(0.16, 1, 0.3, 1);
}

.player-card-detail {
  display: grid;
  grid-column: 4 / -1;
  grid-template-columns: minmax(120px, 0.72fr) minmax(220px, 1fr);
  grid-template-rows: 22px 22px;
  gap: 4px 7px;
  align-items: center;
  min-width: 0;
}

.player-card-detail > .guild-block {
  display: flex;
  grid-column: 1;
  grid-row: 1;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.player-card-detail > .guild-block strong,
.player-card-detail > .guild-block span {
  overflow: hidden;
  margin: 0;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-card-detail > .guild-block strong {
  flex: 0 1 auto;
}

.player-card-detail > .guild-block span {
  flex: 0 1 auto;
}

.player-mobile-guild,
.player-mobile-scope {
  display: none;
}

.change-dialog.is-guild-change {
  height: fit-content;
  max-height: min(760px, calc(100dvh - 32px));
}

.change-dialog.is-guild-change form {
  max-height: inherit;
}

.change-dialog.is-guild-change .change-dialog-body {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
  overflow: hidden;
}

.change-dialog.is-guild-change.is-expanded form {
  height: 100%;
}

.change-dialog.is-guild-change.is-expanded .change-dialog-body {
  flex: 1 1 auto;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.change-dialog.is-drawer.is-fallback-open {
  top: 0;
  left: auto;
  right: 0;
  transform: none;
}

@keyframes drawer-slide-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.change-dialog.is-drawer form {
  max-height: inherit;
}

.change-dialog form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: inherit;
  margin: 0;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-cool);
}

.dialog-head strong,
.dialog-head span {
  display: block;
}

.dialog-head > div:first-child {
  min-width: 0;
}

.dialog-head strong {
  font-size: 18px;
}

.dialog-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.dialog-head button {
  min-height: 32px;
  min-width: 56px;
  white-space: nowrap;
}

.dialog-head-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 2px;
}

.dialog-head .dialog-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.dialog-head .dialog-icon-btn[hidden] {
  display: none !important;
}

.dialog-head .dialog-icon-btn:hover {
  border-color: transparent;
  background: var(--soft);
  color: var(--text);
  box-shadow: none;
}

.dialog-icon-btn svg {
  width: 18px;
  height: 18px;
}

.dialog-icon-btn svg[hidden] {
  display: none !important;
}

.change-dialog.is-guild-change.is-expanded {
  width: min(1180px, calc(100vw - 24px));
  height: calc(100dvh - 24px);
  max-height: calc(100dvh - 24px);
}

.change-dialog.is-drawer.is-expanded {
  width: min(1180px, calc(100vw - 24px));
  height: calc(100dvh - 24px);
  max-height: calc(100dvh - 24px);
  margin: auto;
  animation: none;
}

.change-dialog.is-drawer.is-expanded form {
  height: 100%;
}

.change-dialog.is-drawer.is-expanded .change-dialog-body {
  flex: 1 1 auto;
}

@media (min-width: 900px) {
  .change-dialog[data-kind="daily"].is-expanded .change-dialog-body {
    display: grid;
    grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.18fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
    overflow: hidden;
  }

  .change-dialog[data-kind="daily"].is-expanded .change-summary {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }

  .change-dialog[data-kind="daily"].is-expanded .daily-change-compare {
    grid-column: 1;
    grid-row: 2;
    align-content: start;
    overflow-y: auto;
    padding-right: 4px;
  }

  .change-dialog[data-kind="daily"].is-expanded .daily-change-archive {
    display: flex;
    grid-column: 2;
    grid-row: 2;
    flex-direction: column;
    min-height: 0;
  }

  .change-dialog[data-kind="daily"].is-expanded .player-archive-body {
    min-height: 0;
    overflow-y: auto;
  }
}

.change-dialog.is-drawer.is-expanded.is-fallback-open {
  top: 50%;
  left: 50%;
  right: auto;
  transform: translate(-50%, -50%);
}

.change-dialog-body {
  min-height: 0;
  padding: 14px 16px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

.change-dialog-body::-webkit-scrollbar {
  width: 8px;
}

.change-dialog-body::-webkit-scrollbar-track {
  margin-block: 6px;
  border-radius: 999px;
  background: transparent;
}

.change-dialog-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--scrollbar-thumb);
}

.change-dialog-body::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

.change-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.change-summary.is-two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.change-summary div,
.change-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  font-variant-numeric: tabular-nums;
}

.change-summary div {
  padding: 10px;
}

.change-summary span,
.change-summary strong,
.change-line span,
.change-line strong {
  display: block;
}

.change-summary span,
.change-line span {
  color: var(--muted);
  font-size: 12px;
}

.change-summary strong {
  overflow: hidden;
  margin-top: 4px;
  color: var(--accent);
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.change-compare-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.change-dialog[data-kind="daily"] .daily-change-compare {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.change-dialog[data-kind="daily"] .daily-change-compare > :last-child {
  grid-column: 1 / -1;
}

.dialog-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 96px;
  padding: 18px;
  color: var(--muted);
  text-align: left;
}

.dialog-loading > span:last-child,
.dialog-loading strong,
.dialog-loading small {
  display: block;
}

.dialog-loading strong {
  color: var(--text-secondary);
  font-size: 13px;
}

.dialog-loading small {
  margin-top: 3px;
  font-size: 11px;
}

.dialog-loading-spinner {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spinner-spin 0.8s linear infinite;
}

.dialog-load-error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 88px;
  padding: 16px;
  color: var(--bad);
  font-size: 12px;
  text-align: center;
}

.dialog-load-error button {
  flex: 0 0 auto;
  min-height: 34px;
  padding-inline: 12px;
}

.archive-view {
  display: none;
  animation: view-fade-in var(--motion-slow) cubic-bezier(0.16, 1, 0.3, 1);
  flex-direction: column;
  min-height: 100%;
}

.archive-view.is-active {
  display: flex;
}

@keyframes view-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.archive-basic-list {
  display: grid;
  gap: 16px;
}

.archive-action-bar {
  display: flex;
}

.archive-power-detail-link { display: flex; justify-content: flex-end; margin: 0 0 4px; }
.archive-power-detail-link #viewTimelineBtn {
  width: auto; min-height: 36px; padding: 6px 0 6px 12px;
  border: 0; border-radius: 6px; box-shadow: none;
  background: transparent; color: var(--accent); font-size: 12px; font-weight: 500;
}
.archive-power-detail-link #viewTimelineBtn:hover { background: var(--accent-soft); }
.archive-power-detail-link #viewTimelineBtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.is-sticky-bottom {
  position: sticky;
  bottom: -16px;
  margin-top: auto;
  margin-bottom: -16px;
  padding: 16px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  z-index: 10;
  margin-left: -16px;
  margin-right: -16px;
}

.premium-btn {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.premium-btn:hover {
  background: var(--surface-cool);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.archive-section {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.archive-section .dialog-empty {
  margin: 0;
  padding: 12px 14px;
}

.archive-section h3 {
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
  font-size: 13px;
}

.archive-line {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.archive-line:last-child {
  border-bottom: 0;
}

.archive-line strong,
.archive-line span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-line strong {
  font-size: 13px;
}

.archive-line span {
  color: var(--muted);
  font-size: 12px;
}

.player-profile-section {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.player-profile-section h3 {
  margin: 0;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
  font-size: 13px;
}

.player-detail-list {
  display: grid;
  gap: 0;
}

.player-detail-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.player-detail-row:last-child {
  border-bottom: 0;
}

.player-detail-row span {
  color: var(--muted);
  font-size: 12px;
}

.player-detail-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.power-estimate-box {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.power-estimate-main {
  color: var(--accent);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.power-estimate-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.archive-timeline {
  grid-column: 1 / -1;
}

.archive-timeline-row {
  display: grid;
  grid-template-columns: minmax(0, 92px) minmax(0, 1fr) minmax(0, 0.72fr) minmax(0, 1.12fr);
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.archive-timeline-row:last-child {
  border-bottom: 0;
}

.archive-timeline-row span,
.archive-timeline-row strong,
.archive-timeline-row b,
.archive-timeline-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-timeline-row span,
.archive-timeline-row small {
  color: var(--muted);
  font-size: 12px;
}

.archive-timeline-row strong,
.archive-timeline-row b {
  font-size: 13px;
}

.archive-timeline-row b {
  color: var(--accent);
}

.change-panel {
  overflow: hidden;
}

.change-panel h3 {
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
  font-size: 13px;
}

.change-line {
  display: grid;
  grid-template-columns: minmax(54px, 0.7fr) minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.change-line:last-child {
  border-bottom: 0;
}

.change-line strong {
  overflow-wrap: anywhere;
  text-align: right;
  white-space: normal;
}

.dialog-empty {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.comparison-quality-warning {
  border: 1px solid rgba(217, 119, 6, 0.45);
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
  padding: 10px 12px;
  font-size: 13px;
}

.comparison-quality-warning {
  grid-column: 1 / -1;
  margin: 0;
}

:root[data-theme="dark"] .comparison-quality-warning {
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(120, 53, 15, 0.45);
}

.quality-warning-btn {
  border-color: rgba(217, 119, 6, 0.45);
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
}

.quality-warning-btn:hover,
.quality-warning-btn[aria-expanded="true"] {
  border-color: #d97706;
  background: rgba(245, 158, 11, 0.18);
  color: #92400e;
}

.quality-popover {
  position: absolute;
  z-index: 30;
  top: 58px;
  right: 8px;
  width: min(390px, calc(100% - 16px));
  padding: 12px;
  border: 1px solid rgba(217, 119, 6, 0.45);
  border-radius: 8px;
  background: var(--panel-solid);
  color: var(--text);
  box-shadow: var(--shadow-float);
}

.quality-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quality-popover-head strong {
  color: #92400e;
  font-size: 14px;
}

.quality-popover-head button {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
  box-shadow: none;
}

.quality-popover p {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

:root[data-theme="dark"] .quality-warning-btn {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(120, 53, 15, 0.45);
  color: #fde68a;
}

:root[data-theme="dark"] .quality-popover {
  border-color: rgba(251, 191, 36, 0.55);
}

:root[data-theme="dark"] .quality-popover-head strong {
  color: #fde68a;
}

.member-change-section {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  min-height: 0;
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 254, 250, 0.92);
}

.guild-change-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
}

.guild-change-overview > div {
  min-width: 0;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
}

.guild-change-overview > div:last-child {
  border-right: 0;
}

.guild-change-overview > div > span,
.guild-change-overview > div > strong,
.guild-change-overview > div > small {
  display: block;
}

.guild-change-overview > div > span,
.guild-change-overview > div > small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guild-change-overview > div > strong {
  overflow: hidden;
  margin: 2px 0;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-change-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}

.member-change-head h3 {
  margin: 0;
  font-size: 14px;
}

.member-change-head span {
  color: var(--muted);
  font-size: 12px;
}

.member-change-controls {
  display: grid;
  grid-template-columns: minmax(112px, 0.75fr) minmax(112px, 0.75fr) minmax(270px, 2fr);
  align-items: end;
  gap: 7px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-solid);
}

.member-change-controls label {
  min-width: 0;
}

.member-change-controls input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 0 8px;
}

.member-change-presets {
  display: flex;
  grid-column: auto;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  min-width: 0;
  width: fit-content;
  padding: 2px;
  border-radius: 8px;
  background: var(--soft);
}

.member-change-presets button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 6px;
  border-color: transparent;
  background: transparent;
  font-size: 10px;
  box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
  .member-change-presets button:hover {
    border-color: transparent;
    background: var(--panel-solid);
    box-shadow: none;
  }
}

.member-change-range-status {
  grid-column: 1 / -1;
  min-height: 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.member-change-range-status.has-warning {
  color: #b45309;
  overflow-wrap: anywhere;
  white-space: normal;
}

:root[data-theme="dark"] .member-change-range-status.has-warning {
  color: #fbbf24;
}

.member-change-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}

.member-change-stat {
  min-width: 0;
  min-height: 0;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: rgba(238, 244, 246, 0.82);
  color: inherit;
  text-align: left;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.member-change-stat:hover {
  border-color: currentColor;
}

.member-change-stat.is-selected {
  border-color: currentColor;
  box-shadow: inset 0 0 0 1px currentColor;
}

.member-change-summary.has-filter .member-change-stat:not(.is-selected) {
  opacity: 0.48;
}

.member-change-stat span,
.member-change-stat strong {
  display: block;
}

.member-change-stat span {
  color: var(--muted);
  font-size: 11px;
}

.member-change-stat strong {
  margin-top: 1px;
  font-size: 15px;
}

.member-change-list {
  min-height: 0;
  max-height: 52vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

@media (min-width: 900px) {
  .change-dialog.is-guild-change.is-expanded .member-change-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    max-height: none;
  }

  .change-dialog.is-guild-change.is-expanded .member-change-row:nth-child(odd) {
    border-right: 1px solid var(--line);
  }

  .change-dialog.is-guild-change.is-expanded .member-change-row {
    grid-template-columns: 60px minmax(160px, 1fr) minmax(88px, 0.55fr) minmax(200px, 1.25fr);
    padding-block: 4px;
  }

  .change-dialog.is-guild-change.is-expanded .member-guild-path strong {
    font-size: 11px;
  }

  .change-dialog.is-guild-change.is-expanded .member-identity small {
    white-space: nowrap;
  }
}

.member-change-row {
  display: grid;
  grid-template-columns: 72px minmax(128px, 1fr) minmax(92px, 0.8fr) minmax(124px, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.member-change-row:last-child {
  border-bottom: 0;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.status-join {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.status-leave {
  background: rgba(239, 68, 68, 0.1);
  color: #e11d48;
}

.status-rename {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.status-new {
  background: rgba(14, 165, 233, 0.1);
  color: #0369a1;
}

.status-stay,
.status-up {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

.status-down {
  background: rgba(100, 116, 139, 0.1);
  color: var(--muted);
}

.status-move {
  background: rgba(168, 85, 247, 0.1);
  color: #9333ea;
}

:root[data-theme="dark"] .status-join { background: rgba(52, 211, 153, 0.15); color: #34d399; }
:root[data-theme="dark"] .status-leave { background: rgba(251, 113, 133, 0.15); color: #fb7185; }
:root[data-theme="dark"] .status-rename { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
:root[data-theme="dark"] .status-new { background: rgba(56, 189, 248, 0.18); color: #7dd3fc; }
:root[data-theme="dark"] .status-stay,
:root[data-theme="dark"] .status-up { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
:root[data-theme="dark"] .status-down { background: rgba(148, 163, 184, 0.15); color: var(--muted); }
:root[data-theme="dark"] .status-move { background: rgba(192, 132, 252, 0.15); color: #c084fc; }

.member-identity,
.member-change-metric,
.member-guild-path {
  min-width: 0;
  font-variant-numeric: tabular-nums;
}

.member-identity strong,
.member-identity span,
.member-identity small,
.member-change-metric span,
.member-change-metric strong,
.member-change-metric small,
.member-guild-path span,
.member-guild-path strong {
  display: block;
}

.member-identity strong,
.member-guild-path strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-identity strong {
  font-size: 13px;
}

.member-identity span,
.member-identity small,
.member-change-metric span,
.member-change-metric small,
.member-guild-path span {
  color: var(--muted);
  font-size: 11px;
}

.member-identity small {
  margin-top: 2px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.member-change-metric strong {
  font-size: 13px;
}

.member-guild-path strong {
  font-size: 12px;
}

:root[data-theme="dark"] .change-dialog,
:root[data-theme="dark"] .member-change-section {
  background: var(--panel-solid);
  color: var(--text);
}

:root[data-theme="dark"] .dialog-head,
:root[data-theme="dark"] .member-change-head {
  background: var(--soft);
  color: var(--text);
}

:root[data-theme="dark"] .member-change-stat {
  background: var(--soft);
  color: var(--text);
}

:root[data-theme="dark"] .member-change-row {
  background: var(--panel-solid);
  color: var(--text);
}

:root[data-theme="dark"] .member-identity span,
:root[data-theme="dark"] .member-identity small,
:root[data-theme="dark"] .member-change-metric span,
:root[data-theme="dark"] .member-change-metric small,
:root[data-theme="dark"] .member-guild-path span {
  color: var(--text-secondary);
}


.change-dashboard {
  display: grid;
  gap: 8px;
}

.change-overview {
  display: grid;
  grid-template-columns: minmax(560px, 2fr) minmax(270px, 0.9fr);
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.change-range-summary {
  display: grid;
  justify-items: end;
  gap: 3px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.change-range-warning {
  color: var(--bad);
  font-weight: 700;
}

.change-range-merge {
  display: grid;
  gap: 3px;
  color: var(--accent);
}

.change-merge-tip {
  max-width: 100%;
}

.change-merge-tip > summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 2px 4px;
  border-radius: 4px;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
}

.change-merge-tip > summary::-webkit-details-marker {
  display: none;
}

.change-merge-tip > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.change-merge-tip-copy {
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-solid);
  text-align: left;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.change-range-mobile {
  display: none;
}

.change-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.change-stat {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 40px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  box-shadow: none;
  font-variant-numeric: tabular-nums;
}

.change-stat:hover {
  border-color: currentColor;
  box-shadow: none;
}

.change-stat.is-selected {
  border-color: currentColor;
  box-shadow: inset 0 0 0 1px currentColor;
}

.change-stat-grid.has-filter .change-stat:not(.is-selected) {
  opacity: 0.42;
}

.change-stat span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.change-stat strong {
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
}

.daily-change-list {
  display: grid;
  gap: 0;
  overflow: clip;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-solid);
  box-shadow: var(--shadow-sm);
}

.daily-change-row {
  display: grid;
  grid-template-columns: 86px minmax(180px, 1.4fr) minmax(112px, 0.7fr) minmax(100px, 0.62fr) minmax(92px, 0.58fr) minmax(180px, 1fr);
  gap: 8px;
  align-items: center;
  min-height: var(--card-row-height);
  padding: var(--card-padding-y) var(--card-padding-x);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.daily-change-row:last-child {
  border-bottom: 0;
}

.daily-change-row:hover {
  border-color: var(--line);
  background: var(--surface-cool);
  box-shadow: inset 3px 0 0 var(--accent);
  z-index: auto;
}

.daily-change-list > .dialog-empty {
  margin: 0;
  padding: 24px;
  text-align: center;
}

.daily-change-main,
.daily-change-power,
.daily-change-metric,
.daily-change-evidence {
  min-width: 0;
  font-variant-numeric: tabular-nums;
}

.daily-change-main strong,
.daily-change-main span,
.daily-change-power span,
.daily-change-power strong,
.daily-change-metric span,
.daily-change-metric strong,
.daily-change-evidence {
  display: block;
}

.daily-change-main strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-change-main span,
.daily-change-power span,
.daily-change-metric span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-change-main small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.daily-change-power strong {
  color: var(--power-num);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", "Microsoft YaHei UI", sans-serif;
  font-size: 18px;
}

.daily-change-metric strong {
  font-size: 13px;
}

.daily-change-evidence {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guild-trend-section,
.guild-compare-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.guild-trend-section {
  margin-bottom: 0;
}

.guild-trend-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 42px;
  gap: 8px;
  padding: 7px 10px;
  border: 0;
  border-radius: 0;
  background: var(--panel-solid);
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.guild-trend-toggle:hover {
  border-color: transparent;
  background: var(--soft);
  box-shadow: none;
}

.guild-trend-toggle > span:first-child {
  display: flex;
  flex: 1 1 auto;
  align-items: baseline;
  min-width: 0;
  gap: 8px;
}

.guild-trend-toggle strong {
  font-size: 13px;
}

.guild-trend-toggle small,
.guild-trend-toggle-state {
  color: var(--muted);
  font-size: 11px;
}

.guild-trend-toggle-state {
  flex: 0 0 auto;
}

.guild-trend-toggle svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: transform 160ms ease;
}

.guild-trend-section.is-expanded .guild-trend-toggle {
  border-bottom: 1px solid var(--line);
}

.guild-trend-section.is-expanded .guild-trend-toggle svg {
  transform: rotate(180deg);
}

.guild-trend-body[hidden] {
  display: none;
}

.guild-trend-body .trend-chart {
  padding-top: 8px;
}

.trend-chart {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 12px 14px 8px;
}

.trend-chart.is-inline {
  width: min(100%, 980px);
  margin-inline: auto;
  padding-block: 14px 10px;
}

.trend-chart figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.trend-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.trend-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.trend-legend-item i {
  width: 15px;
  height: 2px;
  border-radius: 2px;
  background: var(--series-color);
}

.trend-legend-change {
  color: var(--text-secondary);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.trend-legend-change.is-positive {
  color: var(--good);
}

.trend-legend-change.is-negative {
  color: var(--bad);
}

.trend-legend-item.is-warning i {
  width: 7px;
  height: 7px;
  border: 1px solid var(--bad);
  background: transparent;
  transform: rotate(45deg);
}

.trend-chart svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 170px;
  overflow: visible;
}

.trend-grid-line {
  stroke: var(--line);
  stroke-width: 1;
}

.trend-axis-label {
  fill: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.trend-series-area {
  fill: var(--series-color);
  opacity: 0.09;
}

.trend-series-line {
  fill: none;
  stroke: var(--series-color);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.25;
}

.trend-point {
  fill: var(--panel-solid);
  stroke: var(--series-color);
  stroke-width: 2;
  cursor: help;
  opacity: 0;
  transition: opacity var(--motion-fast) ease, stroke-width var(--motion-fast) ease;
}

.trend-point:hover,
.trend-point:focus {
  outline: none;
  opacity: 1;
  stroke-width: 4;
}

.trend-point.is-current {
  opacity: 1;
}

.trend-anomaly rect {
  fill: var(--panel-solid);
  stroke: var(--bad);
  stroke-width: 1.25;
  opacity: 0.8;
}

.trend-hover-line {
  pointer-events: none;
  stroke: var(--text-secondary);
  stroke-dasharray: 3 3;
  stroke-width: 1;
  opacity: 0;
  transition: opacity 100ms ease;
}

.trend-hover-zone {
  fill: transparent;
  cursor: crosshair;
  outline: none;
}

.trend-hover-column.is-active .trend-hover-line {
  opacity: 0.55;
}

.trend-tooltip {
  position: absolute;
  z-index: 5;
  display: grid;
  gap: 3px;
  min-width: 132px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel-solid);
  box-shadow: var(--shadow-lg);
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.4;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
}

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

.trend-tooltip.is-below {
  transform: translate(-50%, 10px);
}

.trend-tooltip b {
  color: var(--text);
  font-size: 12px;
}

.trend-tooltip-value {
  display: flex;
  align-items: center;
  gap: 5px;
}

.trend-tooltip-value i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--series-color);
}

.trend-tooltip-value strong {
  margin-left: auto;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.trend-tooltip-warning {
  color: var(--bad);
  font-weight: 700;
}

.trend-empty {
  margin: 0;
  padding: 18px 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.player-archive-body > .trend-chart,
#archiveViewBasic > .trend-chart {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.guild-compare-dashboard,
.guild-compare-results {
  --compare-left: #9a6b0a;
  --compare-right: #0f7c82;
  display: grid;
  gap: 10px;
  min-width: 0;
}

:root[data-theme="dark"] .guild-compare-dashboard,
:root[data-theme="dark"] .guild-compare-results {
  --compare-left: #b48608;
  --compare-right: #0284c7;
}

.guild-compare-picker {
  display: grid;
  position: relative;
  grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.guild-compare-combobox-label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
}

.guild-compare-combobox {
  position: relative;
  min-width: 0;
}

.guild-compare-search {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel-solid);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.guild-compare-search:focus {
  border-color: var(--accent);
  outline: 3px solid var(--focus-ring);
}

.guild-compare-option-list {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  z-index: 40;
  max-height: min(300px, 48vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--scrollbar-thumb) transparent;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-solid);
  box-shadow: var(--shadow-float);
}

.guild-compare-option-list::-webkit-scrollbar {
  width: 8px;
}

.guild-compare-option-list::-webkit-scrollbar-track {
  margin-block: 5px;
  background: transparent;
}

.guild-compare-option-list::-webkit-scrollbar-thumb {
  border: 2px solid var(--panel-solid);
  border-radius: 999px;
  background: var(--scrollbar-thumb);
}

.guild-compare-option-list::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

.guild-compare-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  text-align: left;
}

.guild-compare-option:hover,
.guild-compare-option.is-active {
  background: var(--soft);
}

.guild-compare-option[aria-selected="true"] {
  color: var(--accent-strong);
}

.guild-compare-option strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guild-compare-option span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.guild-compare-no-result {
  margin: 0;
  padding: 18px 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.guild-filter-combobox {
  position: relative;
  min-width: 0;
}

.guild-filter-search {
  min-height: 34px;
  padding-right: 38px;
}

.guild-filter-toggle {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  display: grid;
  width: 36px;
  min-width: 36px;
  min-height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.guild-filter-toggle:hover,
.guild-filter-toggle:focus-visible {
  background: transparent;
  color: var(--accent);
  box-shadow: none;
  transform: none;
}

.guild-filter-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform var(--motion-standard) ease;
}

.guild-filter-combobox.is-open .guild-filter-toggle svg {
  transform: rotate(180deg);
}

.guild-filter-option-list {
  right: 0;
  left: auto;
  width: 100%;
  max-width: calc(100vw - 24px);
}

.guild-filter-option {
  grid-template-columns: minmax(0, 1fr) 18px;
}

.guild-filter-option::after {
  color: var(--accent);
  content: "";
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.guild-filter-option[aria-selected="true"]::after {
  content: "✓";
}

.guild-compare-empty {
  display: grid;
  place-content: center;
  gap: 5px;
  min-height: 156px;
  padding: 20px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
  color: var(--muted);
  text-align: center;
}

.guild-compare-empty strong {
  color: var(--text-secondary);
  font-size: 14px;
}

.guild-compare-empty span {
  font-size: 12px;
}

.guild-compare-swap {
  width: 40px;
  min-height: 38px;
  padding: 0;
  color: var(--accent);
  font-size: 20px;
}

.guild-compare-days {
  display: flex;
  gap: 4px;
}

.guild-compare-days button {
  min-height: 38px;
  padding: 0 10px;
}

.guild-compare-days button.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.guild-compare-headline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.42fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
}

.guild-compare-side,
.guild-compare-gap {
  display: grid;
  align-content: center;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
  font-variant-numeric: tabular-nums;
}

.guild-compare-side > span,
.guild-compare-side small,
.guild-compare-side > div,
.guild-compare-gap span,
.guild-compare-gap small {
  color: var(--muted);
  font-size: 11px;
}

.guild-compare-side h2 {
  overflow: hidden;
  margin: 3px 0 8px;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guild-compare-side > strong {
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", "Microsoft YaHei UI", sans-serif;
  font-size: 28px;
}

.guild-compare-side.is-left {
  border-color: color-mix(in srgb, var(--compare-left) 34%, var(--line));
  background: linear-gradient(90deg, color-mix(in srgb, var(--compare-left) 10%, transparent), transparent 58%), var(--panel);
  box-shadow: inset 3px 0 0 var(--compare-left), var(--shadow);
}

.guild-compare-side.is-right {
  border-color: color-mix(in srgb, var(--compare-right) 30%, var(--line));
  background: linear-gradient(270deg, color-mix(in srgb, var(--compare-right) 10%, transparent), transparent 58%), var(--panel);
  box-shadow: inset -3px 0 0 var(--compare-right), var(--shadow);
}

.guild-compare-side.is-left h2,
.guild-compare-side.is-left > strong {
  color: var(--compare-left);
}

.guild-compare-side.is-right h2,
.guild-compare-side.is-right > strong {
  color: var(--compare-right);
}

.guild-compare-side > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.guild-compare-gap {
  justify-items: center;
  background: linear-gradient(90deg, color-mix(in srgb, var(--compare-left) 6%, transparent), transparent 36%, transparent 64%, color-mix(in srgb, var(--compare-right) 6%, transparent)), var(--panel);
  text-align: center;
}

.guild-compare-gap > b {
  color: var(--muted);
  font-size: 11px;
}

.guild-compare-gap strong {
  margin: 5px 0;
  font-size: 20px;
}

.guild-compare-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.guild-compare-panel {
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.guild-compare-panel.is-trend-panel .trend-chart {
  width: 100%;
  margin-block: 0;
}

.guild-trend-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 9px 12px 0;
  color: var(--muted);
  font-size: 11px;
}

.guild-compare-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 4px;
}

.guild-compare-panel-head h3 {
  margin: 0;
  font-size: 13px;
}

.guild-compare-panel-head span,
.guild-sample-note {
  color: var(--muted);
  font-size: 11px;
}

.guild-distribution {
  display: grid;
  gap: 4px;
  padding: 8px 18px;
}

.guild-distribution-sides {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 124px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  padding: 5px 53px 2px;
  font-size: 11px;
}

.guild-distribution-sides strong {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guild-distribution-sides strong i {
  flex: 0 0 16px;
  width: 16px;
  height: 3px;
  border-radius: 2px;
}

.guild-distribution-sides .is-left {
  justify-content: flex-end;
  color: var(--compare-left);
  text-align: right;
}

.guild-distribution-sides .is-left i {
  order: 2;
  background: var(--compare-left);
}

.guild-distribution-sides > span {
  color: var(--muted);
  text-align: center;
}

.guild-distribution-sides .is-right {
  color: var(--compare-right);
}

.guild-distribution-sides .is-right i {
  background: var(--compare-right);
}

.guild-distribution-row {
  display: grid;
  grid-template-columns: 28px minmax(48px, 1fr) 124px minmax(48px, 1fr) 28px;
  gap: 7px;
  align-items: center;
  min-height: 25px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.guild-distribution-bar {
  display: block;
  position: relative;
  width: 100%;
  height: 11px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--soft);
}

.guild-distribution-bar::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--bar-size);
}

.guild-distribution-bar.is-left {
  justify-self: end;
}

.guild-distribution-bar.is-left::after {
  right: 0;
  border-radius: 3px 0 0 3px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--compare-left) 28%, transparent), var(--compare-left));
}

.guild-distribution-bar.is-right {
  justify-self: start;
}

.guild-distribution-bar.is-right::after {
  left: 0;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, var(--compare-right), color-mix(in srgb, var(--compare-right) 28%, transparent));
}

.guild-distribution-bar.is-winner::after {
  opacity: 1;
}

.guild-distribution-bar.is-left.is-winner::after {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--compare-left) 88%, transparent), 0 0 5px color-mix(in srgb, var(--compare-left) 18%, transparent);
}

.guild-distribution-bar.is-right.is-winner::after {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--compare-right) 88%, transparent), 0 0 5px color-mix(in srgb, var(--compare-right) 18%, transparent);
}

.guild-distribution-bar.is-loser::after {
  opacity: 0.64;
}

.guild-distribution-bar.is-even::after {
  opacity: 0.82;
}

.guild-distribution-row > span:first-child {
  color: var(--compare-left);
  font-weight: 700;
}

.guild-distribution-row > span:last-child {
  color: var(--compare-right);
  font-weight: 700;
}

.guild-distribution-band {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  white-space: nowrap;
}

.guild-distribution-band > span,
.guild-distribution-lead {
  flex: 0 0 auto;
}

.guild-distribution-lead {
  font-size: 10px;
  font-weight: 700;
}

.guild-distribution-lead.is-left {
  color: var(--compare-left);
}

.guild-distribution-lead.is-right {
  color: var(--compare-right);
}

.guild-distribution-lead.is-even {
  color: var(--muted);
}

.guild-distribution-row.is-hidden-power {
  margin-top: 3px;
  padding-top: 7px;
  border-top: 1px dashed var(--line-strong);
  color: var(--muted);
}

.guild-distribution-row.is-hidden-power .guild-distribution-bar {
  border: 1px dashed var(--line-strong);
}

.guild-distribution-row.is-hidden-power .guild-distribution-bar::after {
  filter: saturate(0.58);
  opacity: 0.62;
}

.guild-sample-note {
  margin: 0;
  padding: 0 12px 10px;
  text-align: right;
}

.loading-state.is-compact {
  min-height: 180px;
}


/* Touch direction is resolved by the chart before cancelling horizontal moves.
   Mouse selection and context menus keep their normal desktop behavior. */
@media (pointer: coarse) {
  .trend-chart svg { touch-action: auto; }
  .trend-chart svg, .trend-chart svg * {
    user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  }
}

@media (pointer: coarse) {
  /* A fading old line looks like another selected date during touch scrubbing. */
  .trend-hover-line { transition: none; }
}

.pager {
  position: sticky;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  width: fit-content;
  margin: 16px auto 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  white-space: nowrap;
}

.pager[hidden] {
  display: none;
}

.page-size-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.page-size-control select {
  width: auto;
  min-width: 74px;
}

.page-timeline {
  position: fixed;
  top: 214px;
  right: max(16px, calc((100vw - 1180px) / 2 - 52px));
  z-index: 12;
  display: grid;
  gap: 8px;
  width: 28px;
  min-width: 28px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  opacity: 0;
  pointer-events: none;
  transition: none;
}

.page-timeline:hover,
.page-timeline:focus-within,
.page-timeline.is-active {
  opacity: 1;
}

.page-timeline-track {
  position: relative;
  display: grid;
  gap: 18px;
}

.page-timeline-track::before {
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: calc(50% - 0.75px);
  width: 1.5px;
  background: linear-gradient(
    color-mix(in srgb, var(--line-strong) 80%, var(--line)),
    color-mix(in srgb, var(--accent) 55%, var(--line-strong)),
    color-mix(in srgb, var(--line-strong) 80%, var(--line))
  );
  content: "";
  border-radius: 2px;
}

.page-timeline button {
  position: relative;
  display: grid;
  justify-self: center;
  place-items: center;
  width: 28px;
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  pointer-events: auto;
  transition: color 0.2s ease;
  box-shadow: none;
}

.page-timeline-dot {
  position: relative;
  z-index: 1;
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line-strong));
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, var(--panel-solid), var(--accent-soft));
  box-shadow: 0 1px 3px color-mix(in srgb, var(--text) 12%, transparent);
  transition: width 0.2s ease, height 0.2s ease,
    border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.page-timeline .is-current .page-timeline-dot {
  width: 14px;
  height: 14px;
  border-color: var(--accent);
  background: radial-gradient(
    circle at 30% 25%,
    color-mix(in srgb, var(--accent) 55%, var(--panel-solid)),
    var(--accent)
  );
  box-shadow: 0 0 0 3px var(--accent-soft),
    0 2px 4px color-mix(in srgb, var(--accent) 22%, transparent);
}

.page-timeline-top svg {
  width: 18px;
  height: 18px;
}

.page-timeline .page-timeline-top {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent-soft) 72%, var(--panel-solid));
  color: var(--accent-strong);
}

.page-timeline-position {
  justify-self: center;
  min-width: 28px;
  padding: 3px 0;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-soft) 72%, var(--panel-solid));
  color: var(--accent-strong);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  pointer-events: none;
}

.page-timeline-label {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: calc(100% + 6px);
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-solid);
  color: var(--muted);
  box-shadow: var(--shadow);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  opacity: 0;
  transform: translate(3px, -50%);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity var(--motion-fast) ease, transform var(--motion-fast) ease;
}

.page-timeline button:hover .page-timeline-label,
.page-timeline button:focus-visible .page-timeline-label {
  opacity: 1;
  transform: translate(0, -50%);
}

.page-timeline button:hover,
.page-timeline button:focus-visible {
  background: color-mix(in srgb, var(--accent-soft) 72%, transparent);
  color: var(--accent);
  transform: none;
  box-shadow: none;
}

.page-timeline button:hover .page-timeline-dot,
.page-timeline button:focus-visible .page-timeline-dot {
  background: radial-gradient(
    circle at 30% 25%,
    color-mix(in srgb, var(--accent) 55%, var(--panel-solid)),
    var(--accent)
  );
  border-color: var(--accent);
  transform: scale(1.1);
}


@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}

@media (min-width: 781px) and (max-width: 1448px) {
  .app-shell {
    width: calc(100% - 80px);
    margin-right: 68px;
    margin-left: 12px;
  }

  .page-timeline {
    right: 16px;
  }
}

@media (max-width: 1040px) {
  .app-shell {
    width: calc(100% - 20px);
    margin-right: auto;
    margin-left: auto;
  }

  .topbar {
    gap: 10px;
  }

  h1 {
    font-size: 22px;
  }

  .filters {
    grid-template-columns: minmax(128px, 0.72fr) minmax(92px, 0.55fr) minmax(108px, 0.64fr) minmax(120px, 0.72fr) minmax(150px, 1fr) 40px;
    gap: 6px;
  }

  .filters.is-change-mode {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .filters.is-guild-compare-mode {
    grid-template-columns: minmax(128px, 0.72fr) repeat(2, minmax(120px, 1fr)) 40px;
  }

  .page-timeline {
    display: none;
  }
}

@media (max-width: 800px) {
  .filter-shell:not(.is-mobile-collapsed) {
    max-height: calc(100dvh - 16px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
  }

  .filter-shell:not(.is-mobile-collapsed) ~ .ranking-panel .change-overview {
    position: relative;
    top: auto;
  }

  .mobile-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    padding: 6px 10px;
    border: 0;
    background: transparent;
    color: var(--text);
    text-align: left;
    box-shadow: none;
  }

  .mobile-filter-toggle:hover {
    color: var(--text);
    box-shadow: none;
  }

  .mobile-filter-copy {
    display: grid;
    min-width: 0;
    gap: 1px;
  }

  .mobile-filter-copy span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
  }

  .mobile-filter-copy strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-filter-chevron {
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 160ms ease;
  }

  .mobile-filter-toggle[aria-expanded="true"] .mobile-filter-chevron {
    transform: rotate(225deg) translate(-2px, -2px);
  }

  .mobile-filter-toggle[aria-expanded="true"] {
    margin-bottom: 6px;
    border-bottom: 1px solid var(--line);
  }

  .filter-shell.is-mobile-collapsed .filters {
    display: none;
  }

  .ranking-card {
    grid-template-columns: 50px minmax(0, 1.05fr) minmax(120px, 0.55fr);
  }

  .guild-card {
    grid-template-columns: 50px minmax(0, 1fr) minmax(108px, auto);
  }

  .power-block {
    grid-column: 3;
    grid-row: 1;
  }

  .player-card-detail {
    grid-column: 2 / -1;
  }

  .guild-block,
  .card-metrics,
  .card-note {
    grid-column: 2 / -1;
  }

  .guild-card .card-action {
    grid-column: 3;
    grid-row: 2;
    align-self: end;
  }

  .guild-card .card-metrics {
    grid-column: 2;
  }

  .guild-former-name {
    display: none;
  }

  .change-overview {
    grid-template-columns: 1fr;
  }

  .change-stat-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .daily-change-row {
    grid-template-columns: 72px minmax(0, 1fr) minmax(116px, 0.7fr);
  }

  .daily-change-metric,
  .daily-change-evidence {
    grid-column: 2 / -1;
  }

  .daily-change-power {
    grid-column: 3;
    grid-row: 1;
  }

  .guild-block {
    display: flex;
    gap: 8px;
    align-items: baseline;
  }

  .guild-block strong,
  .guild-block span {
    text-align: left;
  }
}

@media (max-width: 780px) {
  .app-shell {
    width: min(100% - 20px, 1440px);
    margin: 0 auto;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters.is-change-mode {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters.is-guild-compare-mode {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guild-compare-grid {
    grid-template-columns: 1fr;
  }

  .search-field {
    grid-column: 1 / -1;
    order: 9;
  }

  .filter-action-field {
    position: absolute;
    right: 4px;
    bottom: 4px;
    order: 10;
  }

  .search-field input {
    padding-right: 48px;
  }

  .change-range-quick {
    display: grid;
    gap: 4px;
    overflow: visible;
    padding-bottom: 0;
  }

  .change-range-summary {
    justify-items: start;
    gap: 4px;
    text-align: left;
  }

  .page-timeline {
    display: none;
  }

  .ranking-item:not(.is-expanded) > .guild-card .guild-period-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ranking-item:not(.is-expanded) > .guild-card .guild-period-metrics .compact-metric:nth-child(n + 3),
  .guild-card .change-action {
    display: none;
  }

  .ranking-item.is-expanded > .guild-card .guild-period-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .guild-card .inline-trend-toggle svg {
    display: none;
  }

  .guild-card .inline-trend-toggle::after {
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    content: "";
    transform: translateY(-2px) rotate(45deg);
    transition: transform 160ms ease;
  }

  .guild-card .inline-trend-toggle[aria-expanded="true"]::after {
    transform: translateY(2px) rotate(225deg);
  }

  .ranking-item.is-expanded > .mobile-guild-change-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 38px;
    margin-top: 6px;
    border-color: var(--accent);
    background: var(--accent);
    color: var(--panel-solid);
    font-size: 13px;
    font-weight: 800;
  }
}

@media (min-width: 521px) and (max-width: 780px) {
  .guild-card {
    grid-template-columns: 42px minmax(108px, 1fr) minmax(140px, 0.9fr) minmax(88px, 0.62fr) 32px;
    gap: 5px;
  }

  .guild-card .card-rank {
    grid-column: 1;
    grid-row: 1;
  }

  .guild-card .player-block {
    grid-column: 2;
    grid-row: 1;
  }

  .guild-card .guild-period-metrics {
    grid-column: 3;
    grid-row: 1;
  }

  .guild-card .power-block {
    grid-column: 4;
    grid-row: 1;
  }

  .guild-card .card-action {
    grid-column: 5;
    grid-row: 1;
  }

  .ranking-item.is-expanded > .guild-card .guild-period-metrics {
    grid-column: 2 / 5;
    grid-row: 2;
  }
}

@media (max-width: 720px) {
  .ranking-error-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-shell {
    width: calc(100% - 16px);
    padding-top: 6px;
  }

  .sticky-toolbar {
    padding-bottom: 6px;
  }

  .toolbar-card,
  .filter-shell {
    border-radius: 12px;
  }

  .toolbar-card {
    padding: 7px;
  }

  .filter-shell {
    padding: 6px;
  }

  .change-range-mobile-select {
    display: block;
  }

  .change-range-buttons {
    display: none;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    margin-bottom: 6px;
  }

  .brand-mark {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
    font-size: 18px;
    border-width: 1.5px;
  }

  .topbar p {
    max-width: 220px;
    white-space: nowrap;
  }

  .mode-tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .mode-tab {
    min-height: 44px;
    padding: 0 4px;
    font-size: 14px;
  }

  h1 {
    font-size: 20px;
  }

  .topbar p {
    max-width: 100%;
  }

  .toolbar-actions {
    flex: 0 0 auto;
    gap: 4px;
  }

  .icon-btn {
    width: 44px;
    min-height: 44px;
  }

  .ranking-item > .inline-trend-toggle {
    top: 11px;
    right: 7px;
  }

  .inline-trend-toggle {
    flex-basis: 36px;
    width: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  .change-action {
    min-width: 48px;
    min-height: 36px;
    padding-inline: 8px;
  }

  .card-action {
    gap: 8px;
  }

  .inline-trend-toggle::before,
  .change-action::before {
    position: absolute;
    inset: -4px;
    content: "";
  }

  .guild-compare-search,
  .guild-compare-option,
  .guild-compare-swap,
  .guild-compare-days button {
    min-height: 44px;
  }

  .filters input,
  .filters select,
  .filters button,
  .pager button,
  .pager select,
  .change-dialog button,
  .change-dialog input {
    min-height: 44px;
  }

  .dialog-head .dialog-icon-btn {
    width: 44px;
    min-width: 44px;
  }

  .ranking-panel {
    margin-top: 4px;
    overflow: visible;
  }

  .guild-compare-picker {
    grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr);
  }

  .guild-compare-days {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .ranking-list {
    gap: 8px;
  }

  .change-dashboard {
    gap: 5px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: clip;
  }

  .change-overview {
    position: sticky;
    top: calc(var(--sticky-filter-height, 0px) + 4px);
    z-index: 16;
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    padding: 6px;
    border-radius: 9px;
    background: var(--panel-solid);
    box-shadow: var(--shadow-lg);
  }

  .change-range-desktop {
    display: none;
  }

  .change-range-mobile {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--muted);
    font-size: 12px;
  }

  .change-range-mobile summary,
  .change-range-mobile.is-plain {
    min-height: 44px;
    padding: 7px 10px;
  }

  .change-range-mobile summary {
    display: flex;
    position: relative;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-right: 30px;
    cursor: pointer;
    list-style: none;
  }

  .change-range-mobile summary::-webkit-details-marker {
    display: none;
  }

  .change-range-mobile summary::after {
    content: "";
    position: absolute;
    right: 12px;
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 160ms ease;
  }

  .change-range-mobile[open] summary::after {
    transform: rotate(225deg) translate(-2px, -2px);
  }

  .change-range-mobile summary span,
  .change-range-mobile summary strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .change-range-mobile summary span {
    min-width: 0;
  }

  .change-stat-grid,
  .daily-change-list,
  .change-dashboard .daily-change-row {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .change-range-mobile summary strong {
    flex: 0 0 auto;
    color: var(--text-secondary);
    font-size: 12px;
  }

  .change-range-mobile-copy {
    display: grid;
    gap: 5px;
    padding: 8px 10px 10px;
    border-top: 1px solid var(--line);
    line-height: 1.5;
  }

  .change-range-mobile-copy span {
    display: block;
  }

  .ranking-card.player-card {
    grid-template-columns: 42px minmax(0, 1fr) minmax(88px, auto);
    align-items: start;
    gap: 7px 10px;
    min-height: 0;
    padding: 9px 10px;
  }

  .ranking-item > .ranking-card.player-card {
    padding-right: 48px;
  }

  .player-card .card-rank {
    grid-column: 1;
    grid-row: 1;
  }

  .player-card .player-block {
    grid-column: 2;
    grid-row: 1;
  }

  .player-card .player-name {
    line-height: 1.35;
  }

  .player-card .player-meta {
    display: grid;
    grid-template-columns: max-content minmax(36px, 0.78fr) minmax(52px, 1.22fr);
    gap: 4px 8px;
    margin-top: 4px;
    line-height: 1.5;
  }

  .player-card .player-meta > * {
    min-width: 0;
  }

  .player-card .power-block {
    grid-column: 3;
    grid-row: 1;
    text-align: right;
  }

  .player-card .power-block strong {
    font-size: 22px;
  }

  .player-card .power-block span {
    text-align: right;
  }

  .player-card-detail {
    display: grid;
    grid-column: 2 / -1;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto;
    gap: 6px 12px;
    align-items: center;
    min-width: 0;
  }

  .player-card-detail .player-card-aside {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: auto minmax(72px, 1fr);
    gap: 8px;
    align-items: center;
    width: 100%;
    min-height: 22px;
  }

  .player-card-detail .guild-block {
    display: none;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
  }

  .player-card-detail .guild-block strong,
  .player-card-detail .guild-block span {
    display: block;
    overflow: hidden;
    margin: 0;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .player-card-detail .guild-block strong {
    flex: 0 1 auto;
  }

  .player-card-detail .guild-block span {
    flex: 0 1 auto;
  }

  .player-card-detail .player-metrics {
    display: flex;
    grid-column: 1;
    grid-row: 1;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 4px 11px;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .player-card-detail .compact-metric {
    display: flex;
    flex: 0 0 auto;
    gap: 3px;
  }

  .player-card-detail .card-note {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    height: 22px;
    padding: 2px 8px;
    font-size: 12px;
    line-height: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .player-card-aside:not(.has-metrics) .card-note {
    grid-column: 1 / -1;
  }

  .trend-chart {
    padding-inline: 10px;
  }

  .trend-axis-label {
    font-size: 14px;
  }

  .trend-chart svg {
    min-height: 166px;
  }

  .player-mobile-guild,
  .player-mobile-scope {
    display: block;
  }

  .player-mobile-guild {
    color: var(--text);
    font-weight: 700;
    padding-left: 8px;
    border-left: 1px solid var(--line-strong);
  }

  .player-mobile-scope {
    display: none;
  }

  .change-dashboard .daily-change-row {
    grid-template-columns: 72px minmax(0, 1fr) minmax(88px, auto);
    gap: 4px 8px;
    align-items: start;
    min-height: 0;
    padding: 8px 10px;
  }

  .change-dashboard .daily-change-row > .status-badge {
    grid-column: 1;
    grid-row: 1;
  }

  .change-dashboard .daily-change-main {
    grid-column: 2;
    grid-row: 1;
  }

  .change-dashboard .daily-change-main span {
    margin-top: 2px;
    font-size: 11px;
  }

  .change-dashboard .daily-change-power {
    grid-column: 3;
    grid-row: 1;
    text-align: right;
  }

  .change-dashboard .daily-change-power span {
    font-size: 11px;
  }

  .change-dashboard .daily-change-power strong {
    font-size: 18px;
  }

  .change-dashboard .daily-change-metric {
    display: flex;
    grid-row: 2;
    align-items: baseline;
    gap: 4px;
  }

  .change-dashboard .daily-change-metric.is-power-change {
    grid-column: 2;
  }

  .change-dashboard .daily-change-metric.is-rank-change {
    grid-column: 3;
    justify-content: flex-end;
  }

  .change-dashboard .daily-change-metric span,
  .change-dashboard .daily-change-metric strong {
    display: inline;
    font-size: 12px;
  }

  .change-dashboard .daily-change-evidence {
    display: none;
  }

  .pager {
    width: 100%;
    gap: 4px;
    padding: 8px;
    justify-content: space-between;
    white-space: normal;
  }

  .pager button {
    flex: 0 0 auto;
    min-width: 54px;
    padding: 0 8px;
  }

  .pager > span {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
  }

  .page-size-control {
    flex: 0 0 auto;
    gap: 4px;
  }

  .page-size-control span {
    display: none;
  }

  .page-size-control select {
    min-width: 62px;
    padding: 0 6px;
  }
}

@media (max-width: 640px) {
  .member-change-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .member-change-presets {
    grid-column: 1 / -1;
  }

  .guild-change-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guild-change-overview > div:nth-child(2) {
    border-right: 0;
  }

  .guild-change-overview > div:last-child {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 520px) {
  #changeDialogExpand {
    display: none;
  }

  .change-dialog.is-guild-change.is-expanded,
  .change-dialog.is-guild-change {
    width: calc(100vw - 16px);
    height: fit-content;
    max-height: calc(100dvh - 16px);
    border-radius: 12px;
  }

  .change-dialog.is-guild-change .change-dialog-body {
    padding: 10px;
  }

  .change-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .change-summary div {
    padding: 8px;
  }

  .change-summary strong {
    font-size: 17px;
  }

  .change-range-quick {
    display: grid;
    gap: 4px;
    overflow: hidden;
  }

  .change-range-buttons {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .change-range-buttons button {
    min-width: max-content;
    white-space: nowrap;
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mode-tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .guild-compare-picker {
    grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr);
  }

  .guild-compare-days {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .guild-compare-headline {
    grid-template-columns: 1fr 88px 1fr;
  }

  .guild-compare-side,
  .guild-compare-gap {
    padding: 10px;
  }

  .guild-compare-side > strong {
    font-size: 22px;
  }

  .trend-chart {
    padding-inline: 6px;
  }

  .trend-chart figcaption {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding-inline: 6px;
  }

  .trend-legend {
    justify-content: flex-start;
  }

  .ranking-card {
    grid-template-columns: 42px minmax(0, 1fr) minmax(88px, 0.55fr);
    align-items: start;
    gap: 6px;
    padding: 7px 8px;
  }

  .player-card-detail .player-card-aside {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  .player-card-detail .player-metrics,
  .player-card-detail .card-note {
    grid-column: 1;
  }

  .player-card-detail .player-metrics {
    grid-row: 1;
  }

  .player-card-detail .card-note {
    grid-row: 2;
    width: 100%;
  }

  .rank-main {
    min-width: 30px;
    height: 28px;
    font-size: 18px;
  }

  .power-block {
    grid-column: 3;
    grid-row: 1;
    text-align: right;
  }

  .guild-block,
  .card-metrics,
  .card-note {
    grid-column: 2 / -1;
  }

  .guild-block {
    display: flex;
    align-items: baseline;
    gap: 8px;
    text-align: left;
  }

  .power-block strong {
    font-size: 20px;
  }

  .power-block span {
    text-align: right;
  }

  .card-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guild-card .guild-period-metrics {
    grid-column: 1 / 3;
    grid-row: 2;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }

  .guild-card .guild-period-metrics .compact-metric {
    min-height: 40px;
    padding: 4px 2px;
  }

  .archive-card .card-rank {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .archive-card .player-block {
    grid-column: 2;
    grid-row: 1;
  }

  .archive-card .power-block {
    grid-column: 3;
    grid-row: 1;
  }

  .archive-card .guild-block {
    grid-column: 2 / -1;
    grid-row: 2;
  }

  .archive-card .card-metrics {
    grid-column: 2 / -1;
    grid-row: 3;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 5px 7px;
    border-radius: 8px;
  }

  .archive-card .compact-metric {
    justify-content: center;
  }

  .archive-card .archive-aliases {
    grid-column: 2 / -1;
    grid-row: 4;
    margin-top: 0;
    padding: 4px 8px;
    border-radius: 7px;
  }

  .guild-card .card-action {
    grid-column: 3;
    grid-row: 2;
    align-self: center;
    justify-content: flex-end;
  }

  .change-compare-grid {
    grid-template-columns: 1fr;
  }

  .archive-timeline-row {
    grid-template-columns: minmax(76px, 0.72fr) minmax(0, 1fr);
  }

  .archive-timeline-row b,
  .archive-timeline-row small {
    grid-column: 2;
  }

  .member-change-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .member-change-row {
    grid-template-columns: 48px minmax(0, 1fr) 84px;
    grid-template-rows: auto auto;
    gap: 5px 8px;
    align-items: start;
    padding: 7px 8px;
  }

  .member-change-row > .status-badge {
    grid-column: 1;
    grid-row: 1;
  }

  .member-change-row > .member-identity {
    grid-column: 2;
    grid-row: 1;
  }

  .member-change-row > .member-change-metric {
    grid-column: 3;
    grid-row: 1;
    text-align: right;
  }

  .member-change-row > .member-guild-path {
    grid-column: 2 / -1;
    grid-row: 2;
  }

  .member-change-row .member-guild-path span,
  .member-change-row .member-guild-path strong {
    display: inline;
  }

  .member-change-row .member-guild-path span {
    margin-right: 6px;
  }

  .change-stat-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 0;
  }

  .change-stat {
    display: grid;
    grid-column: auto;
    justify-items: center;
    align-content: center;
    min-width: 0;
    min-height: 40px;
    gap: 0;
    padding: 2px 3px;
    border-radius: 6px;
  }

  .change-stat span {
    font-size: 12px;
  }

  .change-stat strong {
    font-size: 16px;
  }

  .change-stat:nth-child(4),
  .change-stat:nth-child(5) {
    grid-column: auto;
  }

  .daily-change-row {
    grid-template-columns: 72px repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .daily-change-main {
    grid-column: 2 / -1;
  }

  .daily-change-power,
  .daily-change-metric,
  .daily-change-evidence {
    grid-row: auto;
  }

  .daily-change-power {
    grid-column: 2;
  }

  .daily-change-metric {
    grid-column: auto;
  }

  .daily-change-evidence {
    grid-column: 2 / -1;
  }

  .member-change-metric,
  .member-guild-path {
    grid-column: 2;
  }

  .pager {
    width: 100%;
    gap: 4px;
    padding-left: 8px;
    padding-right: 8px;
    font-size: 13px;
    justify-content: space-between;
  }

  .pager button {
    flex: 0 0 auto;
    min-width: 54px;
    padding: 0 8px;
  }

  .pager > span {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
  }

  .page-size-control {
    flex: 0 0 auto;
    gap: 4px;
  }

  .page-size-control span {
    display: none;
  }

  .page-size-control select {
    min-width: 62px;
    padding: 0 6px;
  }

  .page-timeline {
    display: none;
  }
}

@media (max-width: 360px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .mode-tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .mode-tab {
    padding-inline: 2px;
    font-size: 12px;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .title-cluster,
  .title-cluster > div {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .topbar p {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .filters.is-change-mode {
    grid-template-columns: 1fr;
  }

  .filters.is-guild-compare-mode {
    grid-template-columns: 1fr;
  }

  .guild-compare-picker {
    grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr);
    gap: 4px;
  }

  .guild-compare-search,
  .guild-compare-option {
    min-height: 44px;
  }

  .guild-compare-picker label:last-of-type {
    grid-column: auto;
  }

  .guild-compare-swap {
    grid-column: 2;
    grid-row: 1;
    width: 32px;
  }

  .guild-distribution {
    padding-inline: 10px;
  }

  .guild-distribution-sides {
    grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr);
    gap: 4px;
    padding-inline: 36px;
  }

  .guild-distribution-row {
    grid-template-columns: 22px minmax(32px, 1fr) 92px minmax(32px, 1fr) 22px;
    gap: 4px;
  }

  .guild-compare-headline {
    grid-template-columns: 1fr 1fr;
  }

  .guild-compare-gap {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .change-range-quick {
    grid-row: 3;
    align-items: flex-start;
    flex-direction: column;
  }

  .ranking-card {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .power-block,
  .guild-block,
  .card-metrics,
  .card-note,
  .guild-card .card-action {
    grid-column: 2;
  }

  .power-block {
    grid-row: auto;
    text-align: left;
  }

  .guild-card .guild-period-metrics {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .guild-card .card-action {
    grid-column: 2;
    grid-row: 3;
  }
}

/* Four columns keep player metrics beside identity across the tablet breakpoint. */
@media (min-width: 721px) and (max-width: 1080px) {
  .ranking-list .ranking-item > .ranking-card.player-card {
    grid-template-columns: 46px minmax(0, 1.4fr) minmax(92px, .65fr) minmax(168px, 1fr);
    align-items: center;
    gap: 8px 10px;
    padding-block: 8px;
    padding-right: 90px;
  }
  .player-card .card-rank { grid-column: 1; grid-row: 1; }
  .player-card .player-block { grid-column: 2; grid-row: 1; min-width: 0; }
  .player-card .power-block { grid-column: 3; grid-row: 1; }
  .player-card .player-meta { display: flex; flex-wrap: wrap; gap: 3px 7px; }
  .player-card .player-mobile-guild { display: inline; }
  .player-card .player-card-detail { display: block; grid-column: 4; grid-row: 1; min-width: 0; width: 100%; max-width: 100%; }
  .player-card .player-card-detail .player-card-aside { display: block; width: 100%; min-width: 0; }
  .player-card .player-card-detail .guild-block,
  .player-card .player-card-detail .card-note { display: none; }
  .ranking-list .player-card .player-card-detail .player-metrics {
    display: grid; min-width: 0; width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 6px;
  }
  .ranking-list .player-card .player-card-detail .compact-metric { display: block; min-width: 0; padding: 0 4px; text-align: right; }
  .ranking-list .player-card .player-card-detail .compact-metric > span { font-size: 11px; }
  .ranking-list .player-card .player-card-detail .compact-metric > strong { font-size: 12px; }
}


/* ============================================================
   UI v2 · 收敛版设计语言（redesign/ui-v2, 2026-07-31）
   原则：层级靠排版与明度，不靠边框阴影；静态内容零阴影
   ============================================================ */

/* --- 主题切换过渡（尊重减少动态偏好） --- */
@media (prefers-reduced-motion: no-preference) {
  html.theme-transition,
  html.theme-transition *,
  html.theme-transition *::before,
  html.theme-transition *::after {
    transition: background-color 240ms ease, color 240ms ease, border-color 240ms ease, fill 240ms ease, stroke 240ms ease, box-shadow 240ms ease !important;
  }
}

/* Snapshot the whole viewport so gradients and controls change together. */
html.theme-crossfade,
html.theme-crossfade *,
html.theme-crossfade *::before,
html.theme-crossfade *::after { transition:none !important; }
html.theme-crossfade::view-transition-group(root) { animation-duration:240ms; }
html.theme-crossfade::view-transition-old(root) { animation:none; mix-blend-mode:normal; }
html.theme-crossfade::view-transition-new(root) { animation:theme-reveal 240ms ease-out both; mix-blend-mode:normal; }
@keyframes theme-reveal { from { opacity:0; } to { opacity:1; } }

/* --- 细头部：标题 / 模式切换 / 操作 同一行 --- */
.toolbar-card {
  padding: 6px 10px;
}

.topbar {
  flex-wrap: wrap;
  gap: 8px 12px;
  min-height: 0;
  margin-bottom: 0;
  padding: 2px;
}

.topbar h1 {
  flex: 0 0 auto;
  font-size: 20px;
  white-space: nowrap;
}

.brand-mark {
  flex-basis: 30px;
  width: 30px;
  height: 30px;
  font-size: 17px;
}

.title-cluster > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.topbar p {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 44vw;
  margin: 0;
}

.mode-tabs {
  align-self: center;
  grid-template-columns: repeat(5, auto);
  margin-left: auto;
}

.toolbar-actions {
  align-self: center;
}

.icon-btn {
  width: 40px;
}

@media (max-width: 1100px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .title-cluster {
    grid-column: 1;
    grid-row: 1;
  }

  .toolbar-actions {
    grid-column: 2;
    grid-row: 1;
    margin-left: 0;
  }

  .mode-tabs {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    grid-template-columns: repeat(5, 1fr);
    margin-left: 0;
  }

  .topbar p {
    max-width: 60vw;
  }
}

@media (max-width: 800px) {
  .title-cluster > div {
    display: block;
  }

  .topbar #snapshotMeta {
    max-width: none;
    margin-top: 4px;
    overflow: visible;
    overflow-wrap: anywhere;
    white-space: normal;
    line-height: 1.5;
  }
}

/* --- 行式列表：卡片 → 行，hover 才出底色 --- */
.ranking-list {
  gap: 0;
  overflow: clip;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-solid);
  box-shadow: var(--shadow-sm);
}

.ranking-list:empty {
  border: 0;
  box-shadow: none;
  background: transparent;
}

.ranking-card {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.ranking-item:last-child > .ranking-card,
.ranking-list > .ranking-card:last-child {
  border-bottom: 0;
}

.ranking-card:hover {
  border-color: var(--line);
  background: var(--surface-cool);
  box-shadow: none;
  z-index: auto;
}

.ranking-card[role="button"]:focus-visible,
.daily-change-row:focus-visible {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 3px var(--focus-ring);
  z-index: 2;
}

.ranking-item.is-expanded > .ranking-card {
  background: var(--surface-cool);
}

.inline-trend-panel {
  margin-top: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface-cool);
  box-shadow: none;
}

/* --- 分页：悬浮 + 跳页输入 --- */
.app-shell:has(> .pager:not([hidden])) > .ranking-panel {
  padding-bottom: 72px;
  margin-bottom: -72px;
}

.pager {
  position: sticky;
  bottom: max(10px, env(safe-area-inset-bottom));
  margin: 14px auto 0;
  padding: 8px 14px;
}

.page-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.page-jump input {
  width: 56px;
  min-height: 30px;
  padding: 0 6px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.page-jump input::-webkit-outer-spin-button,
.page-jump input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.page-total {
  white-space: nowrap;
}

body.dialog-open .pager {
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 720px) {
  .guild-filter-option-list {
    right: auto;
    left: 0;
    width: 100%;
    max-width: 100%;
  }

  .pager {
    bottom: max(8px, env(safe-area-inset-bottom));
    max-width: calc(100vw - 16px);
  }

  .page-jump input {
    width: 46px;
  }

  .page-total[data-compact] {
    font-size: 0;
  }

  .page-total[data-compact]::after {
    content: attr(data-compact);
    font-size: 12px;
  }
}

/* --- 骨架屏加载 --- */
.skeleton-card {
  grid-template-columns: 46px minmax(0, 1fr) 160px;
  pointer-events: none;
}

.skel-block {
  display: block;
  border-radius: 6px;
  background: var(--soft);
  animation: skel-pulse 1.4s ease-in-out infinite;
}

.skel-rank {
  justify-self: center;
  width: 22px;
  height: 14px;
}

.skel-lines {
  display: grid;
  gap: 8px;
}

.skel-line {
  height: 12px;
}

.skel-w40 {
  width: 40%;
}

.skel-w65 {
  width: 65%;
}

.skel-power {
  justify-self: end;
  width: 84px;
  height: 20px;
}

@keyframes skel-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.loading-state-inline {
  min-height: 0;
  padding: 16px 0;
}

@media (prefers-reduced-motion: reduce) {
  .skel-block {
    animation: none;
  }
}

/* --- 刷新按钮反馈 --- */
#refreshBtn.is-spinning .toolbar-icon {
  animation: refresh-rotate 0.9s linear infinite;
}

#refreshBtn:disabled {
  cursor: default;
  opacity: 0.7;
}

@keyframes refresh-rotate {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  #refreshBtn.is-spinning .toolbar-icon {
    animation: none;
  }
}

/* --- 空态清除筛选按钮 --- */
.empty-reset {
  min-height: 30px;
  margin-left: 10px;
  padding: 0 12px;
  font-size: 13px;
  vertical-align: baseline;
}

/* --- 数字等宽对齐 --- */
.power-block strong,
.card-rank,
.card-metrics,
.change-stat strong {
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   深色 · 墨色鎏金组件层（v2.1）
   ============================================================ */

/* 功力数字：金榜金 */
:root[data-theme="dark"] .power-block strong,
:root[data-theme="dark"] .daily-change-power strong,
:root[data-theme="dark"] .change-summary .is-power strong {
  color: var(--power-num);
}

:root[data-theme="dark"] .daily-change-power strong .muted,
:root[data-theme="dark"] .change-summary .is-power.is-missing strong {
  color: var(--muted);
}

/* 隐私隐藏行：功力位降回弱灰，避免"已隐藏"被误认为数值 */
:root[data-theme="dark"] .ranking-card.is-private .power-block strong {
  color: var(--muted);
  font-weight: 600;
}

:root[data-theme="dark"] .guild-block > strong {
  color: var(--text);
}

/* 基础表面统一，浮层由独立表面与高光区分。 */
:root[data-theme="dark"] .toolbar-card {
  border-color: color-mix(in srgb, var(--rank) 18%, var(--line));
  background: var(--toolbar-surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

:root[data-theme="dark"] .filter-shell {
  border-color: color-mix(in srgb, var(--accent) 16%, var(--line));
  background: var(--filter-surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

:root[data-theme="dark"] .ranking-list,
:root[data-theme="dark"] .daily-change-list {
  border-color: var(--line);
  background: var(--panel-solid);
}

/* 模式切换：激活态用抬升面而非"白片" */
:root[data-theme="dark"] .mode-tab.is-active {
  background: var(--soft);
  color: var(--accent-strong);
}

@media (min-width: 721px) {
  :root[data-theme="dark"] .mode-tab.is-active,
  :root:not([data-theme="dark"]) .mode-tab.is-active {
    background: var(--accent-fill);
    color: var(--on-accent);
    box-shadow: inset 0 0 0 1px rgba(111,208,193,.45);
  }
  :root[data-theme="dark"] .mode-tab.is-active:hover,
  :root:not([data-theme="dark"]) .mode-tab.is-active:hover {
    background: var(--accent-fill-hover);
    color: var(--on-accent);
  }
}

/* 品牌红章：暗底上换朱砂红 */
:root[data-theme="dark"] .brand-mark {
  border-color: var(--seal);
  background: color-mix(in srgb, var(--seal) 9%, transparent);
  color: var(--seal);
  box-shadow: inset 0 0 4px color-mix(in srgb, var(--seal) 25%, transparent), 0 0 6px color-mix(in srgb, var(--seal) 18%, transparent);
}

/* 输入与下拉：与面板拉开半档明度 */
:root[data-theme="dark"] input,
:root[data-theme="dark"] select {
  background: var(--surface-cool);
}

/* 次级动作平时也保留一层天青提示，不必先悬浮才能发现。 */
:root[data-theme="dark"] .inline-trend-toggle:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 22%, var(--line-strong));
  background: color-mix(in srgb, var(--accent) 4%, transparent);
  color: color-mix(in srgb, var(--accent-strong) 64%, var(--muted));
}

:root[data-theme="dark"] .inline-trend-toggle:not(:disabled):hover,
:root[data-theme="dark"] .inline-trend-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

/* 留言只做局部定位，不再形成横贯整行的蓝色条带。 */
:root[data-theme="dark"] .card-note {
  background: var(--note-surface);
  color: var(--text-secondary);
  box-shadow: inset 2px 0 0 color-mix(in srgb, var(--accent) 28%, transparent);
}

/* 弹窗抽屉：比内容面板再亮半档，体现浮层 */
:root[data-theme="dark"] .change-dialog {
  background: var(--surface-warm);
}

/* 主按钮类（变动/重试等）：墨色里用青边 —— 交互色归青，金色留给数值与事实 */
:root[data-theme="dark"] .empty-reset {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent-strong);
}

:root[data-theme="dark"] .empty-reset:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

/* ============================================================
   青瓷亮色组件层：让主题识别来自大面层级，而不只是强调色
   ============================================================ */

:root:not([data-theme="dark"]) .toolbar-card {
  border-color: var(--line);
  background: var(--toolbar-surface);
  box-shadow: var(--shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

:root:not([data-theme="dark"]) .brand-mark {
  border-color: #a92f39;
  background: var(--seal);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 3px 8px rgba(155, 40, 51, 0.2);
}

:root:not([data-theme="dark"]) .mode-tabs {
  border-color: var(--line);
  background: var(--soft);
}

:root:not([data-theme="dark"]) .filter-shell {
  border-color: var(--line);
  background: var(--filter-surface);
  box-shadow: var(--shadow-lg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

:root:not([data-theme="dark"]) input,
:root:not([data-theme="dark"]) select {
  border-color: var(--line-strong);
}

:root:not([data-theme="dark"]) .ranking-list,
:root:not([data-theme="dark"]) .daily-change-list {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

:root:not([data-theme="dark"]) .daily-change-row:nth-child(even) {
  background: var(--surface-warm);
}

:root:not([data-theme="dark"]) .ranking-card:hover,
:root:not([data-theme="dark"]) .daily-change-row:hover {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--accent) 7%, var(--panel-solid));
  box-shadow: inset 3px 0 0 var(--accent);
}

:root:not([data-theme="dark"]) .card-note {
  background: var(--note-surface);
}

:root:not([data-theme="dark"]) .change-overview,
:root:not([data-theme="dark"]) .guild-compare-picker {
  border-color: var(--line);
  background: var(--surface-warm);
}

:root:not([data-theme="dark"]) .daily-change-row {
  border-color: var(--line);
  background: transparent;
}

:root:not([data-theme="dark"]) .change-dialog {
  border-color: #acc6c0;
}

:root:not([data-theme="dark"]) .dialog-head,
:root:not([data-theme="dark"]) .archive-section h3,
:root:not([data-theme="dark"]) .member-change-head {
  border-color: var(--line);
  background: var(--surface-cool);
}

:root:not([data-theme="dark"]) .guild-trend-toggle {
  background: var(--surface-warm);
}

:root:not([data-theme="dark"]) .premium-btn {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  color: var(--accent-strong);
}

:root:not([data-theme="dark"]) .pager {
  border-color: var(--line-strong);
  background: var(--panel-solid);
  box-shadow: var(--shadow-float);
}

:root:not([data-theme="dark"]) .guild-compare-side.is-left {
  background: linear-gradient(90deg, color-mix(in srgb, var(--compare-left) 15%, transparent), transparent 66%), var(--panel);
}

:root:not([data-theme="dark"]) .guild-compare-side.is-right {
  background: linear-gradient(270deg, color-mix(in srgb, var(--compare-right) 15%, transparent), transparent 66%), var(--panel);
}

/* ============================================================
   2026-08-01 · 质感与布局优化（codex/ui-refinement）
   语义色令牌文档化 / 浅色柔光 / 门派浅色降饱和
   空状态印章 / 弹窗鎏金线 / 时间轴常驻 / 名次定位 / 回顶 / 入场
   ============================================================ */

/* 1. 令牌：补齐 --ink（原未定义）；浅色背景顶部柔光；涨跌色微降饱和 */



/* 2. 未激活模式标签：浅色改用 --text-secondary（AA 4.5+） */
:root:not([data-theme="dark"]) .mode-tab {
  color: var(--text-secondary);
}

/* 3. 品牌标题：衬线/楷体系，强化国风意象 */
h1 {
  font-family: "KaiTi", "STKaiti", "楷体", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  font-weight: 700;
}

/* Shared Xingxingcha brand illustration, including older WebViews. */
.empty:not(.empty-error)::before {
  content: "";
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  background: url("/_assets/e077e5239cc31eedc355847dab09836e7e5e0e6bfb1568b09170ae62276cba7d/xingxingcha.svg") center / contain no-repeat;
}

/* 6. 弹窗头部：鎏金细线收尾 */
:root:not([data-theme="dark"]) .dialog-head,
:root[data-theme="dark"] .dialog-head {
  border-bottom-color: color-mix(in srgb, var(--rank) 34%, var(--line));
}

/* 7. 页内时间轴：细线常驻，悬停/滚动时全亮 */
.page-timeline {
  width: 28px;
  min-width: 28px;
  opacity: 0.9;
}
@media (min-width: 1449px) {
  .page-timeline {
    right: max(16px, calc((100vw - 1180px) / 2 - 52px));
  }
}

/* 8. 回顶按钮（移动端，滚动后出现） */
.back-top-btn {
  position: fixed;
  right: 18px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--panel-solid);
  color: var(--accent-strong);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}
.back-top-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.back-top-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.back-top-btn svg {
  width: 20px;
  height: 20px;
}
@media (min-width: 721px) {
  .back-top-btn {
    display: none;
  }
}

/* 9. 分页器：名次定位 + 当前名次范围 */
.rank-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.rank-jump[hidden] {
  display: none;
}
.rank-jump input {
  width: 76px;
  min-width: 76px;
}
.rank-jump .page-total {
  color: var(--muted);
  font-size: 12px;
}
.ranking-card.is-rank-target {
  border-color: var(--line);
  background: var(--surface-cool);
  box-shadow: inset 3px 0 0 var(--accent);
  z-index: auto;
}
:root:not([data-theme="dark"]) .ranking-card.is-rank-target {
  background: color-mix(in srgb, var(--accent) 7%, var(--panel-solid));
}
:root[data-theme="dark"] .ranking-card.is-rank-target {
  background: var(--surface-warm);
}

/* 暗色列表的 hover、键盘焦点、走势图展开和名次定位使用同一反馈。 */
:root[data-theme="dark"] .ranking-list .ranking-card:hover,
:root[data-theme="dark"] .ranking-list .ranking-item.is-expanded > .ranking-card,
:root[data-theme="dark"] .ranking-list .ranking-card.is-rank-target,
:root[data-theme="dark"] .daily-change-row:hover {
  border-color: var(--line);
  background: var(--surface-hover);
  box-shadow: inset 3px 0 0 var(--accent);
}

:root[data-theme="dark"] .ranking-list .ranking-card[role="button"]:focus-visible,
:root[data-theme="dark"] .daily-change-row:focus-visible {
  border-color: var(--accent);
  background: var(--surface-hover);
  box-shadow: inset 3px 0 0 var(--accent), inset 0 0 0 2px var(--focus-ring);
}
@media (max-width: 720px) {
  .mode-tabs {
    padding-block: 2.5px;
  }

  .rank-jump {
    display: none !important;
  }
}

/* 10. 筛选区滚动紧凑模式（桌面/平板） */
.filter-shell.is-compact {
  padding-block: 5px;
}
.filter-shell.is-compact .filters {
  gap: 5px;
}
.filter-shell.is-compact .filter-field {
  gap: 2px;
}
.filter-shell.is-compact .filter-caption {
  display: none;
}
.filter-shell.is-compact .filters > label {
  gap: 0;
  font-size: 0;
}
.filter-shell.is-compact .filters > label > input,
.filter-shell.is-compact .filters > label > select {
  font-size: 14px;
}
.filter-shell.is-compact .guild-filter-field > label {
  display: none;
}
.filter-shell.is-compact select,
.filter-shell.is-compact input {
  min-height: 30px;
}

/* 11. 变动概览：语义色圆点（换帮紫 / 改名金 / 新出现绿 / 消失红 / 涨功力青） */
.change-stat {
  align-items: center;
}
.change-stat::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--muted);
}
.change-stat.status-move::before { background: var(--status-move); }
.change-stat.status-rename::before { background: var(--rank); }
.change-stat.status-join::before { background: var(--good); }
.change-stat.status-leave::before { background: var(--bad); }
.change-stat.status-up::before { background: var(--accent); }


/* Compare controls need to escape the rounded list shell while their menus are open. */
:root .ranking-list.is-guild-compare-list {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* Theme surfaces and readable control states. Keep the outline distinct from selection. */
:root :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:root input:focus-visible, :root select:focus-visible, :root textarea:focus-visible {
  box-shadow: 0 0 0 3px var(--focus-ring);
}
:root[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
:root[data-theme="dark"] select, :root[data-theme="dark"] textarea {
  background-color: var(--surface-sunken);
  border-color: var(--line-strong);
}
:root[data-theme="dark"] .class-badge {
  color: color-mix(in srgb, var(--class-color, #64748b) 40%, var(--text));
}
:root[data-theme="dark"] .change-stat span { color: var(--text-secondary); }
:root[data-theme="dark"] .change-dialog,
:root[data-theme="dark"] .thumb-sheet,
:root[data-theme="dark"] .statistics-thumb-sheet,
:root[data-theme="dark"] .reading-preferences,
:root[data-theme="dark"] [popover],
:root[data-theme="dark"] .pager {
  background-color: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}
:root[data-theme="dark"] dialog::backdrop { background: rgba(4,10,8,.62); }
:root[data-theme="dark"] ::selection { background: rgba(111,208,193,.28); color: #f2fffb; }
:root[data-theme="dark"] .empty-error { color: #ffb4a8; }
:root[data-theme="dark"] .thumb-done,
:root[data-theme="dark"] .statistics-thumb-done {
  background: var(--accent-fill);
  color: var(--on-accent);
}
:root:not([data-theme="dark"]) .status-rename { color: #92400e; }
:root:not([data-theme="dark"]) .status-join { color: #047857; }
:root:not([data-theme="dark"]) .status-leave { color: #be123c; }
:root:not([data-theme="dark"]) .status-up,
:root:not([data-theme="dark"]) .status-stay { color: #1d4ed8; }
:root:not([data-theme="dark"]) .card-power-estimate,
:root:not([data-theme="dark"]) .archive-inference { color: #8a5f08; }
:root:not([data-theme="dark"]) .player-facts .is-power > strong,
:root:not([data-theme="dark"]) [data-player-trend-change] > b { color: #8a5f08; }
.pager.is-empty .page-jump .page-prefix,
.pager.is-empty .page-jump input { display: none; }

@media (prefers-reduced-transparency: reduce) {
  dialog, dialog::backdrop { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
}

/* Shared desktop/mobile visual hierarchy. Numeric gold remains unchanged. */
.archive-life { container-type: inline-size; }
.change-stat-grid.has-observations { grid-template-columns:repeat(3,minmax(0,1fr)); }
@media (min-width:1000px) { .change-stat-grid.has-observations { grid-template-columns:repeat(6,minmax(0,1fr)); } }
.power-block .card-power-estimate { display:block; font-size:11px; line-height:1.5; color:var(--accent-warm); font-weight:400; white-space:normal; }
.archive-life h3 { display:flex; justify-content:space-between; align-items:center; }
.archive-life h3 small { font-size:11px; font-weight:400; color:var(--muted); }
.archive-life-head,.archive-life-row { display:grid; grid-template-columns:minmax(0,1fr) 100px minmax(0,1fr); gap:16px; align-items:center; }
.archive-life-head { text-align:center; font-size:11px; color:var(--muted); padding:12px 0; border-bottom:1px solid var(--line); }
.archive-life-track { position:relative; }
.archive-life-track::before { content:''; position:absolute; left:50%; top:0; bottom:0; width:1px; background:var(--line); }
.archive-life-row { position:relative; min-height:82px; padding:13px 0; }
.archive-life-name,.archive-life-guild { overflow-wrap:anywhere; font-size:14px; line-height:1.7; color:var(--muted); }
.archive-life-name { text-align:right; }
.archive-life-row .is-changed { color:var(--accent); font-weight:650; }
.archive-life-date { position:relative; background:var(--panel-solid); text-align:center; padding:5px 0; font-size:11px; font-weight:500; color:var(--text-secondary); font-variant-numeric:tabular-nums; }
.archive-life-date::before { content:''; display:block; width:5px; height:5px; border-radius:50%; background:var(--accent); margin:0 auto 6px; }
.archive-life-date span,.archive-life-date small { display:block; }
.archive-life-date small { font-size:9px; }
.archive-inference { display:inline; margin-left:3px; font-size:10px; font-weight:400; color:var(--accent-warm); vertical-align:super; cursor:help; }
.archive-inference:focus-visible { outline:2px solid var(--accent-warm); }
.archive-life-name { position:relative; }
details.archive-inference { display:inline-block; }
details.archive-inference summary { list-style:none; cursor:pointer; padding:3px; }
details.archive-inference > span { position:absolute; top:100%; left:0; z-index:5; padding:10px; width:200px; max-width:70vw; text-align:left; background:var(--panel-solid); border:1px solid var(--line); border-radius:6px; box-shadow:var(--shadow); font-size:12px; }
.archive-life-older > summary { cursor:pointer; text-align:center; list-style:none; border:1px solid var(--line); background:var(--soft); border-radius:20px; width:fit-content; max-width:100%; margin:12px auto; padding:11px 17px; font-size:12px; color:var(--accent); }
.archive-life-older > summary { display:flex; align-items:center; justify-content:center; gap:6px; }
.archive-life-older > summary::-webkit-details-marker { display:none; }
.archive-life-older .archive-older-collapse { display:none; }
.archive-life-older[open] .archive-older-expand { display:none; }
.archive-life-older[open] .archive-older-collapse { display:inline; }
.archive-life-older[open] .archive-older-chevron { transform:rotate(180deg); }
.archive-life-older[open] > summary { background:var(--accent-soft); border-color:var(--accent); }
.archive-life-range { text-align:center; font-size:11px; color:var(--muted); }
@container (max-width:470px) {
  .archive-life-head,.archive-life-row { grid-template-columns:minmax(0,1fr) 82px minmax(0,1fr); gap:8px; }
  .archive-life-name,.archive-life-guild { font-size:12px; }
  .archive-life-date { font-size:10px; }
}

body { font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei UI", sans-serif; }
button, input, select, textarea { font-family: inherit; }
.player-name { font-size: 16px; font-weight: 650; line-height: 1.5; }
.player-meta, .guild-block span, .card-note { font-size: 13px; }
.ranking-card { padding-block: 12px; }
.class-badge {
  background: color-mix(in srgb, var(--class-color, #64748b) 9%, var(--panel-solid));
  color: color-mix(in srgb, var(--class-color, #64748b) 48%, var(--text));
}
.player-card-detail .player-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(64px, 1fr));
  gap: 5px 12px;
  min-width: 228px;
  padding: 0;
  border: 0;
  background: transparent;
}
.player-metrics .compact-metric { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; text-align: right; }
.player-metrics .compact-metric > span { font-size: 12px; }
.player-metrics .compact-metric > strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.guild-change-note { grid-column: 1 / -1; color: var(--accent); font-size: 12px; text-align: right; }
.filters:not(.is-change-mode):not(.is-guild-compare-mode) {
  grid-template-columns: 1fr .9fr .9fr 1.1fr minmax(250px, 1.8fr) 40px;
}
.search-field input { border-color: var(--line-strong); background: var(--panel-solid); }
.filter-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding-top: 8px; }
.filter-summary span { padding: 3px 8px; border-radius: 5px; background: var(--accent-soft); color: var(--text-secondary); font-size: 12px; overflow-wrap: anywhere; }
@media (min-width: 721px) {
  .app-shell > .filter-shell #filterSummary:not([hidden]) { display: flex; }
}
.filter-summary .ranking-result-count, .pager .ranking-result-count {
  padding: 0 3px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  white-space: nowrap;
}
.pager > .ranking-result-count { order: 5; }
.thumb-dock .pager > .ranking-result-count { display: none; }
.app-shell:has(> .pager:not([hidden])) > .ranking-panel { padding-bottom: calc(96px + env(safe-area-inset-bottom)); margin-bottom: 0; }
.app-shell > .pager {
  position: fixed; top: auto; bottom: max(10px, env(safe-area-inset-bottom));
  left: 50%; right: auto; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 24px);
  margin: 0; padding: 10px 16px; flex-wrap: nowrap;
  background: var(--panel-solid); box-shadow: var(--shadow-lg);
}
.trend-axis-label { font-size: 12px; }
.trend-series-line { stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.trend-gap { stroke-dasharray: 5 5; }
.trend-gap-note { margin: 8px 0 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.archive-section { border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.archive-section h3 { padding: 8px 0; border: 0; background: transparent; font-size: 15px; }
.archive-line { padding: 10px 0; }
.archive-line strong { font-size: 14px; }
.archive-line span { font-size: 13px; line-height: 1.6; }
.archive-line strong, .archive-line span { white-space: normal; overflow-wrap: anywhere; }
.archive-history .archive-line { position: relative; margin-left: 5px; padding: 8px 0 16px 20px; border: 0; border-left: 1px solid var(--line-strong); }
.archive-history .archive-line::before { content: ""; position: absolute; top: 15px; left: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.archive-history .archive-line:last-child { padding-bottom: 4px; }
@media (max-width: 1100px) {
  .filters:not(.is-change-mode):not(.is-guild-compare-mode) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .filters:not(.is-change-mode):not(.is-guild-compare-mode) .search-field { grid-column: 1 / 4; }
}
@media (max-width: 720px) {
  .filters:not(.is-change-mode):not(.is-guild-compare-mode) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters:not(.is-change-mode):not(.is-guild-compare-mode) .search-field { grid-column: 1 / -1; grid-row: 1; padding-right: 46px; }
  .filters #filterResetField { position: static; inset: auto; grid-column: 2; grid-row: 1; justify-self: end; align-self: end; }
  .filter-shell input, .filter-shell select { min-height: 40px; font-size: 16px; }
  .player-card .player-name { font-size: 15px; white-space: normal; overflow-wrap: anywhere; }
  .player-card .player-meta { display: flex; flex-wrap: wrap; gap: 4px 6px; font-size: 12px; }
  .player-card-detail .player-card-aside { grid-template-columns: minmax(0, 1fr); }
  .player-card-detail .player-metrics { grid-column: 1 / -1; grid-row: 1; min-width: 0; width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .player-metrics .compact-metric { text-align: left; }
  .player-card-detail .card-note { grid-column: 1 / -1; grid-row: 2; }
  .guild-change-note { text-align: left; }
  .app-shell > .pager { gap: 8px; padding: 8px; width: calc(100% - 16px); max-width: calc(100% - 16px); justify-content: space-between; }
  .pager button, .pager select, .pager input { min-height: 44px; }
  .trend-chart { padding: 12px; }
  .trend-chart figcaption { flex-wrap: wrap; gap: 8px; }
  .archive-section h3 { font-size: 15px; }
}

@media (max-width: 720px) { .search-field input { padding-right: 10px; } }


@media (max-width: 720px) {
  .change-dialog.is-drawer { width: calc(100vw - 16px); max-width: calc(100vw - 16px); margin-inline: 8px; }
}
@media (max-width: 360px) { .trend-axis-label { font-size: 15px; } }

/* Phone hierarchy: prominent identity row, quieter metadata, disclosed metrics. */
@media (max-width: 720px) {
  .ranking-item > .ranking-card.player-card { padding-block: 14px; row-gap: 10px; column-gap: 10px; }
  .player-card .card-rank { grid-row: 1 / 4; align-self: start; }
  .player-card .player-block { display: contents; }
  .player-card .player-name { grid-column: 2; grid-row: 1; align-self: center; font-size: 16px; line-height: 1.4; }
  .player-card .player-meta {
    grid-column: 2 / -1; grid-row: 2; margin-top: 0;
    flex-wrap: wrap; gap: 6px 8px; line-height: 1.5;
  }
  .player-card .player-meta .class-badge { flex-shrink: 0; }
  .player-card .player-meta .player-server { flex-shrink: 0; }
  .player-card .player-meta .player-mobile-guild { min-width: 0; flex: 1 1 72px; font-weight: 500; color: var(--text-secondary); }
  .player-card .power-block span { display: none; }
  .player-card .player-card-detail { grid-row: 3; row-gap: 6px; }
  .player-card-detail .player-card-aside { gap: 3px; }
  .player-card-detail .player-metrics { gap: 3px 6px; }
  .player-card-detail .player-metrics .compact-metric {
    display: flex; align-items: baseline; justify-content: flex-start; gap: 3px;
    white-space: nowrap;
  }
  .player-card-detail .player-metrics .compact-metric > strong { font-size: 12px; }
  .player-card-detail .card-note { height: 20px; padding-block: 1px; line-height: 18px; }
}

/* Phone cards disclose secondary information together with the trend. */
@media (max-width: 720px) {
  .ranking-item:not(.is-expanded) > .player-card .player-card-detail { display: none; }
  .ranking-item:not(.is-expanded) > .player-card .card-rank { grid-row: 1 / 3; }
  .ranking-item.is-expanded > .player-card .player-card-detail {
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }
  .ranking-item > .player-card .card-note { display: none; }
}

@media (max-width: 720px) {
  .player-card .card-rank { padding-top: 1px; }
  .player-card .power-block { align-self: center; }
  .player-card .power-block strong { font-size: 21px; line-height: 1.2; }
  .ranking-item.is-player > .inline-trend-toggle { top: 12px; }
  .player-card-detail .player-metrics .compact-metric { gap: 5px; }
  .player-card-detail .player-metrics .compact-metric > span { color: var(--muted); }
}

@media (max-width: 360px) {
  .player-card-detail .player-metrics .compact-metric {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px;
  }
}

/* Keep paging reachable while leaving room to scroll the final row above it. */
@media (max-width: 900px) { .pager .rank-jump { display: none; } }
@media (max-width: 420px) {
  .pager .page-size-control { display: none; }
  .pager .page-jump { flex: 1; justify-content: center; gap: 5px; }
  .pager .page-jump input { width: 44px; }
  .pager button { flex: 0 0 auto; padding-inline: 12px; }
}

/* Unified paging island: navigation first, secondary controls separated. */
.app-shell > .pager {
  gap: 8px; width: max-content; max-width: calc(100% - 24px);
  padding: 7px; border: 1px solid var(--line);
  border-radius: 18px; background: var(--panel-solid);
  box-shadow: 0 6px 24px rgb(20 33 29 / 12%), 0 1px 3px rgb(20 33 29 / 5%);
  justify-content: center;
}
.pager #prevBtn { order: 0; }
.pager .page-jump { order: 1; flex: 0 1 auto; gap: 4px; padding-inline: 6px; font-size: 13px; }
.pager #nextBtn { order: 2; }
.pager .rank-jump { order: 3; margin-left: 8px; padding-left: 16px; border-left: 1px solid var(--line); }
.pager .page-size-control { order: 4; padding-inline: 8px; }
.pager .pager-arrow {
  display: grid; place-items: center; flex: 0 0 44px;
  width: 44px; height: 44px; min-height: 44px; padding: 0;
  border: 0; border-radius: 12px; color: var(--accent-strong);
  background: var(--accent-soft); box-shadow: none;
}
.pager .pager-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pager .pager-arrow:hover:not(:disabled) { color: var(--panel-solid); background: var(--accent); transform: none; box-shadow: none; }
.pager .pager-arrow:active:not(:disabled) { background: var(--accent-strong); transform: none; }
.pager .pager-arrow:disabled { opacity: .35; background: transparent; cursor: default; }
.pager .page-jump input {
  width: 46px; height: 44px; min-height: 44px; padding: 0 3px;
  border: 1px solid transparent; border-radius: 8px; background: transparent;
  color: var(--text); font-size: 16px; font-weight: 700; box-shadow: none;
}
.pager .page-jump input:hover { background: var(--surface-cool); }
.pager .page-jump input:focus { background: var(--surface-cool); border-color: var(--accent); outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.pager .rank-jump input, .pager .page-size-control select { min-height: 36px; border-color: transparent; background: var(--surface-cool); border-radius: 8px; box-shadow: none; font-size: 13px; }
.pager .pager-arrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (min-width: 721px) {
  .app-shell > .pager {
    gap: 7px; padding: 4px 6px; border-radius: 16px;
    box-shadow: 0 3px 12px rgb(20 33 29 / 10%);
    font-variant-numeric: tabular-nums;
  }
  .app-shell > .pager .pager-arrow { background: transparent; }
  .app-shell > .pager .pager-arrow svg { width: 17px; height: 17px; }
  .app-shell > .pager .pager-arrow:hover:not(:disabled) {
    background: var(--accent-soft); color: var(--accent-strong);
  }
  .app-shell > .pager .page-jump input {
    height: 34px; min-height: 34px; background: var(--accent-soft);
  }
  .app-shell > .pager .rank-jump {
    margin-inline-start: 0; padding-inline-start: 10px; gap: 6px;
  }
  .app-shell > .pager .rank-jump input {
    width: 64px; min-width: 64px; padding-inline: 7px;
  }
  .app-shell > .pager .rank-jump input::placeholder { color: var(--muted); }
  .app-shell > .pager .rank-jump .page-total { min-width: 80px; }
  .app-shell > .pager .page-size-control { padding-inline: 0; }
}
@media (max-width: 720px) {
  .app-shell > .pager { width: max-content; max-width: calc(100% - 24px); padding: 6px; gap: 4px; border-radius: 17px; }
  .pager .page-size-control { display: none; }
  .pager .page-jump { flex: 0 1 auto; min-width: 120px; padding-inline: 6px; }
  .pager .page-jump input { width: 44px; }
  .pager .page-prefix { font-size: 12px; color: var(--muted); }
  .pager .pager-arrow { flex-basis: 44px; }
}
/* Sharing follows the currently visible detail and filter selection. */
.share-toolbar { padding: 10px 20px; border-bottom: 1px solid var(--line); }
.share-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.share-toolbar { flex: 0 0 auto; }
.share-choices:not([hidden]) { display: flex; gap: 8px; flex-wrap: wrap; }
.share-actions button { min-height: 44px; padding: 8px 16px; border-radius: 10px; }
.share-actions button:first-child { background: var(--accent-soft); color: var(--accent-strong); }
.share-actions [role="status"] { color: var(--muted); font-size: 12px; }
.share-fallback { margin-top: 12px; max-height: 45dvh; overflow: auto; }
.share-fallback img { display: block; max-width: 100%; margin-top: 8px; }
.share-fallback textarea { width: 100%; min-height: 180px; }
.share-card.change-dialog {
  display: block; position: static; margin: 0; padding: 0;
  max-width: none; max-height: none; height: auto; overflow: visible;
  transform: none; background: var(--panel-solid); color: var(--text);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: none;
}
.share-card .dialog-head { position: static; }
.share-card .change-dialog-body { max-height: none; overflow: visible; }
.share-card .guild-trend-toggle svg, .share-card .guild-trend-toggle-state { display: none; }
.share-card .member-change-list { max-height: none; overflow: visible; }
.share-card .member-change-stat { box-shadow: none; outline: none; border-color: var(--line); }
.share-credit { padding: 14px 20px; margin: 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
@media (max-width: 720px) { .share-toolbar { padding: 8px 14px; } }

/* Header share popover; it never consumes a separate content row. */
.dialog-head-actions { position: relative; }
.dialog-head-actions .share-toolbar { position: static; padding: 0; border: 0; }
.share-toolbar .share-actions { display: block; }
.share-toolbar .share-toggle { padding: 0; width: 44px; height: 44px; border-radius: 10px; }
.share-toolbar .share-choices:not([hidden]) {
  position: absolute; right: 0; top: 50px; z-index: 40;
  display: grid; gap: 4px; width: 210px; padding: 6px;
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
}
.share-choices button { display: grid; gap: 4px; text-align: left; border: 0; background: transparent; box-shadow: none; padding: 12px; }
.share-choices button:hover { background: var(--accent-soft); }
.share-choices button small { color: var(--muted); font-size: 12px; }
.share-toolbar [role="status"]:empty { display: none; }
.share-toolbar [role="status"] { position: absolute; right: 0; top: 50px; z-index: 41; width: 220px; padding: 10px 12px; border: 1px solid var(--line); background: var(--panel-solid); border-radius: 10px; box-shadow: var(--shadow-lg); }
.share-toolbar .share-fallback { position: absolute; top: 120px; right: 0; z-index: 41; width: min(270px, 70vw); padding: 12px; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 10px; }
/* A standalone ruled-paper template, with clean square edges for reliable PNG output. */
.share-card.change-dialog { padding: 28px; border: 0; border-top: 5px solid var(--accent); border-radius: 0; background: var(--panel-solid); }
.share-card .dialog-head { display: block; padding: 0 0 24px; background: transparent; border: 0; border-bottom: 1px solid var(--line); }
.share-card .share-edition { margin: 0 0 18px; font-size: 12px; letter-spacing: 3px; color: var(--accent); }
.share-card .dialog-head strong { font-size: 28px; line-height: 1.4; overflow-wrap: anywhere; }
.share-card .dialog-head span { font-size: 14px; line-height: 1.6; }
.share-card .change-dialog-body { padding: 24px 0; display: grid; gap: 22px; }
.share-card .player-profile-section, .share-card .guild-trend-section, .share-card .member-change-section { border: 0; border-radius: 0; background: transparent; }
.share-card .player-profile-section h3, .share-card .member-change-head { padding: 10px 0; background: transparent; border-bottom: 1px solid var(--line); }
.share-card .trend-chart { margin: 0; border: 0; border-radius: 0; }
.share-card .share-credit { padding: 16px 0 0; border-top: 1px solid var(--line); font-size: 12px; }
.share-card .change-dialog-body > div:empty { display: none; }
.share-card .guild-trend-toggle { border-radius: 0; }

/* Sharing: concise facts, compact summaries and paths that stay inside the paper. */
.share-card .dialog-head { padding-bottom: 16px; }
.share-card .share-edition { margin-bottom: 10px; }
.share-card .change-dialog-body { padding: 18px 0; gap: 14px; }
.share-card .share-person-stats { display: grid; grid-template-columns: 1.4fr .7fr 1fr; gap: 12px; padding-top: 18px; }
.share-person-stats > div { min-width: 0; display: grid; gap: 6px; }
.share-person-stats span, .share-chart-range, .share-quiet-note { color: var(--muted); font-size: 12px; line-height: 1.6; }
.share-person-stats strong { font-size: 17px; overflow-wrap: anywhere; }
.share-person-stats > div:first-child strong { font-size: 26px; color: var(--accent-warm); }
.share-card .share-chart-range { margin: 4px 0 8px; }
.share-card .trend-chart > svg { height: 235px; width: 100%; }
.share-card .member-change-summary { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 0; }
.share-card .member-change-stat { display: flex; align-items: baseline; gap: 10px; padding: 7px 12px; min-width: 90px; }
.share-card .member-change-stat strong { margin: 0; }
.share-card .member-change-row { display: grid; grid-template-columns: 52px minmax(0, 1.2fr) 94px minmax(0, 1fr); gap: 10px; padding: 8px 0; }
.share-card .member-change-row > * { min-width: 0; }
.share-card .member-identity strong, .share-card .member-guild-path strong { white-space: normal; overflow-wrap: anywhere; word-break: normal; }
.share-card .member-guild-path { grid-column: auto; }
.share-card .member-change-row .status-badge { min-width: 0; padding: 5px; }
.share-card .archive-basic-list { gap: 14px; padding: 0; }
.share-card .share-credit { margin: 0; padding-top: 12px; }
.share-card .archive-view { padding-bottom: 0; }

.share-card, .share-card * { animation: none !important; transition: none !important; }

.archive-association-notice { padding: 10px 12px; margin: 8px 0; border-left: 3px solid var(--accent-warm); background: var(--soft); color: var(--text-secondary); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
/* Export typography owns its layout at every source viewport width. */
.share-card .trend-chart figcaption { display:block; padding:0; margin-bottom:10px; }
.share-card .trend-chart figcaption > span:first-child { display:block; width:auto; margin-bottom:6px; }
.share-card .trend-legend { display:block; width:auto; line-height:1.8; }
.share-card .trend-legend-item { display:inline-block; white-space:nowrap; margin-right:12px; }
.share-card .trend-legend-item i { display:inline-block; vertical-align:middle; margin-right:5px; }
.share-card .trend-legend-change { white-space:nowrap; margin-left:5px; }
.share-card .archive-section > h3 { display:block; }
.share-card .archive-section > h3 > small { float:right; white-space:nowrap; }
.share-card .detail-link { display:inline; min-height:0; padding:0; border:0; background:transparent; box-shadow:none; line-height:inherit; }
.share-card .detail-link svg { display:none; }
.share-card .guild-roster { overflow:visible; max-height:none; }

/* UI audit trial: restrained emphasis without an extra header row. */
@media (min-width:1101px) {
  .player-card .power-block > strong { font-size:20px; font-weight:700; }
  .player-card .card-rank .rank-main { font-size:15px; color:var(--text-secondary); }
}
.statistics-summary-line { display:flex; align-items:center; gap:4px; }
.metric-help-button { flex:none; width:32px; min-height:32px; padding:0; border:0; background:transparent; color:var(--muted); box-shadow:none; font-size:17px; }
.metric-help-dialog { width:min(420px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); overflow:auto; padding:20px; border:1px solid var(--line); border-radius:12px; background:var(--panel-solid); color:var(--text); box-shadow:var(--shadow-lg); }
.metric-help-dialog::backdrop { background:#0005; }
.metric-help-dialog header { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.metric-help-dialog header button { width:36px; min-height:36px; padding:0; border:0; background:transparent; color:var(--muted); font-size:22px; box-shadow:none; }
.metric-help-dialog p { font-size:13px; line-height:1.8; color:var(--muted); margin:12px 0 0; }
@media(max-width:780px) { .metric-help-button, .metric-help-dialog header button { width:44px; min-height:44px; } }

/* Quiet mobile player positions: a short divider replaces the badge. */
@media (max-width: 720px) {
  .ranking-item > .ranking-card.player-card { grid-template-columns: 38px minmax(0, 1fr) minmax(88px, auto); }
  .ranking-item > .player-card .card-rank { align-self: start; padding-top: 0; text-align: right; }
  .player-card .card-rank .rank-main {
    display: block; min-width: 0; width: 100%; height: 23px;
    padding-right: 8px; border-right: 1px solid var(--line);
    border-radius: 0; background: transparent; box-shadow: none;
    color: var(--muted); font-size: 15px; font-weight: 500; line-height: 23px;
  }
}

/* Shared detail surface. Export cards deliberately keep their paper layout. */
.archive-hint { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; vertical-align: middle; width: 26px; height: 28px; min-width: 0; min-height: 0; margin: 0 0 0 3px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--muted); box-shadow: none; cursor: pointer; touch-action: manipulation; }
.archive-hint svg { width: 14px; height: 14px; flex-shrink: 0; }
.archive-hint[data-hint-kind="association"] { margin: 0 3px 0 0; }
.archive-hint:hover, .archive-hint:focus-visible { color: var(--accent); background: var(--detail-surface); }
.archive-hint:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.archive-life-identity { display: inline-flex; align-items: center; justify-content: flex-end; min-width: 0; max-width: 100%; }
.archive-life-identity > strong { min-width: 0; overflow-wrap: anywhere; }
.archive-hint-popover { position: fixed; inset: auto; margin: 0; box-sizing: border-box; width: 330px; max-width: calc(100vw - 24px); max-height: 320px; max-height: min(320px, calc(100dvh - 24px)); overflow: auto; padding: 12px 14px; border: 1px solid var(--detail-line); border-radius: 9px; background: var(--panel-solid); color: var(--text-secondary); box-shadow: var(--shadow-lg); font-family: inherit; font-size: 12px; font-weight: 400; line-height: 1.75; text-align: left; white-space: pre-line; overflow-wrap: anywhere; z-index: 100; }
.archive-hint-popover[hidden] { display: none; }
@media (pointer: coarse) { .archive-hint { width: 44px; height: 44px; } }
/* Keep the ranking width unchanged when the dialog locks page scrolling. */
html { scrollbar-gutter: stable; }


body.dialog-open { overflow: hidden; }

/* Nonmodal details share the same layer inside and outside analysis roots. */
.change-dialog.is-pinned { z-index: var(--layer-dialog); box-shadow: none; border-left: 1px solid var(--line); }
.change-dialog.is-pinned::backdrop { display: none; }

.change-dialog.is-drawer:not(.share-card):not(.is-expanded) {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(560px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 20px 0 0 20px;
  border-width: 0 0 0 1px;
  animation: detail-drawer-enter var(--motion-slow) cubic-bezier(.22, 1, .36, 1);
}

.change-dialog.is-drawer:not(.share-card)::backdrop {
  background: rgb(5 10 16 / 38%);
  backdrop-filter: blur(3px);
  animation: detail-backdrop-enter var(--motion-standard) ease-out;
}

.change-dialog.is-drawer:not(.share-card) > form { height: 100%; min-height: 0; overflow: hidden; border-radius: inherit; }
.change-dialog.is-drawer:not(.share-card) .dialog-head {
  flex: 0 0 auto;
  align-items: flex-start;
  padding: 24px 24px 20px;
  background: var(--panel-solid);
  border-bottom-color: var(--detail-line);
}
.change-dialog.is-drawer:not(.share-card) .dialog-head > div:first-child > strong {
  font-size: 24px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.change-dialog.is-drawer:not(.share-card) .dialog-head span { line-height: 1.6; }
.change-dialog.is-drawer:not(.share-card) .change-dialog-body {
  flex: 1 1 auto;
  padding: 20px 24px max(24px, env(safe-area-inset-bottom));
}
.change-dialog.is-drawer:not(.share-card) .change-summary {
  border-radius: 12px;
  padding-block: 16px;
}
.change-dialog.is-drawer:not(.share-card) .player-profile-section + .player-profile-section { margin-top: 18px; }
.detail-change-strip { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: -4px 0 20px; color: var(--muted); font-size: 12px; }
.detail-change-strip b { color: var(--text); font-variant-numeric: tabular-nums; }
.change-dialog.is-drawer:not(.share-card):not(.is-expanded) .member-change-section { min-width: 0; }
.change-dialog.is-drawer:not(.share-card):not(.is-expanded) .member-change-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.change-dialog.is-drawer:not(.share-card):not(.is-expanded) .member-change-presets { grid-column: 1 / -1; }
.change-dialog.is-drawer:not(.share-card):not(.is-expanded) .member-change-head { flex-wrap: wrap; gap: 4px 12px; }
.change-dialog.is-drawer:not(.share-card) .player-profile-section > h3,
.change-dialog.is-drawer:not(.share-card) .archive-section > h3 {
  border-left: 3px solid var(--accent);
  padding-left: 10px;
}

/* Only the first level enters; nested disclosures remain immediate. */
.change-dialog.is-drawer[open]:not(.share-card) .change-dialog-body > * {
  animation: detail-section-enter 280ms ease-out backwards;
}
.change-dialog.is-drawer[open]:not(.share-card) .change-dialog-body > :nth-child(2) { animation-delay: 45ms; }
.change-dialog.is-drawer[open]:not(.share-card) .change-dialog-body > :nth-child(3) { animation-delay: 90ms; }
.change-dialog.is-drawer[open]:not(.share-card) .change-dialog-body > :nth-child(n+4) { animation-delay: 135ms; }

@keyframes detail-drawer-enter {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes detail-section-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes detail-backdrop-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

.change-dialog.is-drawer.is-closing:not(.share-card) { animation: detail-drawer-exit var(--motion-standard) ease-in forwards; pointer-events: none; }
.change-dialog.is-drawer.is-expanded.is-closing:not(.share-card) { animation: detail-backdrop-exit var(--motion-standard) ease-in forwards; }
.change-dialog.is-drawer.is-closing:not(.share-card)::backdrop { animation: detail-backdrop-exit var(--motion-standard) ease-in forwards; }
@keyframes detail-drawer-exit { to { transform: translateX(100%); opacity: 0; } }
@keyframes detail-backdrop-exit { to { opacity: 0; } }
.dialog-head .detail-back { display: inline-grid; place-items: center; width: 32px; min-width: 32px; height: 36px; min-height: 36px; padding: 0; margin: 0; border: 0; border-radius: 6px; background: transparent; box-shadow: none; color: var(--text); cursor: pointer; }
.dialog-head .detail-back[hidden] { display: none; }
.dialog-head .detail-back svg { width: 18px; height: 18px; }
.dialog-head > div:first-child:has(.detail-back:not([hidden])) { display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 10px; align-items: center; }
.dialog-head > div:first-child:has(.detail-back:not([hidden])) > span { grid-column: 2; margin-top: 2px; }
.change-dialog.is-drawer:not(.share-card) .dialog-head > div:first-child > strong { font-size: 21px; letter-spacing: -.3px; }
.dialog-head .detail-back:hover { background: var(--detail-hover); }
.dialog-head .detail-back:active { transform: translateY(1px); }
.dialog-head .detail-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.detail-link { display: inline; padding: 0; min-height: 0; border: 0; border-radius: 2px; background: transparent; color: var(--accent); font: inherit; text-align: inherit; white-space: normal; overflow-wrap: anywhere; box-shadow: none; cursor: pointer; }
.detail-link:hover { text-decoration: underline; text-underline-offset: 3px; background: transparent; }
.detail-link:focus-visible, .detail-change-badge:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.detail-link-status { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; }
.detail-change-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.detail-change-badges:empty { display: none; }
.detail-change-badge { min-height: 28px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 12px; box-shadow: none; }
.detail-guild-line { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
[data-archive-load-panel] { min-height: 120px; margin-top: 16px; }
.member-change-list[aria-busy="true"] > * { opacity: .65; }
.member-change-wait { display:flex; align-items:flex-start; gap:8px; margin:10px 0; padding:10px 12px; border:0; border-left:3px solid var(--accent); border-radius:0 7px 7px 0; background:var(--accent-soft); color:var(--accent-strong); }
.member-change-error { margin:10px 0; padding:10px 12px; border:1px solid var(--line); border-radius:8px; background:var(--panel-solid); }
.member-change-error p { margin:0 0 8px; color:var(--bad); font-size:12px; line-height:1.6; }
.member-change-error > div { display:flex; flex-wrap:wrap; gap:8px; }
.member-change-error button { min-height:36px; font-size:12px; }
@media (max-width: 780px) {
  .detail-swipe-header { touch-action: pan-y pinch-zoom; }
  .change-dialog.detail-swipe-motion {
    animation: none !important;
    transform: translate3d(var(--detail-swipe-x, 0px), 0, 0) !important;
    transition: transform var(--detail-swipe-duration, 0ms) cubic-bezier(.22, .8, .25, 1) !important;
    will-change: transform;
  }
  .change-dialog.detail-swipe-inner {
    transform: none !important;
    transition: none !important;
    overflow: hidden;
    will-change: auto;
  }
  .change-dialog.detail-swipe-inner > .detail-swipe-front {
    position: relative; z-index: 2; background: var(--panel-solid);
    transform: translate3d(var(--detail-swipe-x, 0px), 0, 0);
    transition: transform var(--detail-swipe-duration, 0ms) cubic-bezier(.22, .8, .25, 1);
    box-shadow: -5px 0 16px rgb(0 0 0 / 12%);
    will-change: transform;
  }
  .detail-swipe-preview {
    position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column;
    min-height: 0; overflow: hidden; background: var(--panel-solid); pointer-events: none;
    transform: translate3d(var(--detail-swipe-preview-x, 0px), 0, 0);
    transition: transform var(--detail-swipe-duration, 0ms) cubic-bezier(.22, .8, .25, 1);
    will-change: transform;
  }
  .detail-swipe-preview *, .change-dialog.detail-swipe-inner .change-dialog-body > * { animation: none !important; }
  .detail-swipe-preview * { pointer-events: none !important; }
  .detail-swipe-preview .change-dialog-body { min-height: 0; overflow: hidden; }
  .detail-swipe-preview .detail-mobile-footer > button { flex: 1; width: auto; max-width: none; min-width: 0; }
  .detail-swipe-preview .detail-mobile-footer > div:not(:empty) { display: flex; flex: 1; min-width: 0; }
  .detail-swipe-preview .detail-mobile-footer > div button { flex: 1; min-height: 44px; }
  .detail-swipe-preview .dialog-head > div:first-child > span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.5; }
  .change-dialog.is-swipe-restored,
  .change-dialog.is-swipe-restored .change-dialog-body > * { animation: none !important; }
}

@media (max-width: 600px) {
  .change-dialog.is-drawer:not(.share-card):not(.is-expanded),
  .change-dialog.is-drawer.is-expanded:not(.share-card) {
    inset: 0;
    margin: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .change-dialog.is-drawer:not(.share-card) .dialog-head { padding: max(16px, env(safe-area-inset-top)) 16px 14px; gap: 8px; }
  .change-dialog.is-drawer:not(.share-card) .dialog-head > div:first-child > strong { font-size: 21px; }
  .change-dialog.is-drawer:not(.share-card) .change-dialog-body { padding: 16px 16px max(20px, env(safe-area-inset-bottom)); }
  .change-dialog.is-drawer.is-expanded.is-fallback-open:not(.share-card) { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .change-dialog.is-drawer:not(.share-card),
  .change-dialog.is-drawer:not(.share-card)::backdrop,
  .change-dialog.is-drawer[open]:not(.share-card) .change-dialog-body > * { animation: none !important; }
}

/* Share menu typography must not inherit the character-name heading size. */
.change-dialog .dialog-head .share-choices:not([hidden]) { width: 184px; padding: 5px; gap: 2px; border-radius: 10px; }
.change-dialog .dialog-head .share-choices button { min-height: 48px; padding: 8px 10px; gap: 2px; border-radius: 6px; }
.change-dialog .dialog-head .share-choices button strong { font-size: 14px; line-height: 1.4; font-weight: 600; }
.change-dialog .dialog-head .share-choices button small { font-size: 11px; line-height: 1.4; font-weight: 400; }

.player-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.player-fact { display: flex; flex-direction: column; justify-content: center; gap: 6px; min-width: 0; min-height: 76px; box-sizing: border-box; padding: 12px 15px; border: 1px solid var(--detail-line); border-radius: 12px; background: var(--detail-surface); box-shadow: inset 0 1px 0 var(--detail-highlight); }
.player-fact:has(.detail-link) { position: relative; transition: background 160ms, border-color 160ms; }
.player-fact .detail-link::after { content: ''; position: absolute; inset: 0; border-radius: 12px; }
.player-fact:has(.detail-link):hover { background: var(--detail-hover); border-color: var(--detail-hover-line); }
.player-fact:has(.detail-link):active { background: var(--detail-surface); }
.player-fact:has(.detail-link:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.change-dialog .player-fact .detail-link { min-height: 0; padding: 0; text-align: left; color: var(--text); font-weight: 500; line-height: 1.4; }
.guild-link-chevron { display: inline-block; width: 14px; height: 14px; margin-left: 8px; vertical-align: -2px; color: var(--muted); }
.player-fact .guild-link-chevron { position: absolute; right: 12px; top: 50%; margin: -7px 0 0; opacity: .55; transition: opacity 160ms, transform 160ms; }
.player-fact:hover .guild-link-chevron { opacity: 1; transform: translateX(2px); }
.player-fact:has(.detail-link) { padding-right: 30px; }
.player-fact .detail-link:hover { text-decoration: none; }
.detail-guild-line:has(.detail-link) { position: relative; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.detail-guild-line .detail-link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.detail-guild-line:has(.detail-link):hover { background: var(--accent-soft); }
.dialog-head .share-toolbar .share-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 4px; width: auto; padding: 0 8px; background: transparent; color: var(--muted); }
.dialog-head .share-toggle > span { margin: 0; color: inherit; }
.dialog-head .share-toolbar .share-toggle:hover,
.dialog-head .share-toolbar .share-toggle[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent); }
.dialog-head .share-toolbar .share-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.change-dialog.is-drawer:not(.share-card) .is-sticky-bottom { bottom: 0; margin-bottom: 0; background: var(--panel-solid); box-shadow: 0 24px 0 24px var(--panel-solid); }
@media (min-width: 781px) {
  .change-dialog.is-drawer:not(.share-card) .player-archive-section .archive-action-bar.is-sticky-bottom {
    bottom: -24px;
    margin-bottom: -24px;
    padding-block: 8px;
  }
}
.player-fact > span { display: block; color: var(--detail-caption); font-size: 11px; line-height: 1.4; letter-spacing: .3px; margin: 0; }
.player-fact > strong { display: block; font-size: 14px; line-height: 1.4; font-weight: 500; overflow-wrap: anywhere; }
.player-fact.is-power > strong { font-size: 19px; line-height: 1.2; font-weight: 650; color: var(--power-num); font-variant-numeric: tabular-nums; }
.change-dialog.is-drawer:not(.share-card) .player-archive-section { position: relative; overflow: visible; border: 0; background: transparent; }
.change-dialog.is-drawer:not(.share-card) .player-archive-section > h3 { padding: 0; margin: 0 0 16px; border: 0; background: transparent; color: var(--text); font-size: 16px; font-weight: 650; line-height: 36px; }
.player-archive-section .player-archive-body > .player-trend-period { position: absolute; top: 0; right: 0; margin: 0; }
.player-archive-section .player-trend-period > span { display: none; }
.change-dialog.is-drawer:not(.share-card) .trend-chart { border-color: var(--detail-line); border-radius: 12px; }
.change-dialog.is-drawer:not(.share-card) .premium-btn { border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 13px; box-shadow: none; }
.change-dialog.is-drawer:not(.share-card) .premium-btn:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--panel-solid)); }
.guild-people-tabs { display: flex; gap: 4px; }
.guild-people-tabs button { padding: 6px 10px; min-height: 34px; border: 0; background: transparent; color: var(--muted); box-shadow: none; font-size: 13px; }
.guild-people-tabs button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.member-change-section:has(.guild-roster:not([hidden])) { grid-template-rows: auto minmax(0, 1fr); }
.guild-roster { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.guild-roster-caption, .guild-roster-note { padding: 10px 14px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.guild-roster-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 55px; padding: 10px 14px; text-align: left; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
.guild-roster-row:hover { background: var(--accent-soft); }
.roster-rank { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.roster-identity { display: grid; gap: 3px; min-width: 0; }
.roster-identity strong { font-size: 14px; overflow-wrap: anywhere; }
.roster-identity small { font-size: 11px; color: var(--muted); }
.roster-power { color: var(--power-num); font-size: 14px; font-variant-numeric: tabular-nums; }

.archive-preview-summary { padding: 10px 14px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.archive-preview-summary p { margin: 3px 0; }
.archive-preview-history { margin-top: 16px; }
.archive-preview-history h4 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.archive-preview-history h4 > span { color: var(--muted); font-size: 11px; font-weight: 400; }
.archive-preview-period { padding: 12px 0; border-top: 1px solid var(--detail-line); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3px 12px; }
.preview-period-title { color: var(--text); font-size: 13px; overflow-wrap: anywhere; }
.preview-period-guild { text-align: right; font-size: 12px; overflow-wrap: anywhere; }
.preview-period-guild .detail-link { color: var(--text); font-weight: 400; }
.archive-preview-period > p { grid-column: 1 / -1; font-size: 11px; }
.preview-inferred { display: inline-block; margin-left: 6px; font-size: 10px; color: var(--muted); font-weight: 400; }
.player-trend-period { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.player-trend-period > div { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--detail-line); border-radius: 8px; }
.player-trend-period button { min-height: 30px; padding: 4px 10px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); font-size: 12px; box-shadow: none; }
.player-trend-period button[aria-pressed="true"] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 22%, transparent); background: var(--accent-soft); }
.player-trend-period button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.power-block:has(.card-power-estimate) { display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.power-block:has(.card-power-estimate) > strong { display: block; font-size: 18px; line-height: 1.3; font-weight: 600; color: var(--muted); }
.power-block:has(.card-power-estimate) .card-power-estimate { margin: 0; font-size: 11px; line-height: 1.5; }
.power-block:has(.card-power-estimate) > span { display: none; }
.player-card-detail .player-metrics { gap: 0; }
.player-card-detail .player-metrics .compact-metric { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; text-align: center; padding: 6px 8px; background: var(--detail-surface); border: 1px solid var(--detail-line); border-radius: 7px; }
.player-card .player-metrics .compact-metric,
.guild-card .guild-period-metrics .compact-metric {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.player-card .player-metrics .compact-metric > span,
.guild-card .guild-period-metrics .compact-metric > span { color: var(--metric-label); font-size: 11px; font-weight: 400; }
.player-card .player-metrics .compact-metric > strong,
.guild-card .guild-period-metrics .compact-metric > strong { color: var(--metric-value); font-size: 13px; font-weight: 600; }
.player-card .player-metrics .compact-metric .delta-up,
.guild-card .guild-period-metrics .compact-metric .delta-up { color: #0f766e; }
.player-card .player-metrics .compact-metric .delta-down,
.guild-card .guild-period-metrics .compact-metric .delta-down { color: var(--bad); }
:root[data-theme="dark"] .compact-metric .delta-up { color: #79bbaa; }
:root[data-theme="dark"] .compact-metric .delta-down { color: #db9399; }
.ranking-item.is-player > .inline-trend-toggle { display: flex; align-items: center; justify-content: center; gap: 5px; width: 70px; min-height: 44px; top: 50%; transform: translateY(-50%); font-size: 12px; }
.ranking-item > .player-card { padding-right: 90px; }
@media (min-width: 721px) {
  .player-card .player-card-detail { grid-template-rows: auto auto; row-gap: 8px; }
  .player-card .player-card-detail .player-metrics { grid-column: 2; grid-row: 1 / 3; align-self: center; }
  .player-card .player-card-detail .card-note { grid-column: 1; grid-row: 2; background: transparent; padding: 0; height: auto; min-height: 18px; font-style: normal; color: var(--muted); }
}
.ranking-item.is-expanded.is-player > .inline-trend-toggle { top: 14px; transform: none; }
@media (max-width: 720px) {
  .ranking-item > .ranking-card.player-card { padding-right: 58px; }
  .ranking-item.is-player > .inline-trend-toggle { position: absolute; top: 12px; right: 8px; transform: none; width: 44px; min-width: 44px; height: 44px; min-height: 44px; margin: 0; padding: 0; border: 0; background: transparent; }
  .ranking-item.is-expanded.is-player > .inline-trend-toggle { transform: none; }
  .ranking-item > .player-card .player-card-detail .player-metrics .compact-metric { display: grid; gap: 4px; padding: 8px 4px; text-align: center; }
}
.member-identity .member-name-before { color: var(--muted); font-weight: 400; }
.member-identity .member-name-arrow { color: var(--muted); padding: 0 3px; }
.member-identity .member-name-after { color: var(--accent); font-weight: 700; }
.member-identity .detail-link > span { display: inline; font-size: inherit; }
.change-dialog.is-drawer .member-change-row { grid-template-columns: 68px minmax(0, 1fr) 90px; gap: 12px; padding: 12px 10px; }
.change-dialog.is-drawer .member-identity > strong { white-space: normal; overflow: visible; }
.change-dialog.is-drawer .member-identity .detail-link { text-align: left; line-height: 1.6; }
.change-dialog.is-drawer .member-identity > small { white-space: normal; margin-top: 4px; line-height: 1.6; }
.change-dialog.is-drawer .member-guild-path { grid-column: 2 / -1; display: flex; gap: 8px; }
.change-dialog.is-drawer .status-badge { white-space: nowrap; }
.share-card .member-change-row { grid-template-columns: 68px minmax(0, 1fr) 98px; gap: 12px; }
.share-card .member-change-row .status-badge { white-space: nowrap; font-size: 12px; padding: 5px 6px; }
.member-change-row .status-badge,
.daily-change-row > .status-badge,
.share-card .member-change-row .status-badge {
  width: 100%; min-width: 0; max-width: none;
  height: 28px; min-height: 28px; padding: 0 2px;
  box-sizing: border-box; border-radius: 6px;
  align-self: start; justify-self: stretch;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1; white-space: nowrap;
}
.share-card .member-guild-path { grid-column: 2 / -1; display: flex; gap: 8px; }
.share-card .member-identity .detail-link { text-align: left; line-height: 1.6; }
.share-card .member-change-metric { text-align: right; }
.roster-hidden-heading { margin-top: 16px; border-top: 1px solid var(--line); font-weight: 600; }
.roster-hidden-heading > span { display: block; font-weight: 400; margin-top: 3px; }
.roster-estimate { display: grid; gap: 5px; text-align: right; }
.roster-estimate small { color: var(--muted); font-size: 11px; font-weight: 400; }
.roster-estimate strong { color: var(--accent); font-size: 13px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.change-dialog.is-guild-change.is-expanded .member-change-row { grid-template-columns: 68px minmax(0, 1fr) 140px; }
.change-dialog .member-change-metric.is-estimated { grid-column: 3; grid-row: 1; }
.change-dialog .member-change-metric.is-estimated > strong { color: var(--accent); font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .change-dialog.is-drawer .member-change-row,
  .change-dialog.is-guild-change.is-expanded .member-change-row { grid-template-columns: 52px minmax(0, 1fr) 90px; gap: 8px; }
}
@media (max-width: 420px) {
  .guild-roster-row.is-hidden-power { grid-template-columns: 20px minmax(0, 1fr); }
  .is-hidden-power .roster-estimate { grid-column: 2; text-align: left; margin-top: 3px; }
}

/* Local refinement: quiet metrics, inline disclosure and clearer detail rhythm. */
.player-card .player-metrics .compact-metric + .compact-metric,
.guild-card .guild-period-metrics .compact-metric + .compact-metric {
  border-left: 1px solid var(--detail-line);
}
.guild-card .guild-period-metrics { gap: 0; }
.player-card .player-metrics .compact-metric,
.guild-card .guild-period-metrics .compact-metric { padding: 5px 12px; line-height: 1.5; }
.player-card .player-metrics .compact-metric > span,
.guild-card .guild-period-metrics .compact-metric > span { color: var(--muted); }
.player-card .player-metrics .compact-metric > strong,
.guild-card .guild-period-metrics .compact-metric > strong { font-variant-numeric: tabular-nums; }
.change-dialog.is-drawer:not(.share-card) .player-facts { gap: 8px; margin-bottom: 24px; }
.change-dialog.is-drawer:not(.share-card) .player-fact { min-height: 64px; padding: 10px 14px; gap: 5px; border-radius: 9px; box-shadow: none; }
.change-dialog.is-drawer:not(.share-card) .player-archive-section > h3 { font-size: 17px; margin-bottom: 18px; line-height: 38px; }
.player-trend-period > div { border: 0; padding: 3px; background: var(--detail-surface); }
.player-trend-period button[aria-pressed="true"] { border-color: transparent; font-weight: 600; }
.archive-preview-summary { padding: 16px 0; line-height: 1.8; }
@media (max-width: 720px) {
  .ranking-item.is-player > .inline-trend-toggle .trend-toggle-label,
  .ranking-item.is-player > .inline-trend-toggle svg { display: none; }
  .ranking-item.is-player > .inline-trend-toggle::before { content: none; }
  .ranking-item.is-player > .inline-trend-toggle::after {
    content: ''; width: 7px; height: 7px; border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg);
    transition: transform 160ms ease;
  }
  .ranking-item.is-player > .inline-trend-toggle[aria-expanded="true"]::after { transform: translateY(2px) rotate(225deg); }
  .ranking-item.is-player > .inline-trend-toggle:hover,
  .ranking-item.is-player > .inline-trend-toggle[aria-expanded="true"] { color: var(--accent); background: var(--accent-soft); }
  .ranking-item.is-expanded.is-player > .inline-trend-toggle { top: 12px; }
  .ranking-item > .player-card .player-card-detail { margin-right: -44px; }
  .ranking-item:not(.is-expanded) > .guild-card .guild-period-metrics { display: none; }
  .ranking-item.is-expanded > .guild-card .guild-period-metrics { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid var(--detail-line); }
  .ranking-item > .guild-card { position: relative; padding-right: 58px; }
  /* Keep guild power beside identity, including old engines and narrow screens. */
  .ranking-item > .guild-card { grid-template-columns: 28px minmax(0, 1fr) minmax(82px, auto); grid-column-gap: 8px; column-gap: 8px; }
  .guild-card .card-rank { grid-column: 1; grid-row: 1; align-self: start; }
  .guild-card .player-block { grid-column: 2; grid-row: 1; min-width: 0; }
  .guild-card .power-block { grid-column: 3; grid-row: 1; min-width: 0; align-self: start; text-align: right; }
  .guild-card .power-block > span { text-align: right; }
  .guild-card .card-action { position: absolute; grid-area: auto; top: 12px; right: 8px; margin: 0; }
  .ranking-item.is-expanded > .guild-card .guild-period-metrics { margin-right: -44px; }
  .guild-card .inline-trend-toggle { width: 44px; min-width: 44px; min-height: 44px; border: 0; background: transparent; }
  .guild-card .inline-trend-toggle::before { content: none; }
  .player-card .player-metrics .compact-metric,
  .guild-card .guild-period-metrics .compact-metric { padding: 6px 4px; }
}
/* Exported member lists use the paper width, including hidden-power rows. */
.share-card .guild-roster-row.is-hidden-power { grid-template-columns:26px minmax(0,1fr) 150px; }
.share-card .is-hidden-power .roster-estimate { grid-column:3; text-align:right; margin-top:0; }

/* Archive observation gaps: compact disclosure shared by preview and full archive. */
.archive-record-gaps { margin: 12px 0; border: 1px solid var(--detail-line); border-radius: 8px; background: var(--detail-surface); }
.archive-record-gaps > summary { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; cursor: pointer; list-style: none; font-size: 13px; box-sizing: border-box; }
.archive-record-gaps > summary::-webkit-details-marker { display: none; }
.archive-record-gaps > summary > span:first-child { font-weight: 600; }
.archive-record-gaps > summary > span:nth-child(2) { margin-left: auto; color: var(--muted); white-space: nowrap; }
.archive-record-gaps > summary::after { content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); flex-shrink: 0; }
.archive-record-gaps[open] > summary::after { transform: rotate(225deg); }
.change-dialog .archive-link-note { margin: 4px 0 12px; border: 0; background: transparent; color: var(--muted); font-size: 12px; line-height: 1.65; }
.archive-link-note > summary { display: flex; align-items: center; gap: 8px; width: fit-content; max-width: 100%; min-height: 44px; box-sizing: border-box; padding: 4px 0; list-style: none; cursor: pointer; font-size: 12px; font-weight: 400; }
.archive-link-note > summary::-webkit-details-marker { display: none; }
.archive-link-note > summary::after { content: ''; width: 5px; height: 5px; margin: 0 3px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); flex-shrink: 0; }
.archive-link-note[open] > summary::after { transform: rotate(225deg); }
.archive-link-note > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.change-dialog .archive-link-note small { font-size: 11px; font-weight: 400; }
.archive-link-note-body { margin: 0 0 4px; padding: 0 12px; border-left: 2px solid var(--detail-line); overflow-wrap: anywhere; }
.change-dialog .archive-link-entry + .archive-link-entry { margin-top: 8px; }
.change-dialog .archive-link-entry-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; color: var(--text-secondary); font-size: 12px; line-height: 1.65; }
.change-dialog .archive-link-note p { margin: 6px 0 0; padding: 0; font-size: 12px; line-height: 1.65; color: inherit; }
.change-dialog .archive-link-note .archive-link-evidence { margin-top: 2px; white-space: pre-line; }
.change-dialog .archive-link-note .archive-link-footnote { margin-top: 8px; font-size: 11px; }
#changeDialog[data-kind="archive"].is-expanded:not(.share-card) .archive-basic-list > .archive-link-note { grid-column: 1 / -1; margin: 0; }
.archive-record-gaps > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.archive-gap-body { border-top: 1px solid var(--detail-line); padding: 10px 12px; }
.archive-gap-body > p, .archive-gap-clear { font-size: 12px; line-height: 1.6; color: var(--muted); }
.archive-gap-body > p { margin: 0 0 10px; }
.archive-gap-body ul { list-style: none; padding: 0; margin: 0; }
.archive-gap-body li { padding: 9px 0; border-top: 1px solid var(--detail-line); }
.archive-gap-body li > div { font-size: 12px; line-height: 1.7; font-variant-numeric: tabular-nums; }
.archive-gap-body li strong { display: inline-block; margin-left: 10px; font-size: 12px; }
.archive-gap-body li small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.5; }
/* Continuation hints share the archive drawer's quiet surfaces and rhythm. */
.archive-candidates { min-width: 0; margin-block: 16px; border: 1px solid var(--detail-line); border-radius: 10px; background: var(--detail-surface); }
.archive-basic-list > .archive-candidates { margin-block: 0; }
.candidate-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; padding: 10px 14px; }
.candidate-heading-toggle { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; box-shadow: none; cursor: pointer; }
.candidate-heading-toggle:disabled { opacity: 1; cursor: default; }
.candidate-guide > summary::-webkit-details-marker { display: none; }
.candidate-heading { display: grid; gap: 3px; min-width: 0; }
.candidate-heading strong { color: var(--text); font-size: 14px; font-weight: 600; line-height: 1.5; }
.candidate-heading > span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.candidate-heading-toggle > svg { display: none; width: 14px; height: 14px; color: var(--muted); transform: rotate(-90deg); flex-shrink: 0; }
.archive-candidates[data-expanded="true"] .candidate-heading-toggle > svg { display: block; }
.archive-candidates[data-expanded="true"] { cursor: pointer; }
.candidate-heading-toggle:focus-visible, .candidate-guide > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.candidate-body { margin-inline: 14px; padding: 12px 0 4px; border-top: 1px solid var(--detail-line); }
.candidate-directions { display: flex; gap: 8px; flex-shrink: 0; }
.candidate-directions > .candidate-direction { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--detail-hover-line); border-radius: 6px; background: transparent; color: var(--accent); font: inherit; box-shadow: none; text-align: left; cursor: pointer; touch-action: manipulation; }
.candidate-direction > svg { width: 16px; height: 16px; flex-shrink: 0; }
.candidate-direction[data-candidate-direction="before"] > svg { transform: rotate(180deg); }
.candidate-direction-label { display: grid; gap: 2px; }
.candidate-direction strong { font-size: 13px; font-weight: 500; }
.candidate-direction small { display: none; color: var(--muted); font-size: 12px; font-weight: 400; }
.candidate-directions > .candidate-direction[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--detail-hover-line); color: var(--accent); }
.candidate-direction:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.candidate-direction:disabled { cursor: progress; opacity: .65; }
@media (hover: hover) { .candidate-direction:hover { background: var(--accent-soft); border-color: var(--accent); } }
.candidate-coverage-note { margin: 10px 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.candidate-group { min-width: 0; margin-bottom: 18px; }
.candidate-group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.candidate-group-head h4 { margin: 0; color: var(--text); font-size: 13px; font-weight: 600; line-height: 1.6; }
.candidate-group-head > span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.candidate-boundary { margin: 2px 0 10px; color: var(--muted); font-size: 12px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.candidate-list { display: grid; gap: 8px; }
.candidate-list > .candidate-card { display: grid; gap: 6px; width: 100%; min-width: 0; min-height: 44px; padding: 13px 14px; border: 1px solid var(--detail-line); border-radius: 9px; background: var(--panel-solid); color: var(--text); font: inherit; text-align: left; white-space: normal; box-shadow: none; cursor: pointer; touch-action: manipulation; transition: border-color var(--motion-fast), background var(--motion-fast); }
.candidate-card-heading { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.candidate-name { min-width: 0; margin-right: auto; color: var(--accent); font-size: 15px; font-weight: 600; line-height: 1.55; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.candidate-grade { flex-shrink: 0; padding: 2px 7px; border-radius: 5px; background: var(--detail-surface); color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.7; white-space: nowrap; }
.candidate-grade[data-grade="A"] { background: var(--accent-soft); color: var(--accent); }
.candidate-grade[data-grade="B"] { background: var(--soft); color: var(--text-secondary); }
.candidate-grade[data-grade="C"] { background: transparent; color: var(--muted); }
.candidate-card-heading > svg { flex-shrink: 0; width: 15px; height: 20px; margin-top: 2px; color: var(--muted); }
.candidate-dates { color: var(--muted); font-size: 12px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.candidate-facts { display: grid; gap: 4px; color: var(--text-secondary); font-size: 12px; line-height: 1.7; font-variant-numeric: tabular-nums; }
.candidate-fact { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px; }
.candidate-fact > :first-child { color: var(--muted); white-space: nowrap; }
.candidate-fact > :last-child { overflow-wrap: anywhere; }
.candidate-power-values { display: flex; flex-wrap: wrap; gap: 0 8px; }
.candidate-power-values > span { white-space: nowrap; }
.candidate-power-comparison { display: inline-flex; gap: 6px; color: var(--muted); }
.candidate-power-comparison > span { white-space: nowrap; }
.candidate-list > .candidate-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.candidate-list > .candidate-card:active { background: var(--detail-hover); }
.candidate-list > .candidate-card:disabled { opacity: .65; cursor: progress; }
@media (hover: hover) { .candidate-list > .candidate-card:hover { border-color: var(--detail-hover-line); background: var(--detail-hover); } }
.candidate-help { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.candidate-guide { border-top: 1px solid var(--detail-line); }
.candidate-guide > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; color: var(--muted); font-size: 12px; cursor: pointer; list-style: none; }
.candidate-guide > summary svg { width: 14px; height: 14px; flex-shrink: 0; }
.candidate-guide[open] > summary svg { transform: rotate(90deg); }
.candidate-guide > div { padding-bottom: 12px; }
.candidate-guide p { margin: 0 0 7px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.candidate-empty { display: grid; gap: 7px; padding: 10px 0 22px; }
.candidate-empty strong { color: var(--text-secondary); font-size: 13px; font-weight: 500; }
.candidate-empty > span { color: var(--muted); font-size: 12px; line-height: 1.8; }
.candidate-loading { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 100px; color: var(--muted); font-size: 13px; }
.candidate-loading .dialog-loading-spinner { width: 18px; height: 18px; }
.candidate-error { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 84px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.candidate-error .candidate-retry { flex-shrink: 0; min-height: 44px; padding: 8px 12px; border: 1px solid var(--detail-line); border-radius: 8px; color: var(--accent); background: var(--panel-solid); box-shadow: none; cursor: pointer; }
.candidate-error small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .candidate-toolbar { flex-wrap: wrap; }
  .candidate-directions { flex-basis: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .candidate-directions > .candidate-direction { display: grid; grid-template-columns: 16px minmax(0, 1fr) 16px; grid-template-rows: auto auto; min-height: 62px; padding: 8px; column-gap: 2px; row-gap: 2px; text-align: center; }
  .candidate-direction-label { display: contents; }
  .candidate-direction-label > strong { grid-column: 2; grid-row: 1; }
  .candidate-direction small { display: block; grid-column: 1 / -1; grid-row: 2; white-space: nowrap; }
  .candidate-direction > svg { grid-column: 1; grid-row: 1; }
  .candidate-direction[data-candidate-direction="after"] > svg { grid-column: 3; }
  .candidate-toolbar.is-single { flex-wrap: nowrap; }
  .candidate-toolbar.is-single .candidate-directions { flex-basis: auto; display: flex; }
  .candidate-toolbar.is-single .candidate-direction { width: 136px; min-height: 54px; padding-block: 6px; }
}
@media (max-width: 380px) {
  .candidate-toolbar { padding-inline: 10px; }
  .candidate-body { margin-inline: 10px; }
  .candidate-list > .candidate-card { padding: 11px; }
  .candidate-card-heading { gap: 6px; }
  .candidate-power-values { column-gap: 4px; }
  .candidate-power-comparison { gap: 4px; }
  .candidate-power-comparison.has-delta .candidate-power-reference-value { display: none; }
  .candidate-power-comparison.has-delta .candidate-power-reference-label::before { content: '比'; }
}
@media (prefers-reduced-motion: reduce) { .candidate-list > .candidate-card { transition: none; } }

.archive-basic-list > .archive-trend-section { margin-bottom: 0; }
.guild-detail-layout > * + * { margin-top: 14px; }

/* Expanded details: one scrolling surface, with primary records and secondary tools. */
@media (min-width: 900px) {
  #changeDialog.is-expanded:not(.share-card) .dialog-head { padding: 12px 18px; }
  #changeDialog.is-expanded:not(.share-card) .dialog-head > div:first-child > strong { font-size: 22px; }
  #changeDialog.is-expanded:not(.share-card) .change-dialog-body { padding: 14px 18px 18px; min-width: 0; }
  #changeDialog.is-expanded:not(.share-card) .change-dialog-body > *,
  #changeDialog.is-expanded:not(.share-card) .player-archive-body,
  #changeDialog.is-expanded:not(.share-card) .archive-basic-list > * { min-width: 0; }
  #changeDialog.is-expanded:not(.share-card) .player-facts { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--detail-line); gap: 0; }
  #changeDialog.is-expanded:not(.share-card) .player-fact { min-height: 62px; padding: 0 16px; border: 0; border-left: 1px solid var(--detail-line); border-radius: 0; background: transparent; }
  #changeDialog.is-expanded:not(.share-card) .player-fact:first-child { padding-left: 0; border-left: 0; }
  #changeDialog.is-expanded:not(.share-card) .player-profile-section + .player-profile-section { margin-top: 12px; }

  #changeDialog[data-kind="archive"].is-expanded:not(.share-card) #archiveViewBasic .archive-basic-list {
    grid-template-columns: minmax(0, 1.65fr) minmax(285px, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto; align-items: start; gap: 14px;
  }
  #changeDialog[data-kind="archive"].is-expanded:not(.share-card) .archive-basic-list > .archive-life { grid-column: 1; grid-row: 1 / span 2; }
  #changeDialog[data-kind="archive"].is-expanded:not(.share-card) .archive-basic-list > .archive-trend-section { grid-column: 2; grid-row: 1; }
  #changeDialog[data-kind="archive"].is-expanded:not(.share-card) .archive-basic-list > .archive-candidates,
  #changeDialog[data-kind="archive"].is-expanded:not(.share-card) .archive-basic-list > .candidate-coverage-note { grid-column: 1 / -1; grid-row: 3; margin: 0; }
  #changeDialog[data-kind="archive"].is-expanded:not(.share-card) .archive-basic-list > .archive-rename-details { grid-column: 2; grid-row: 2; margin: 0; }

  /* Tracking keeps the same full-width position whether open or closed. */
  #changeDialog.is-expanded:not(.share-card):not([data-kind="daily"]) .candidate-list > .candidate-card { grid-template-columns: minmax(140px, 1fr) minmax(110px, .75fr) minmax(0, 2fr); gap: 8px 18px; align-items: center; }
  #changeDialog.is-expanded:not(.share-card):not([data-kind="daily"]) .candidate-card-heading { grid-column: 1; grid-row: 1; display: grid; grid-template-columns: minmax(0, 1fr) 15px; gap: 3px 8px; align-items: center; }
  #changeDialog.is-expanded:not(.share-card):not([data-kind="daily"]) .candidate-name { grid-column: 1; grid-row: 1; margin: 0; }
  #changeDialog.is-expanded:not(.share-card):not([data-kind="daily"]) .candidate-grade { grid-column: 1; grid-row: 2; justify-self: start; }
  #changeDialog.is-expanded:not(.share-card):not([data-kind="daily"]) .candidate-card-heading > svg { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
  #changeDialog.is-expanded:not(.share-card):not([data-kind="daily"]) .candidate-dates { grid-column: 2; grid-row: 1; }
  #changeDialog.is-expanded:not(.share-card):not([data-kind="daily"]) .candidate-facts { grid-column: 3; grid-row: 1; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 8px 14px; }
  #changeDialog.is-expanded:not(.share-card) .archive-rename-details { border: 1px solid var(--detail-line); border-radius: 9px; background: var(--detail-surface); padding: 0 12px; }
  #changeDialog.is-expanded:not(.share-card) .archive-rename-details > summary { min-height: 48px; padding-block: 12px; }
  #changeDialog.is-expanded:not(.share-card) .archive-trend-section { margin-bottom: 0; }
  #changeDialog.is-expanded:not(.share-card) .archive-trend-section > summary { min-height: 54px; padding-block: 8px; }
  #changeDialog.is-expanded:not(.share-card) .archive-trend-body .player-trend-chart svg { height: 200px; min-height: 0; }
  #changeDialog.is-expanded:not(.share-card) .archive-trend-body .player-trend-period > span,
  #changeDialog.is-expanded:not(.share-card) .archive-trend-body .trend-chart figcaption > span:first-child:not(.trend-legend) { display: none; }
  #changeDialog.is-expanded:not(.share-card) .archive-trend-body .player-trend-period { justify-content: flex-end; }

  #changeDialog[data-kind="player"].is-expanded:not(.share-card) .player-archive-body {
    display: flex; flex-direction: column; gap: 12px; align-items: stretch;
  }
  #changeDialog[data-kind="player"].is-expanded:not(.share-card) .player-trend-panel { margin: 0; }
  #changeDialog[data-kind="player"].is-expanded:not(.share-card) .archive-preview-summary { display: contents; }
  #changeDialog[data-kind="player"].is-expanded:not(.share-card) .archive-preview-meta { order: -1; display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0; border: 0; border-radius: 0; background: transparent; }
  #changeDialog[data-kind="player"].is-expanded:not(.share-card) .archive-preview-meta p { margin: 0; }
  #changeDialog[data-kind="player"].is-expanded:not(.share-card) .archive-life { margin: 0; }
  #changeDialog[data-kind="player"].is-expanded:not(.share-card) .archive-candidates,
  #changeDialog[data-kind="player"].is-expanded:not(.share-card) .candidate-coverage-note { margin: 0; }
  #changeDialog[data-kind="player"].is-expanded:not(.share-card) .archive-action-bar { position: static; width: auto; margin: 0; padding: 8px 0 0; box-shadow: none; }

  #changeDialog[data-kind="daily"].is-expanded:not(.share-card) .change-dialog-body {
    display: grid; grid-template-columns: minmax(300px, 1fr) minmax(0, 1.35fr);
    grid-template-rows: auto auto auto; align-items: start; align-content: start; gap: 12px 18px; overflow: auto;
  }
  #changeDialog[data-kind="daily"].is-expanded:not(.share-card) .daily-change-headline { grid-column: 1 / -1; grid-row: 1; }
  #changeDialog[data-kind="daily"].is-expanded:not(.share-card) .change-summary { grid-column: 1 / -1; grid-row: 2; margin: 0; padding-block: 0 12px; }
  #changeDialog[data-kind="daily"].is-expanded:not(.share-card) .daily-change-compare { grid-column: 1; grid-row: 3; overflow: visible; padding: 0; }
  #changeDialog[data-kind="daily"].is-expanded:not(.share-card) .daily-change-archive { grid-column: 2; grid-row: 3; display: block; margin: 0; }
  #changeDialog[data-kind="daily"].is-expanded:not(.share-card) .player-archive-body { display: flex; flex-direction: column; gap: 12px; overflow: visible; }
  #changeDialog[data-kind="daily"].is-expanded:not(.share-card) .archive-preview-summary { order: 0; padding: 0; }
  #changeDialog[data-kind="daily"].is-expanded:not(.share-card) .archive-trend-section { order: 1; }
  #changeDialog[data-kind="daily"].is-expanded:not(.share-card) .archive-action-bar { order: 2; }
  #changeDialog[data-kind="daily"].is-expanded:not(.share-card) .player-archive-section > h3 { margin-bottom: 8px; line-height: 1.5; }
  #changeDialog[data-kind="daily"].is-expanded:not(.share-card) .archive-action-bar { position: static; margin: 8px 0 0; padding: 0; box-shadow: none; }
  #changeDialog[data-kind="daily"].is-expanded:not(.share-card) .change-comparison-table th,
  #changeDialog[data-kind="daily"].is-expanded:not(.share-card) .change-comparison-table td { padding-block: 10px; }

  #changeDialog[data-kind="guild"].is-expanded:not(.share-card) .guild-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
  #changeDialog[data-kind="guild"].is-expanded:not(.share-card) .guild-detail-layout > * { min-width: 0; margin: 0; }
  #changeDialog[data-kind="guild"].is-expanded:not(.share-card) .member-change-section { grid-column: 1; grid-row: 2; }
  #changeDialog[data-kind="guild"].is-expanded:not(.share-card) .guild-trend-section { grid-column: 1; grid-row: 1; }
  #changeDialog[data-kind="guild"].is-expanded:not(.share-card) .member-change-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #changeDialog[data-kind="guild"].is-expanded:not(.share-card) .guild-roster-row { min-height: 48px; padding-block: 8px; }
  #changeDialog[data-kind="guild"].is-expanded:not(.share-card) .roster-identity { grid-template-columns: minmax(0, 1fr) 60px; align-items: center; gap: 8px; }

  /* Short histories use their natural height instead of leaving an empty column. */
  #changeDialog[data-kind="archive"][data-archive-layout="compact"].is-expanded:not(.share-card) #archiveViewBasic .archive-basic-list { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
  #changeDialog[data-archive-layout="compact"].is-expanded:not(.share-card) .archive-life { margin: 0; }
  #changeDialog[data-kind="archive"][data-archive-layout="compact"].is-expanded:not(.share-card) .archive-trend-body .player-trend-chart svg { height: 160px; }
  #changeDialog[data-kind="archive"][data-archive-layout="compact"].is-expanded:not(.share-card) .archive-trend-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
  #changeDialog[data-kind="archive"][data-archive-layout="compact"].is-expanded:not(.share-card) .archive-trend-overview { margin: 0; }
  #changeDialog[data-kind="archive"][data-archive-layout="compact"].is-expanded:not(.share-card) .archive-trend-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  #changeDialog[data-kind="archive"][data-archive-layout="compact"].is-expanded:not(.share-card) .archive-trend-body > .player-trend-period { grid-column: 1 / -1; grid-row: 1; margin-bottom: 0; }
  #changeDialog[data-kind="archive"][data-archive-layout="compact"].is-expanded:not(.share-card) .archive-trend-body > .player-trend-chart { grid-column: 1 / -1; grid-row: 2; }
  #changeDialog[data-kind="archive"][data-archive-layout="compact"].is-expanded:not(.share-card) .archive-power-detail-link { grid-column: 2; grid-row: 3; margin: 0; }
  #changeDialog[data-kind="archive"][data-archive-layout="compact"].is-expanded:not(.share-card) .archive-record-gaps,
  #changeDialog[data-kind="archive"][data-archive-layout="compact"].is-expanded:not(.share-card) .archive-gap-clear { grid-column: 1; grid-row: 3; margin: 0; }
  #changeDialog[data-kind="archive"][data-archive-layout="compact"].is-expanded:not(.share-card) .archive-record-gaps[open],
  #changeDialog[data-kind="archive"][data-archive-layout="compact"].is-expanded:not(.share-card) .archive-trend-body > .player-profile-section { grid-column: 1 / -1; grid-row: auto; }
}

/* Ownership: reading preferences, evidence disclosures, chart tables, density and motion policy. */

/* Shared native date fields, including dynamically rendered guild details. */
input[type="date"] { appearance:none; -webkit-appearance:none; display:block; width:100%; min-width:0; min-inline-size:0; max-width:100%; max-inline-size:100%; box-sizing:border-box; }
input[type="date"]::-webkit-date-and-time-value { min-width:0; text-align:left; }
input[type="date"]::-webkit-datetime-edit { min-width:0; padding:0; }
.member-change-controls > label { display:grid; gap:6px; min-width:0; position:relative; }
.member-change-controls input[type="date"] { min-height:44px; font-size:16px; text-align:left; padding:0 36px 0 10px; }
.member-change-controls .date-field::after { bottom:14px; }
@media(max-width:480px) {
  .filters .date-field, .member-change-controls > label { grid-column:1 / -1; }
  .member-change-controls .member-change-presets { width:100%; box-sizing:border-box; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
  .member-change-controls .member-change-presets button { min-height:44px; min-width:0; padding-inline:4px; font-size:13px; }
}

.reading-dialog { width:min(600px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); box-sizing:border-box; overflow:auto; padding:var(--space-6); background:var(--panel-solid); color:var(--text); border:1px solid var(--line); border-radius:16px; }
.reading-dialog::backdrop { background:rgb(10 30 25 / .36); }
.reading-dialog.is-fallback-open { position:fixed; top:50%; left:50%; margin:0; transform:translate(-50%,-50%); z-index:100; display:block; max-height:calc(100vh - 24px); }
.reading-dialog header { display:flex; justify-content:space-between; gap:var(--space-3); align-items:center; }
.reading-dialog header { position:sticky; top:-16px; z-index:1; background:var(--panel-solid); padding-block:8px; }
.reading-dialog h2 { font-size:var(--type-heading); margin:0; }
.reading-dialog h3 { font-size:16px; margin:24px 0 12px; }
.reading-dialog label { display:grid; grid-template-columns:1fr 1fr; align-items:center; gap:12px; margin-top:16px; }
.reading-dialog button,.reading-dialog select,#readingPreferencesBtn { min-height:44px; }
.reading-dialog header button { flex:none; white-space:nowrap; min-width:60px; }
.detail-sequence { display:inline-flex; align-items:center; gap:4px; margin-top:6px; color:var(--muted); font-size:12px; }
.detail-sequence button { min-width:64px; min-height:44px; padding:0 8px; border:1px solid var(--line); background:var(--panel-solid); box-shadow:none; font-size:12px; border-radius:7px; }
.detail-sequence button:disabled { opacity:.4; }
#detailSequence { width:max-content; }
.change-dialog .dialog-head .detail-sequence span { display:inline; font-size:11px; color:var(--muted); white-space:nowrap; }
.reading-dialog p,.reading-dialog pre { font-family:inherit; white-space:pre-wrap; font-size:var(--type-body); line-height:1.8; }
.reading-demo { background:var(--soft); border:1px solid var(--line); border-radius:10px; padding:16px; margin-top:16px; }
.reading-demo strong { display:block; color:var(--power-num); font-size:22px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.evidence-help { font-size:12px; color:var(--muted); line-height:1.7; }
.evidence-help > summary { cursor:pointer; padding:8px 0; color:var(--accent); }
.evidence-help > p { max-width:52ch; }
.member-change-row .evidence-help { min-width:0; }
.member-change-row .evidence-help[open] { grid-column:1 / -1; }
.trend-evidence { margin-top:12px; font-size:12px; }
.trend-evidence summary { cursor:pointer; color:var(--accent); padding:12px 0; }
.trend-table-scroll { max-height:280px; overflow:auto; }
.trend-evidence table { width:100%; border-collapse:collapse; font-variant-numeric:tabular-nums; }
.trend-evidence th,.trend-evidence td { text-align:left; padding:10px; border-bottom:1px solid var(--line); }
:focus-visible { outline:2px solid var(--accent); outline-offset:3px; scroll-margin-block:130px; }
@media(min-width:781px) {
  :root[data-density="compact"] .ranking-card { padding-block:6px; min-height:60px; }
  :root[data-density="compact"] .player-name { font-size:14px; }
  :root[data-density="compact"] .card-note { margin-block:2px; }
}
:root[data-motion="quiet"] *, :root[data-motion="quiet"] *::before, :root[data-motion="quiet"] *::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; }
/* Mobile density reduces whitespace, preserving text size and 44px controls. */
@media(max-width:780px) {
  :root[data-density="compact"] .ranking-card { padding-block:8px; }
  :root[data-density="compact"] .ranking-item > .ranking-card.player-card {
    padding-block:8px;
    row-gap:4px;
  }
  :root[data-density="compact"] .ranking-item > .player-card .player-meta { gap:4px 8px; }
  :root[data-density="compact"] .ranking-item > .inline-trend-toggle { top:6px; }
}
@media(prefers-reduced-motion:reduce) { *, *::before, *::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }
@media(max-width:390px) { .reading-dialog { padding:16px; } .reading-dialog h2 { font-size:18px; } }

.record-tools { position:relative; }
.record-tools [aria-pressed="true"] svg { fill:var(--accent); color:var(--accent); }
.record-feedback:empty { display:none; }
.record-feedback:not(:empty) { position:absolute; right:0; top:40px; width:220px; background:var(--panel-solid); border:1px solid var(--line); padding:10px; z-index:5; font-size:12px; }
.record-actions { display:flex; gap:8px; justify-content:flex-end; }
.record-actions button { min-height:44px; }
[data-saved-records] { display:grid; gap:8px; font-size:14px; max-height:240px; overflow:auto; margin-bottom:16px; }
[data-saved-records] a { display:block; padding:10px; color:var(--accent); overflow-wrap:anywhere; }
.record-revision-note { border-left:3px solid var(--accent-warm); padding:12px; color:var(--text-secondary); font-size:13px; }

.trend-policy-note { font-size:11px; color:var(--muted); line-height:1.7; }
.trend-raw-view > summary { cursor:pointer; color:var(--accent); padding:12px 0; font-size:12px; }

#detailRecordActions:empty,#detailSequence:empty { display:none; }
.favorites-entry { display:inline-flex; align-items:center; gap:6px; min-height:44px; padding:0 10px; }
.favorites-entry svg { width:18px; height:18px; }
.saved-caption { color:var(--muted); }
#readingPreferencesBtn { position:relative; }
@media(min-width:1280px) {
  body.detail-docked { padding-right:560px; }
  body.detail-docked .app-shell { width:calc(100% - 32px); }
  body.detail-docked .topbar { display:flex; flex-wrap:wrap; }
  body.detail-docked .mode-tabs { order:3; width:100%; }
  body.detail-docked .toolbar-actions { margin-left:auto; }
  body.detail-docked .app-shell > .pager { left:calc((100% - 560px) / 2); max-width:calc(100% - 592px); }
  body.detail-docked .pager .rank-jump { display:none; }
  .change-dialog.is-pinned { z-index:var(--layer-dialog); box-shadow:none; border-left:1px solid var(--line); }
  .change-dialog.is-pinned::backdrop { display:none; }
}
@media(max-width:1279px) { #detailPin { display:none; } }
@media(max-width:780px) {
  .toolbar-actions .icon-btn { width:44px; min-height:44px; }
  .detail-sequence button { min-width:60px; }
}

:root:not([data-evidence="on"]) .rename-evidence-detail,
:root:not([data-evidence="on"]) .trend-evidence,
:root:not([data-evidence="on"]) .trend-raw-view,
:root:not([data-evidence="on"]) .trend-policy-note { display:none; }
.saved-record-row { display:flex; align-items:center; gap:12px; border:1px solid var(--line); border-radius:10px; background:var(--panel-solid); }
[data-saved-records] .saved-record-row a { flex:1; min-width:0; display:grid; grid-template-columns:1fr auto; gap:4px 12px; padding:14px; text-decoration:none; }
.saved-record-row a strong { color:var(--text); font-size:16px; }
.saved-record-row a > span:not(.saved-record-open) { grid-row:2; color:var(--muted); font-size:12px; }
.saved-record-open { grid-column:2; grid-row:1 / 3; align-self:center; font-size:12px; }
.saved-record-remove { flex:none; min-height:44px; margin-right:8px; padding:0 10px; border:0; background:transparent; color:var(--muted); box-shadow:none; }
.saved-record-row:has(a:hover) { border-color:var(--accent); background:var(--soft); }
.guild-compare-side { position:relative; }
.guild-compare-side .compare-detail-open { position:absolute; inset:0; z-index:1; width:100%; height:100%; border:0; border-radius:inherit; background:transparent; box-shadow:none; cursor:pointer; }
.guild-compare-side:has(.compare-detail-open:hover) { outline:1px solid var(--accent); }
.guild-compare-side .detail-link-status { position:relative; z-index:2; font-size:12px; }

/* Compact navigation: persistent tools, secondary actions in a popover. */
.topbar { display:flex; flex-wrap:nowrap; align-items:center; gap:20px; }
.topbar .title-cluster { flex:1 1 auto; min-width:0; }
.topbar .mode-tabs { flex:0 0 auto; margin:0; }
.topbar .toolbar-actions { flex:none; width:auto; margin:0; gap:8px; }
.topbar .favorites-entry { margin:0; }
.snapshot-line { display:flex; align-items:center; gap:6px; }
.snapshot-line .quality-warning-btn { width:28px; min-height:28px; height:28px; padding:4px; border:0; background:transparent; box-shadow:none; }
.snapshot-line .quality-warning-btn svg { width:16px; height:16px; }
#moreToolsBtn { position:relative; }
.topbar .toolbar-actions > .icon-btn { display:inline-grid; place-items:center; width:44px; height:44px; min-width:44px; min-height:44px; padding:0; margin:0; line-height:1; box-sizing:border-box; }
.topbar .toolbar-actions > .icon-btn svg { width:20px; height:20px; margin:0; }
#changeServerPreference { font-size:11px; color:var(--muted); }
.more-tools { position:fixed; inset:auto; margin:0; width:286px; max-width:calc(100vw - 24px); padding:8px; color:var(--text); background:var(--panel-solid); border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow-float); }
.more-tools.is-menu-fallback { z-index:100; }
.more-tools[hidden] { display:none; }
.network-notice { padding:10px 16px; color:var(--text); background:var(--surface-cool); text-align:center; font-size:13px; }
.freshness-notice { font-size:12px; color:var(--muted); }
.share-fallback > button, .share-fallback > a { display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:8px 12px; margin:0 4px 4px 0; border:1px solid var(--line); border-radius:9px; color:var(--accent); background:var(--panel-solid); font-size:14px; text-decoration:none; }
.share-fallback > button { background:var(--accent); color:var(--panel-solid); }
[data-import-status]:empty { display:none; }
[data-import-status] { font-size:13px; line-height:1.6; overflow-wrap:anywhere; }
@media (max-width:800px) {
  html { -webkit-text-size-adjust:100%; text-size-adjust:100%; }
  .topbar .snapshot-line { display:block; }
  .topbar .freshness-notice { display:block; font-size:10px; line-height:1.5; }
  input, select, textarea, .pager .page-jump input { font-size:16px; }
  .filter-shell .filters label, .filter-shell .filter-field,
  .member-change-controls > label { font-size:12px; font-weight:500; }
  .filter-shell .filters input, .filter-shell .filters select,
  .member-change-controls input[type="date"] { font-size:16px; font-weight:400; line-height:1.4; min-height:44px; }
  .filter-shell .filters input::placeholder { font-size:14px; font-weight:400; }
  .filter-shell .filters input::-webkit-datetime-edit,
  .member-change-controls input::-webkit-datetime-edit { font-weight:400; }
  /* Phone filters share stacked captions and paired region/server fields. */
  .filter-shell .mobile-filter-copy { display:flex; align-items:center; gap:8px; min-width:0; }
  .filter-shell .mobile-filter-copy > span { display:none; }
  .filter-shell .mobile-filter-copy strong { font-size:12px; font-weight:500; }
  .filter-shell .mobile-filter-toggle { position:relative; min-height:44px; padding-block:6px; padding-right:76px; }
  .filter-shell .mobile-filter-chevron { position:absolute; right:12px; }
  .filter-shell #rankingFilters { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; padding:12px 4px 4px; }
  .filter-shell #rankingFilters > * { min-width:0; order:0; grid-column:auto; grid-row:auto; }
  .filter-shell #rankingFilters > label,
  .filter-shell #rankingFilters > .filter-field { display:grid; grid-template-columns:minmax(0,1fr); align-content:start; gap:6px; font-size:12px; padding:0; }
  .filter-shell #rankingFilters .filter-caption,
  .filter-shell #rankingFilters .guild-filter-field > label { display:block; }
  .filter-shell #rankingFilters .search-field { order:0; grid-column:2; }
  .filter-shell #rankingFilters > label#regionFilterField { grid-column:1; }
  .filter-shell #rankingFilters > #serverFilterField { grid-column:2; }
  .filter-shell #rankingFilters .primary-date-field { grid-column:1 / -1; }
  .filter-shell #rankingFilters .guild-filter-field { grid-column:1; }
  .filter-shell #rankingFilters.is-change-mode .date-field { grid-column:auto; }
  .filter-shell #rankingFilters .search-field input { padding-right:10px; }
  .filter-shell #rankingFilters input,
  .filter-shell #rankingFilters select,
  .filter-shell #rankingFilters .guild-filter-combobox { grid-column:1; grid-row:auto; }
  .filter-shell #rankingFilters .date-status { grid-column:1; }
  .filter-shell #rankingFilters .date-status:empty { display:none; }
  .filter-shell #rankingFilters #filterResetField { position:absolute; top:-43px; right:40px; width:32px; z-index:1; }
  .filter-shell #filterResetBtn { width:32px; height:32px; min-height:32px; border:0; box-shadow:none; }
  .filter-shell #changeRangeQuick { grid-row:auto; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 8px; padding-left:0; grid-column:1 / -1; }
  .filter-shell #changeRangeQuick > .filter-caption { display:none; }
  .filter-shell #rankingFilters #changeRangeMobileSelect { display:block; grid-column:1; grid-row:1; width:100%; min-width:0; font-size:14px; }
  .filter-shell #changeRangeQuick .change-range-buttons { display:none; }
  .filter-shell #saveChangeServer { grid-column:2; grid-row:1; min-width:0; padding-inline:6px; font-size:11px; border:0; background:transparent; box-shadow:none; }
  .filter-shell #changeServerPreference { grid-column:1 / -1; font-weight:400; }
  .filter-shell #changeServerPreference:empty { display:none; }
  .filter-shell #filterSummary { display:none; }
  .filter-shell #rankingFilters input, .filter-shell #rankingFilters select,
  .filter-shell #rankingFilters button { height:40px; min-height:40px; box-sizing:border-box; }
  .filter-shell #rankingFilters #filterResetBtn { height:32px; min-height:32px; }
  .filter-shell #rankingFilters input[type="date"],
  #changeDialog .member-change-controls input[type="date"] { height:40px; min-height:40px; padding-block:0; line-height:38px; }
  .filter-shell #rankingFilters input[type="date"]::-webkit-date-and-time-value,
  #changeDialog .member-change-controls input[type="date"]::-webkit-date-and-time-value { line-height:38px; text-align:left; }
  .filter-shell #rankingFilters .date-field::after,
  #changeDialog .member-change-controls .date-field::after { bottom:12px; }
  #changeDialog .member-change-controls { gap:6px; }
  #changeDialog .member-change-controls > label { grid-column:1 / -1; grid-template-columns:56px minmax(0,1fr); align-items:center; gap:6px; }
  #changeDialog .member-change-controls .member-change-presets { display:flex; flex-wrap:nowrap; overflow-x:auto; gap:2px; padding:2px; }
  #changeDialog .member-change-controls .member-change-presets button { flex:0 0 auto; min-height:40px; padding-inline:10px; font-size:12px; }
  .keyboard-open .app-shell > .pager, .keyboard-open .back-top-btn { visibility:hidden; pointer-events:none; }
  .reading-dialog { max-height:calc(100dvh - 32px); overflow:auto; padding-bottom:max(20px, env(safe-area-inset-bottom)); }
  .reading-dialog footer { flex-wrap:wrap; }
}
.more-tools header { display:flex; align-items:center; justify-content:space-between; padding:2px 4px 8px 10px; margin-bottom:4px; border-bottom:1px solid var(--line); }
.more-tools header strong { font-size:13px; color:var(--muted); }
.more-tools .tool-menu-item { display:flex; align-items:center; width:100%; min-height:64px; gap:12px; padding:10px 12px; border:0; border-radius:8px; box-shadow:none; text-align:left; background:transparent; }
.more-tools .tool-menu-item:hover { background:var(--soft); transform:none; }
.more-tools a.tool-menu-item { color:var(--text); text-decoration:none; }
.tool-menu-item svg { flex:none; width:20px; height:20px; color:var(--accent); }
.tool-menu-copy { flex:1; display:grid; gap:3px; }
.tool-menu-copy strong { font-size:14px; font-weight:600; }
.tool-menu-copy small { font-weight:400; font-size:11px; color:var(--muted); }
.menu-chevron { font-size:20px; color:var(--muted); }
.more-tools .menu-close,.reading-dialog header .menu-close { display:grid; place-items:center; flex:none; width:40px; min-width:40px; height:40px; min-height:40px; padding:0; border:0; border-radius:8px; box-shadow:none; background:transparent; color:var(--muted); }
.menu-close svg { width:18px; height:18px; }
.menu-close { display:inline-grid; place-items:center; width:40px; min-width:40px; min-height:40px; padding:0; border:0; border-radius:8px; background:transparent; box-shadow:none; }
.menu-close:hover { background:var(--soft)!important; color:var(--text)!important; }
@media(max-width:900px) {
  .topbar { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; }
  .topbar .title-cluster { grid-column:1; grid-row:1; }
  .topbar .toolbar-actions { grid-column:2; grid-row:1; }
  .topbar .mode-tabs { grid-column:1 / -1; grid-row:2; width:100%; }
  .topbar .mode-tab { flex:1; min-width:0; }
  .topbar .title-cluster h1 { max-width:none; overflow:visible; }
  .topbar #snapshotMeta { font-size:10px; white-space:normal; }
  .title-cluster .snapshot-line { min-width:0; }
}

/* Phone detail pages and secondary bottom sheets own their mobile layout here. */
@media (max-width:780px) {
  #changeDialog.is-drawer:not(.share-card) { inset:0; margin:0; width:100%; max-width:100%; height:100dvh; max-height:100dvh; border:0; border-radius:0; }
  #changeDialog.is-drawer > form { display:flex; flex-direction:column; }
  #changeDialog.is-drawer .dialog-head { display:grid; grid-template-columns:44px minmax(0,1fr) auto; gap:0 4px; padding:max(8px,env(safe-area-inset-top)) 12px 8px; }
  #changeDialog.is-drawer .dialog-head > div:first-child { display:contents; }
  #changeDialog.is-drawer #detailBack { grid-column:1; grid-row:1 / 3; width:44px; height:44px; min-height:44px; align-self:start; border:0; border-radius:50%; background:transparent; box-shadow:none; -webkit-tap-highlight-color:transparent; }
  #changeDialog.is-drawer #detailBack svg { width:22px; height:22px; stroke-width:2; }
  #changeDialog.is-drawer #detailBack:active { background:var(--accent-soft); }
  #changeDialog.is-drawer #detailBack:focus-visible { outline:2px solid var(--accent); outline-offset:-5px; }
  #changeDialog.is-drawer #changeDialogTitle[tabindex="-1"]:focus { outline:none; box-shadow:none; }
  #changeDialog.is-drawer #changeDialogTitle { grid-column:2; grid-row:1; align-self:end; font-size:18px; line-height:24px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  #changeDialog.is-drawer #changeDialogMeta { grid-column:2; grid-row:2; margin:0; font-size:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  #changeDialog.is-drawer .dialog-head-actions { grid-column:3; grid-row:1 / 3; align-self:start; gap:0; }
  #changeDialog.is-drawer .dialog-head-actions .dialog-icon-btn:not(.share-toggle) { width:44px; min-width:44px; height:44px; min-height:44px; }
  #changeDialog.is-drawer #changeDialogClose, #changeDialog.is-drawer #changeDialogExpand { display:none; }
  #changeDialog.is-drawer #detailSequence { grid-column:1 / -1; grid-row:3; justify-self:end; }
  #changeDialog.is-drawer .detail-sequence { margin-top:2px; gap:8px; }
  #changeDialog.is-drawer .detail-sequence button { border:0; background:transparent; min-width:64px; min-height:44px; }
  #changeDialog.is-drawer .change-dialog-body { min-height:0; overflow:auto; overscroll-behavior:contain; padding:16px 16px max(20px,env(safe-area-inset-bottom)); }
  /* One phone scroll surface: date controls must not squeeze the list to zero. */
  #changeDialog.is-drawer.is-guild-change .change-dialog-body { display:block; }
  #changeDialog.is-drawer.is-guild-change .change-dialog-body > * + * { margin-top:8px; }
  #changeDialog.is-drawer.is-guild-change .member-change-section { display:block; }
  #changeDialog.is-drawer.is-guild-change .member-change-list,
  #changeDialog.is-drawer.is-guild-change .guild-roster { max-height:none; overflow:visible; overscroll-behavior:auto; scrollbar-gutter:auto; }
  #readingPreferences, #savedRecordsDialog { position:fixed; inset:auto 0 0; margin:0; width:100%; max-width:100%; max-height:82dvh; border-radius:20px 20px 0 0; padding:12px 20px max(20px,env(safe-area-inset-bottom)); border-bottom:0; overscroll-behavior:contain; animation:phone-sheet-enter var(--motion-standard) ease-out; }
  #readingPreferences header, #savedRecordsDialog header { top:-12px; padding:8px 0; }
  #readingPreferences.is-fallback-open, #savedRecordsDialog.is-fallback-open { top:auto; left:0; right:0; bottom:0; transform:none; max-height:82vh; max-height:82dvh; }
  #readingPreferences header .menu-close, #savedRecordsDialog header .menu-close { min-width:44px; width:44px; height:44px; }
  #savedRecordsDialog [data-saved-records] { max-height:44dvh; overscroll-behavior:contain; }
  #savedRecordsDialog .record-actions { padding-top:8px; }
  body:has(#readingPreferences[open]), body:has(#savedRecordsDialog[open]) { overflow:hidden; }
}
@keyframes phone-sheet-enter { from { transform:translateY(32px); opacity:0; } to { transform:translateY(0); opacity:1; } }

/* Archive browsing uses the latest index; keep this explicit even with mobile grid rules. */
.primary-date-field[hidden] { display: none !important; }
/* The header already displays the archive date; filters use the freed column for search. */
@media (min-width: 801px) {
  .filter-shell #rankingFilters.is-archive-mode {
    grid-template-columns: minmax(110px, .8fr) minmax(110px, .8fr) minmax(140px, 1fr) minmax(180px, 1.6fr) 36px;
    grid-template-areas: "region server guild search reset";
    align-items: center;
    gap: 8px;
  }
  #rankingFilters.is-archive-mode > .search-field { grid-area: search; }
  #rankingFilters.is-archive-mode > label#regionFilterField { grid-area: region; }
  #rankingFilters.is-archive-mode > #serverFilterField { grid-area: server; }
  #rankingFilters.is-archive-mode > .guild-filter-field { grid-area: guild; }
  #rankingFilters.is-archive-mode > #filterResetField { grid-area: reset; min-width: 36px; }
  #rankingFilters.is-archive-mode input,
  #rankingFilters.is-archive-mode select,
  #rankingFilters.is-archive-mode .guild-filter-combobox,
  #rankingFilters.is-archive-mode #filterResetBtn { height: 36px; min-height: 36px; box-sizing: border-box; }
}

@media (max-width: 800px) {
  .filter-shell #rankingFilters.is-archive-mode { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-shell #rankingFilters.is-archive-mode > label#regionFilterField { grid-column: 1; }
  .filter-shell #rankingFilters.is-archive-mode > #serverFilterField { grid-column: 2; }
  .filter-shell #rankingFilters.is-archive-mode > .guild-filter-field { grid-column: 1 / -1; }
}

/* Two-row ranking filters keep the clear action beside the search input. */
@media (min-width: 801px) and (max-width: 1100px) {
  #rankingFilters:not(.is-archive-mode):not(.is-change-mode):not(.is-guild-compare-mode) > .search-field {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-right: 44px;
  }
  #rankingFilters:not(.is-archive-mode):not(.is-change-mode):not(.is-guild-compare-mode) > .search-field input {
    height: 36px;
    min-height: 36px;
  }
  #rankingFilters:not(.is-archive-mode):not(.is-change-mode):not(.is-guild-compare-mode) > #filterResetField {
    position: static;
    grid-column: 4;
    grid-row: 2;
    justify-self: end;
    align-self: end;
    min-width: 36px;
  }
}

:root[data-evidence="on"] .rename-evidence-summary { display:none; }
#detailRenameHistory .rename-evidence-note { margin:6px 0 12px; font-size:12px; line-height:1.6; color:var(--muted); }

/* Mobile guild cards share their date/server context above the member list. */
.guild-overview-more,
.member-change-range-caption,
.member-change-range-toggle,
.member-change-metric .member-rank-label,
#changeDialog .member-guild-path .member-guild-mobile { display:none; }
.member-school .member-server { display:inline; }
.member-identity .member-name-destination,
.member-identity .member-name-destination > span { display:inline; font-size:inherit; }
.member-change-action-feedback { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); clip-path:inset(50%); white-space:nowrap; border:0; }
.member-change-action-feedback[hidden] { display:none; }
#changeDialog .member-change-controls > .member-change-skip-toggle { display:flex; align-items:center; justify-content:flex-end; gap:5px; min-height:44px; font-size:12px; color:var(--muted); cursor:pointer; white-space:nowrap; }
.member-change-skip-toggle input { width:16px; height:16px; min-height:16px; padding:0; margin:0; accent-color:var(--accent); cursor:pointer; }
.member-change-skip-toggle input:checked + span { color:var(--accent); font-weight:700; }
.member-change-skip-toggle input:disabled + span { opacity:.6; }
.guild-change-overview > .guild-overview-delta { border-right:0; }
@media (min-width:601px) {
  #changeDialog.is-guild-change:not(.share-card) .guild-change-overview > div > strong,
  #changeDialog.is-guild-change:not(.share-card) .guild-change-overview > div > small { white-space:normal; }
  #changeDialog.is-guild-change:not(.share-card) .member-change-controls { grid-template-columns:repeat(12,minmax(0,1fr)); gap:8px; }
  #changeDialog.is-guild-change:not(.share-card) .member-change-controls > .date-field:nth-of-type(1) { grid-column:1 / 7; grid-row:1; }
  #changeDialog.is-guild-change:not(.share-card) .member-change-controls > .date-field:nth-of-type(2) { grid-column:7 / 13; grid-row:1; }
  #changeDialog.is-guild-change:not(.share-card) .member-change-presets { grid-column:1 / 10; grid-row:2; width:fit-content; max-width:100%; align-self:center; }
  #changeDialog.is-guild-change:not(.share-card) .member-change-presets button { min-height:44px; padding-inline:8px; font-size:12px; }
  #changeDialog.is-guild-change:not(.share-card) .member-change-presets button[aria-pressed="true"] { background:var(--panel-solid); color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); font-weight:700; }
  #changeDialog.is-guild-change:not(.share-card) .member-change-skip-toggle { grid-column:10 / 13; grid-row:2; align-self:center; justify-self:end; }
  #changeDialog.is-guild-change:not(.share-card) .member-change-range-status { font-size:12px; }
  #changeDialog.is-guild-change:not(.share-card) .member-change-list > .dialog-empty { grid-column:1 / -1; margin:0; padding:16px 12px; line-height:1.6; }
  #changeDialog.is-guild-change:not(.share-card) .change-dialog-body:has(> .record-revision-note) { grid-template-rows:auto auto auto minmax(0,1fr); }
}
@media (max-width:640px) {
  .guild-change-overview > .guild-overview-delta { grid-column:1 / -1; border-top:1px solid var(--line); }
}
@media (max-width:600px) {
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .change-dialog-body { padding:12px 12px max(16px,env(safe-area-inset-bottom)); background:var(--soft); }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-change-overview { display:flex; flex-direction:column; padding:10px 12px 0; border-radius:10px; background:var(--panel-solid); }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-change-overview > div { border:0; padding:0; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-current { order:0; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-current > span { font-size:12px; white-space:normal; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-current > strong { margin:4px 0; font-size:22px; line-height:1.35; white-space:normal; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-current > small { font-size:12px; white-space:normal; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-delta { order:1; margin-top:6px; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-delta > span,
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-delta > small { display:none; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-delta > strong { margin:0; color:var(--accent); font-size:12px; white-space:normal; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-more { display:flex; order:2; align-items:center; justify-content:space-between; gap:8px; width:100%; min-height:44px; padding:4px 0; border:0; border-radius:0; background:transparent; box-shadow:none; font-size:12px; font-weight:400; color:var(--muted); }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-more-state { color:var(--accent); flex-shrink:0; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-previous { display:none; order:3; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .is-history-expanded > .guild-overview-previous { display:block; padding:8px 0 12px; border-top:1px solid var(--line); }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-previous > span,
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-previous > small { white-space:normal; font-size:12px; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-trend-section { border:0; border-bottom:1px solid var(--line); border-radius:0; background:transparent; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-trend-toggle { min-height:44px; padding:4px 2px; background:transparent; border-radius:0; gap:6px; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-trend-toggle strong { font-size:13px; font-weight:500; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-trend-toggle small { font-size:11px; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-section { border:0; border-radius:0; background:transparent; overflow:visible; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-head { padding:0; background:transparent; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-people-tabs { gap:12px; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-people-tabs button { min-height:44px; padding:6px 8px; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) #guildChangeRangeLabel { display:none; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-controls { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); padding:8px 0 0; gap:0; border:0; background:transparent; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-controls[hidden] { display:none; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-range-caption { display:flex; grid-column:1 / 4; grid-row:2; align-items:center; min-height:44px; padding-right:6px; color:var(--muted); font-size:12px; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-controls > .date-field { display:none; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-controls.is-range-expanded > .date-field { display:grid; grid-template-columns:minmax(0,1fr); grid-row:3; gap:4px; margin:0 0 8px; font-size:12px; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-controls > .date-field:nth-of-type(1) { grid-column:1 / 3; padding-right:4px; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-controls > .date-field:nth-of-type(2) { grid-column:3 / 5; padding-left:4px; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-controls input[type=date] { min-width:0; width:100%; font-size:14px; min-height:44px; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-controls > .member-change-presets { display:contents; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-presets button { grid-row:1; min-width:0; width:100%; min-height:44px; padding:0 3px; font-size:12px; border:1px solid var(--line); border-right:0; border-radius:0; background:var(--accent-soft); color:var(--accent); box-shadow:none; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-presets [data-guild-range="previous"] { grid-column:1; border-radius:8px 0 0 8px; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-presets [data-guild-range="last-7"] { grid-column:2; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-presets [data-guild-range="month"] { grid-column:3; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-presets .member-change-range-toggle { display:block; grid-column:4; border-right:1px solid var(--line); border-radius:0 8px 8px 0; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-presets [aria-pressed="true"],
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-presets .member-change-range-toggle[aria-expanded="true"] { background:var(--panel-solid); font-weight:700; box-shadow:inset 0 0 0 1px var(--accent); }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-skip-toggle { grid-column:4; grid-row:2; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-presets [data-guild-range="week"],
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-presets [data-guild-range="latest"] { display:none; grid-row:4; border:1px solid var(--line); border-radius:7px; margin-bottom:8px; background:var(--panel-solid); }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-presets [data-guild-range="week"] { grid-column:1 / 3; width:calc(100% - 4px); }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-presets [data-guild-range="latest"] { grid-column:3 / 5; width:calc(100% - 4px); justify-self:end; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-controls.is-range-expanded [data-guild-range="week"],
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-controls.is-range-expanded [data-guild-range="latest"] { display:block; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-presets button:active { border-color:var(--accent); background:var(--accent-soft); }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-range-status { grid-column:1 / -1; grid-row:5; min-height:0; padding:0 0 6px; font-size:12px; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-range-status:empty { display:none; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-summary { grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; padding:0 0 4px; border:0; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-stat { display:flex; align-items:center; justify-content:center; gap:4px; min-height:44px; padding:4px 2px; background:var(--panel-solid); border:1px solid var(--line); border-radius:7px; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-stat span { font-size:12px; white-space:nowrap; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-stat strong { font-size:13px; margin:0; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-stat.is-selected { border-color:var(--accent); background:var(--accent-soft); }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-stat.status-join { background:rgba(16,185,129,.12); border-color:rgba(16,185,129,.26); }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-stat.status-leave { background:rgba(239,68,68,.10); border-color:rgba(239,68,68,.24); }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-stat.status-rename { background:rgba(245,158,11,.12); border-color:rgba(245,158,11,.26); }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-stat.status-new { background:rgba(14,165,233,.10); border-color:rgba(14,165,233,.24); }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-stat.is-selected { border-color:currentColor; box-shadow:inset 0 0 0 1px currentColor; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-row { position:relative; grid-template-columns:max-content minmax(0,1fr); grid-template-rows:auto; align-items:start; gap:4px 8px; margin-top:8px; padding:8px 10px 10px; border:1px solid var(--line); border-radius:9px; background:var(--panel-solid); }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-row > .evidence-help,
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-row > .evidence-help[open] { grid-column:1; grid-row:1; min-height:44px; margin:0; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-row .status-badge { width:auto; min-height:44px; height:auto; padding:4px 7px; font-size:12px; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-row .evidence-help > p { position:absolute; left:8px; right:8px; top:48px; z-index:2; margin:0; padding:10px; border:1px solid var(--line); border-radius:7px; background:var(--panel-solid); box-shadow:var(--shadow); }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-row > .member-identity { grid-column:2; grid-row:1; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:0 6px; align-items:center; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-identity > strong { grid-column:1; min-height:44px; display:flex; align-items:center; font-size:15px; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-identity .detail-link { min-height:44px; padding:0; line-height:1.45; text-align:left; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .has-name-change .detail-link { display:flex; flex-wrap:wrap; align-items:center; gap:0 6px; max-width:100%; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-identity .member-name-before { display:inline; max-width:100%; overflow-wrap:anywhere; font-size:13px; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-identity .member-name-destination { display:inline-flex; align-items:baseline; gap:4px; max-width:100%; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-identity .member-name-arrow { display:inline; flex-shrink:0; padding:0; font-size:13px; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-identity .member-name-after { display:inline; min-width:0; overflow-wrap:anywhere; font-size:15px; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-identity > .member-school { grid-column:2; align-self:center; font-size:11px; text-align:right; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-identity .member-server.is-shared,
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-identity .member-row-date.is-shared { display:none; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-identity .member-row-date { grid-column:1 / -1; margin-top:2px; font-size:11px; overflow-wrap:anywhere; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-row > .member-change-metric { display:grid; grid-column:1 / -1; grid-row:auto; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:2px 6px; text-align:left; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-metric > span:first-child { grid-column:1; grid-row:1; font-size:11px; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-metric > strong { grid-column:1; grid-row:2; font-size:15px; line-height:1.4; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-metric > .member-rank-label { display:block; grid-column:2; grid-row:1; text-align:right; font-size:11px; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-metric > small { grid-column:2; grid-row:2; text-align:right; font-size:13px; overflow-wrap:anywhere; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-metric.is-estimated > strong { grid-column:1 / -1; grid-row:2; font-size:15px; overflow-wrap:normal; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-metric.is-estimated > .member-rank-label { grid-column:1; grid-row:3; text-align:left; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-metric.is-estimated > small { grid-column:2; grid-row:3; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-change-row > .member-guild-path { grid-column:1 / -1; grid-row:auto; gap:4px; font-size:12px; flex-wrap:wrap; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-guild-path strong { white-space:normal; overflow-wrap:anywhere; font-size:12px; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-guild-path.has-mobile-path > span:first-child,
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-guild-path.has-mobile-path > strong { display:none; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .member-guild-path > .member-guild-mobile { display:inline; color:var(--text); margin:0; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .detail-mobile-footer { display:none; }
}
.change-dashboard.has-page-share { grid-template-columns:minmax(0,1fr) auto; }
.change-dashboard.has-page-share > .change-overview { grid-column:1 / -1; grid-row:1; padding-right:88px; }
.change-dashboard.has-page-share > .daily-change-list { grid-column:1 / -1; }
.change-page-share { position:relative; grid-column:2; grid-row:1; align-self:center; margin-right:12px; z-index:17; }
.change-page-share-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.change-page-share-menu { position:relative; }
.change-page-share-menu > button { display:flex; gap:6px; align-items:center; min-height:44px; padding:0 6px; border:0; border-radius:10px; background:transparent; color:var(--muted); box-shadow:none; font-size:12px; font-weight:400; }
.change-page-share-menu > button:hover,.change-page-share-menu > button[aria-expanded="true"] { color:var(--accent); background:var(--accent-soft); }
.change-page-share-menu svg { width:17px; height:17px; }
.change-page-share-choices { position:absolute; right:0; top:100%; width:252px; max-width:calc(100vw - 36px); padding:8px; z-index:35; border:1px solid var(--line); border-radius:14px; background:var(--panel-solid); box-shadow:var(--shadow-float); }
.change-page-share-choices button { display:block; width:100%; min-height:62px; padding:10px; border:0; background:transparent; text-align:left; box-shadow:none; }
.change-page-share-choices button:hover,.change-page-share-choices button:focus-visible { background:var(--accent-soft); }
.change-page-share-choices strong,.change-page-share-choices small { display:block; }
.change-page-share-choices small { margin-top:3px; color:var(--muted); font-size:12px; }
.change-page-share-status:empty { display:none; }
.change-page-share-status { position:absolute; right:0; top:100%; width:240px; max-width:calc(100vw - 36px); padding:10px; background:var(--panel-solid); border:1px solid var(--line); border-radius:10px; font-size:12px; color:var(--muted); }
.change-page-share-fallback:not([hidden]) { position:absolute; right:0; top:calc(100% + 60px); width:400px; max-width:calc(100vw - 36px); max-height:60vh; overflow:auto; padding:12px; border:1px solid var(--line); border-radius:10px; background:var(--panel-solid); box-shadow:var(--shadow-float); }
.change-page-share-fallback img { display:block; max-width:100%; height:auto; margin-top:10px; }
.change-page-share-fallback textarea { width:100%; min-height:80px; font-size:16px; }
.share-toolbar .share-fallback.is-image-panel,
.change-page-share-fallback.is-image-panel:not([hidden]) { top:calc(100% + 6px); width:328px; max-width:calc(100vw - 28px); max-height:58vh; max-height:58dvh; padding:10px; margin-top:0; overflow:auto; }
.share-image-panel,.share-image-gallery { --share-image-control-height:34px; font-size:13px; color:var(--text); text-align:left; }
.share-image-panel-head { display:grid; grid-template-columns:var(--share-image-control-height) minmax(0,1fr) var(--share-image-control-height); align-items:center; gap:6px; }
.share-image-panel-head > div { display:flex; align-items:baseline; flex-wrap:wrap; gap:0 8px; }
.share-image-panel-head strong { font-size:15px; font-weight:600; }
.share-image-panel-head button { min-width:0; min-height:var(--share-image-control-height); padding:0; border:0; border-radius:7px; background:transparent; color:var(--muted); box-shadow:none; font-size:22px; }
.share-image-panel-head button:hover { background:var(--accent-soft); color:var(--accent); }
.share-image-panel-context { font-size:12px; color:var(--muted); }
.share-image-settings:not([hidden]) { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:6px 0 0; }
.share-image-panel fieldset { min-width:0; padding:0; margin:0; border:0; }
.share-image-panel legend { padding:0; margin-bottom:4px; color:var(--muted); font-size:12px; }
.share-image-segments { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:2px; padding:2px; border:1px solid var(--line); border-radius:8px; background:var(--soft); }
.share-image-segments label { position:relative; min-width:0; margin:0; }
.share-image-segments input { position:absolute; width:1px; height:1px; opacity:0; }
.share-image-segments span { display:flex; align-items:center; justify-content:center; min-height:var(--share-image-control-height); margin:0; padding:2px 4px; border:1px solid transparent; border-radius:6px; color:var(--muted); cursor:pointer; }
.share-image-segments input:checked + span { background:var(--panel-solid); color:var(--accent); border-color:var(--line); font-weight:600; }
.share-image-segments input:focus-visible + span { outline:2px solid var(--accent); outline-offset:1px; }
.share-image-panel fieldset:disabled { opacity:.6; }
.share-image-panel .share-image-generate { width:100%; min-height:var(--share-image-control-height); margin-top:8px; padding:2px 8px; border:1px solid var(--accent); border-radius:7px; background:var(--accent); color:var(--panel-solid); font:inherit; font-weight:600; }
.share-toolbar .share-image-panel [role="status"],.share-image-panel .share-image-panel-status { position:static; width:auto; margin:6px 0 0; padding:0; border:0; background:transparent; box-shadow:none; font-size:12px; line-height:1.5; color:var(--muted); }
.share-image-panel .share-image-panel-status:empty { margin:0; }
.share-image-results:not([hidden]) { margin-top:6px; }
.share-image-gallery { display:grid; gap:8px; }
.share-image-page { display:grid; gap:6px; min-width:0; margin:0; }
.share-image-page figcaption,.share-image-save-hint { margin:0; color:var(--muted); font-size:12px; line-height:1.5; }
.share-image-actions { display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
.share-image-gallery .share-image-action { display:inline-flex; align-items:center; justify-content:center; min-height:var(--share-image-control-height); padding:2px 8px; border:1px solid var(--line); border-radius:7px; background:var(--panel-solid); color:var(--accent); box-shadow:none; font:inherit; text-decoration:none; white-space:nowrap; }
.share-image-gallery .share-image-action.is-primary,.share-image-gallery .share-image-action:hover { background:var(--accent-soft); }
.share-image-gallery .share-image-preview { display:block; max-width:100%; height:auto; margin:0; }
@media(pointer:coarse) {
  .share-image-panel,.share-image-gallery { --share-image-control-height:40px; }
}
@media(max-width:720px) {
  .change-page-share-fallback.is-image-panel:not([hidden]) { right:-16px; max-height:min(58dvh,calc(100dvh - 280px)); }
  .change-dashboard.has-page-share > .change-overview { padding-right:6px; }
  .change-dashboard.has-page-share > .change-range-mobile { grid-column:1 / -1; grid-row:2; }
  .change-dashboard.has-page-share > .change-range-mobile.is-plain,
  .change-dashboard.has-page-share > .change-range-mobile summary { padding-right:88px; }
  .change-dashboard.has-page-share > .change-range-mobile summary::after { right:76px; }
  .change-page-share { grid-row:2; align-self:start; }
}

/* First paint is independent of the module graph and API response time. */
.initial-loading { margin-top:12px; }
.initial-loading[hidden] { display:none; }
.boot-caption { display:flex; align-items:center; gap:12px; padding:18px 20px; color:var(--text); }
.boot-caption strong { font-size:15px; font-weight:600; }
.boot-caption p { margin:5px 0 0; color:var(--muted); font-size:12px; line-height:1.6; }
.boot-caption > div { flex:1; min-width:0; }
.boot-caption small { color:var(--muted); font-size:12px; font-variant-numeric:tabular-nums; }
.query-wait-copy { flex:1; min-width:0; line-height:1.6; }
.query-wait-copy > * { display:block; }
.query-wait-copy > .query-wait-heading, .query-wait-heading { display:flex; align-items:center; justify-content:flex-start; gap:12px; }
.query-wait-heading > strong { font-size:12px; font-weight:650; white-space:nowrap; }
.query-wait-copy > [data-wait-message] { display:block; font-size:12px; font-weight:400; color:var(--muted); }
[data-wait-elapsed] { font-variant-numeric:tabular-nums; }
[data-wait-elapsed], #bootElapsed { white-space:nowrap; font-size:11px; font-weight:400; color:var(--muted); }
#analysisLoadingCover .loading-note { width:calc(100% - 28px); padding:10px 12px; border:0; border-left:3px solid var(--accent); border-radius:0 7px 7px 0; box-shadow:none; background:var(--accent-soft); }
#analysisLoadingCover .loading-note .spinner { align-self:flex-start; margin-top:3px; }
#analysisLoadingCover .loading-note small { margin-top:0; }
body #analysisLoadingCover { bottom:auto; padding-top:12px; background:transparent; pointer-events:none; }
.view-transition #rankingBusy { display:none; }
.ranking-busy:not([hidden]), #analysisLoadingCover:not([hidden]) .loading-note { animation:wait-appear 140ms ease-out; }
.mode-tab[aria-busy="true"]::before { content:""; position:absolute; left:auto; right:4px; top:50%; bottom:auto; width:10px; height:10px; margin-top:-5px; border:1.5px solid currentColor; border-right-color:transparent; border-radius:50%; background:transparent; animation:spinner-spin .8s linear infinite; }
.mode-tab[aria-busy="true"] { position:relative; }
#querySubmit[aria-busy="true"]::before, .thumb-search-submit[aria-busy="true"]::before { content:""; display:inline-block; width:10px; height:10px; margin-right:5px; border:1.5px solid currentColor; border-right-color:transparent; border-radius:50%; animation:spinner-spin .8s linear infinite; }
@keyframes wait-appear { from { opacity:0; } to { opacity:1; } }
.boot-caption button { margin-left:auto; min-height:44px; flex-shrink:0; }
.boot-indicator { width:9px; height:9px; border-radius:50%; background:var(--accent); flex:none; animation:boot-breathe 1.6s ease-in-out infinite; }
:root[data-theme="dark"] .boot-filter span,
:root[data-theme="dark"] .boot-row i,
:root[data-theme="dark"] .boot-row b,
:root[data-theme="dark"] .boot-row span,
:root[data-theme="dark"] .boot-row em { background: rgba(255,255,255,.06); }
.boot-filter,.boot-rows { border:1px solid var(--line); background:var(--panel-solid); border-radius:14px; overflow:hidden; }
.boot-filter { display:flex; gap:24px; padding:20px; margin-bottom:12px; }
.boot-filter span,.boot-row i,.boot-row b,.boot-row span,.boot-row em { display:block; background:var(--soft); border-radius:5px; animation:boot-breathe 1.6s ease-in-out infinite; }
.boot-filter span { width:22%; height:16px; }
.boot-row { display:grid; grid-template-columns:36px minmax(0,1fr) 110px; gap:20px; align-items:center; padding:22px 24px; border-bottom:1px solid var(--line); }
.boot-row:last-child { border:0; }
.boot-row i { width:30px; height:30px; border-radius:10px; }
.boot-row b { width:35%; height:16px; }
.boot-row span { width:55%; height:10px; margin-top:12px; }
.boot-row em { height:22px; }
html[data-boot="error"] .boot-rows,html[data-boot="error"] .boot-filter { display:none; }
html[data-boot="error"] .boot-indicator { animation:none; background:var(--accent-warm); }
.filters > *, .filters .filter-field { min-width:0; }
.filters input,.filters select { min-width:0; max-width:100%; box-sizing:border-box; }
@keyframes boot-breathe { 50% { opacity:.45; } }
@media(max-width:800px) {
  .boot-caption { padding:18px 10px; align-items:flex-start; flex-wrap:wrap; }
  .boot-indicator { margin-top:5px; }
  .boot-filter { padding:20px 16px; }
  .boot-filter span { width:52%; }
  .boot-filter span:not(:first-child) { display:none; }
  .boot-row { padding:20px 16px; gap:12px; grid-template-columns:30px minmax(0,1fr) 76px; }
  .boot-row b { width:70%; }
  .boot-row span { width:90%; }
}
@media(max-width:720px) {
  body #analysisLoadingCover, body #rankingBusy { position:fixed; top:auto!important; bottom:calc(76px + env(safe-area-inset-bottom)); left:14px!important; width:calc(100% - 28px)!important; margin:0; padding:0; z-index:24; }
  body #rankingBusy { padding:8px 12px; background:var(--panel-solid); border:1px solid var(--line); border-radius:10px; }
  #analysisLoadingCover .loading-note { width:100%; background:var(--panel-solid); border:1px solid var(--line); border-radius:10px; }
}
@media(prefers-reduced-motion:reduce) { .ranking-busy, #analysisLoadingCover .loading-note, .mode-tab[aria-busy="true"]::before, #querySubmit::before, .thumb-search-submit::before { animation:none!important; } }
:root[data-motion="quiet"] .ranking-busy, :root[data-motion="quiet"] #analysisLoadingCover .loading-note, :root[data-motion="quiet"] .mode-tab[aria-busy="true"]::before, :root[data-motion="quiet"] #querySubmit::before, :root[data-motion="quiet"] .thumb-search-submit::before { animation:none!important; }
@media(prefers-reduced-motion:reduce) { .initial-loading * { animation:none!important; } }
:root[data-motion="quiet"] .initial-loading * { animation:none!important; }

.mode-tabs { grid-template-columns: repeat(6, minmax(0, 1fr)); }
a.mode-tab { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
a.mode-tab:hover { color: var(--accent); background: var(--accent-soft); }
a.mode-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.stats-shell { width: min(1180px, calc(100% - 24px)); max-width: none; padding: 8px 0 28px; }
.stats-shell .topbar { font-size: 16px; flex-wrap: wrap; margin-bottom: 0; }
.stats-shell .topbar h1 { font-size: 24px; letter-spacing: 0; }
.stats-shell .topbar .mode-tabs { flex: 0 0 auto; }
.stats-shell #themeToggle { margin-left: 0; font-size: 12px; }
.stats-heading { padding: 18px 4px; gap: 12px; }
.stats-heading h2 { font-size: 18px; }
.stats-heading .intro { margin-top: 4px; font-size: 12px; }
.snapshot-mark strong { font-size: 16px; }
.stats-controls { padding: 14px; gap: 14px; border-radius: 12px; background: var(--panel-solid); box-shadow: var(--shadow); }
.stats-shell .results-heading { margin-top: 18px; }
.stats-controls { margin-top: 2px; }
.matrix-toggle { position: relative; padding: 0 12px; gap: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-solid); font-size: 12px; color: var(--text-secondary); }
.matrix-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.matrix-switch { display: inline-block; position: relative; width: 28px; height: 16px; border-radius: 10px; background: var(--line-strong); transition: background var(--motion-fast); }
.matrix-switch::after { content: ''; position: absolute; left: 3px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--panel-solid); transition: transform var(--motion-fast); }
.matrix-toggle:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.matrix-toggle input:checked + .matrix-switch { background: var(--accent); }
.matrix-toggle input:checked + .matrix-switch::after { transform: translateX(12px); }
.matrix-toggle:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.matrix-toggle:hover { border-color: var(--accent); }
.stats-shell .results, .stats-shell .guild-server { border-radius: 12px; box-shadow: var(--shadow-sm); }
@media (max-width: 800px) {
  .stats-shell .topbar .mode-tabs { order: 3; width: 100%; }
  .stats-shell .topbar { gap: 8px; }
  .mode-tabs .mode-tab { min-width: 0; padding-left: 7px; padding-right: 7px; }
}
@media (max-width: 520px) {
  .stats-shell { padding: 6px 0 24px; }
  .stats-shell .topbar h1 { font-size: 21px; }
  .stats-heading { display: flex; align-items: flex-start; padding: 14px 2px; }
  .snapshot-mark { margin: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 0; }
  .snapshot-mark strong { font-size: 14px; }
  .stats-heading .intro { max-width: 180px; }
  .stats-shell #themeToggle { padding: 6px 9px; }
  .stats-shell .mode-tab { min-height: 40px; font-size: 12px; }
}

.statistics-filter-toggle { display: none; }
@media (max-width: 800px) {
  .statistics-filter-shell { position: sticky; top: 8px; z-index: 18; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-solid); box-shadow: var(--shadow-lg); }
  .statistics-filter-toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px; border: 0; background: transparent; box-shadow: none; text-align: left; }
  .statistics-filter-toggle:hover { box-shadow: none; }
  .statistics-filter-toggle > span:first-child { min-width: 0; }
  .statistics-filter-toggle small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
  .statistics-filter-toggle strong { display: block; font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .filter-chevron { width: 7px; height: 7px; border-right: 1.5px solid var(--accent); border-bottom: 1.5px solid var(--accent); transform: rotate(225deg); margin: 0 5px; flex: none; }
  .is-mobile-collapsed .filter-chevron { transform: rotate(45deg); }
  .statistics-filter-shell .stats-controls { border: 0; border-top: 1px solid var(--line); box-shadow: none; margin: 0; border-radius: 0 0 12px 12px; max-height: 65dvh; overflow-y: auto; }
  .statistics-filter-shell.is-mobile-collapsed .stats-controls { display: none; }
}

#dateSelect { width: 100%; min-width: 0; height: 44px; padding: 0 10px; font-size: 14px; border: 1px solid var(--line-strong); background: var(--panel-solid); color: var(--text); border-radius: 7px; }
#statisticsDateStatus:empty { display: none; }
#statisticsDateStatus { color: var(--bad); font-size: 11px; }

.matrix-toggle { padding: 0; min-height: 44px; border: 0; border-radius: 0; background: transparent; color: var(--muted); }
.matrix-toggle:has(input:checked) { background: transparent; }
@media (max-width: 800px) {
  .statistics-filter-shell .stats-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding: 10px; }
  .stats-controls .control-field { min-width: 0; }
  .stats-controls .control-field:first-child { grid-column: 1; grid-row: 1; }
  .stats-controls .tier-field { grid-column: 2; grid-row: 1; min-width: 0; }
  .stats-controls .control-field:nth-child(2) { grid-column: 1; grid-row: 2; }
  .stats-controls .control-field:nth-child(3) { grid-column: 2; grid-row: 2; }
  .stats-controls .tier-switch { padding: 2px; }
  .stats-controls .tier-switch button { min-width: 0; padding: 0; font-size: 11px; min-height: 38px; }
  .stats-controls select, .stats-controls #dateSelect { height: 44px; font-size: 13px; padding-left: 7px; }
  .stats-shell .results-heading { gap: 4px 12px; }
  .matrix-toggle { font-size: 11px; margin-left: auto; }
  .matrix-switch { width: 24px; height: 14px; }
  .matrix-switch::after { width: 8px; height: 8px; }
  .matrix-toggle input:checked + .matrix-switch::after { transform: translateX(10px); }
}

.mobile-power-cards, .mobile-power-toolbar { display: none; }
@media (max-width: 1000px) {
  #results { border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; }
  #results > .table-scroll { display: none; }
  .mobile-power-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
  .mobile-power-toolbar label { display: flex; align-items: center; gap: 8px; }
  .mobile-power-toolbar select { width: auto; font-size: 12px; }
  .mobile-power-toolbar button { font-size: 12px; box-shadow: none; }
  .mobile-power-cards { display: grid; gap: 12px; }
  .mobile-power-card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-solid); padding: 14px; box-shadow: var(--shadow-sm); }
  .mobile-power-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
  .mobile-power-card header strong { display: flex; align-items: center; gap: 8px; font-size: 16px; }
  .mobile-power-card header small { font-size: 11px; padding: 2px 6px; background: var(--soft); border-radius: 4px; color: var(--muted); }
  .mobile-power-card header div > span { font-size: 11px; color: var(--muted); }
  .sample-badge { font-size: 11px; color: var(--muted); padding: 3px 7px; background: var(--soft); border-radius: 5px; }
  .mobile-average { padding: 16px 0; display: flex; justify-content: space-between; align-items: baseline; }
  .mobile-average > span, .mobile-power-metrics span, .mobile-tier-grid span { color: var(--muted); font-size: 12px; }
  .mobile-average strong { font-size: 28px; color: var(--power-num); font-variant-numeric: tabular-nums; line-height: 1.2; }
  .mobile-power-metrics { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-cool); border-radius: 8px; padding: 10px 12px; gap: 12px; }
  .mobile-power-metrics strong, .mobile-tier-grid strong { display: block; margin-top: 3px; font-size: 17px; font-variant-numeric: tabular-nums; }
  .mobile-power-card footer { margin-top: 10px; font-size: 11px; color: var(--muted); }
  .mobile-tier-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px 0 4px; }
  .mobile-tier-grid small { color: var(--muted); font-size: 11px; }
}

/* Keep the view switch anchored when the matrix summary grows. */
#powerHeading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px 12px; }
#powerHeading > div { min-width: 0; }
#powerHeading .matrix-toggle { margin-left: 0; align-self: start; }
#powerHeading #resultSummary { overflow-wrap: anywhere; }

/* Both desktop views share the same table rhythm to avoid vertical jumps. */
@media (min-width: 601px) {
  #results > .table-scroll > table > thead > tr { height: 64px; }
  #results > .table-scroll > table > tbody > tr:not(.section-label) { height: 100px; }
}

@media (max-width: 1000px) {
  .mobile-tier-grid { display: grid; grid-template-columns: 1fr; gap: 3px; padding: 12px 0 0; }
  .mobile-tier-row { display: grid; grid-template-columns: 58px minmax(24px,1fr) 82px; gap: 12px; align-items: center; padding: 10px 8px; border-radius: 7px; }
  .mobile-tier-row.is-selected { background: var(--accent-soft); }
  .mobile-tier-row.is-selected .mobile-tier-label { color: var(--accent); font-weight: 700; }
  .mobile-tier-bar { height: 7px; border-radius: 4px; background: var(--soft); overflow: hidden; }
  .mobile-tier-bar i { display: block; height: 100%; border-radius: inherit; background: var(--line-strong); }
  .mobile-tier-row.is-selected .mobile-tier-bar i { background: var(--accent); }
  .mobile-tier-value { text-align: right; }
  .mobile-tier-grid .mobile-tier-value strong { font-size: 16px; margin: 0; color: var(--power-num); }
  .mobile-tier-caption { margin: 8px 8px 0; font-size: 11px; color: var(--muted); }
}

/* Statistics uses the shared ranking drawer surface and motion. */
#guildDrawer.change-dialog { border-left: 1px solid var(--detail-line); background: var(--panel-solid); color: var(--text); box-shadow: var(--shadow-float); overflow: hidden; }
#guildDrawer > .guild-drawer { position: static; width: 100%; height: 100%; max-width: none; border: 0; border-radius: inherit; }
#guildDrawer .guild-drawer header { padding: 24px 24px 20px; align-items: flex-start; border-color: var(--detail-line); }
#guildDrawer .guild-drawer header h2 { font-size: 21px; line-height: 1.35; letter-spacing: -.3px; }
#guildDrawer .guild-drawer-controls { padding: 20px 24px 0; }
#guildDrawer .guild-drawer-note { padding: 0 24px; line-height: 1.6; }
#guildDrawer .guild-drawer-body { margin: 0 24px 20px; border: 1px solid var(--detail-line); border-radius: 12px; background: var(--detail-surface); }
#guildDrawer #closeGuildDrawer { width: 36px; height: 36px; min-height: 36px; flex: none; padding: 8px; border: 0; border-radius: 8px; background: transparent; box-shadow: none; color: var(--muted); }
#guildDrawer #closeGuildDrawer:hover { background: var(--detail-hover); color: var(--text); }
#guildDrawer #closeGuildDrawer svg { width: 20px; height: 20px; }
#guildDrawer::backdrop { background: rgb(5 10 16 / 38%); backdrop-filter: blur(3px); }

/* Match the full-width navigation breakpoint with the toolbar layout. */
@media (max-width: 1100px) {
  .app-shell .topbar { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 12px; }
  .app-shell .topbar .title-cluster { grid-column: 1; grid-row: 1; }
  .app-shell .topbar .toolbar-actions { grid-column: 2; grid-row: 1; }
  .app-shell .topbar .mode-tabs { grid-column: 1 / -1; grid-row: 2; width: 100%; min-width: 0; box-sizing: border-box; }
}

#guildDrawer #closeGuildDrawer { display: inline-flex; align-items: center; justify-content: center; gap: 4px; width: auto; padding: 0 9px; white-space: nowrap; font-size: 12px; }
#guildDrawer .guild-drawer header .guild-dismiss-hint { margin-top: 8px; font-size: 11px; color: var(--muted); font-weight: 400; }

@media (min-width: 601px) {
  .guild-expand::after, .guild-expand[aria-expanded="true"]::after { transform: rotate(-45deg); }
}

/* Keep the detail action on the title row; concentration has its own row. */
.guild-server-heading { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 6px 12px; align-items: center; }
.guild-server-heading > strong { grid-column: 1; grid-row: 1; }
.guild-server-heading > span:first-of-type { grid-column: 2; grid-row: 1; }
.guild-server-heading > span:nth-of-type(2) { grid-column: 1 / -1; grid-row: 2; }
.guild-server-heading > .guild-expand { grid-column: 3; grid-row: 1; margin-left: 0; white-space: nowrap; }
@media (max-width: 380px) {
  .guild-server-heading { grid-template-columns: minmax(0,1fr) auto; gap: 4px 8px; }
  .guild-server-heading > strong { grid-column: 1; grid-row: 1; }
  .guild-server-heading > span:first-of-type { grid-column: 1; grid-row: 2; }
  .guild-server-heading > .guild-expand { grid-column: 2; grid-row: 1 / 3; padding-inline: 10px; }
  .guild-server-heading > span:nth-of-type(2) { grid-row: 3; }
}

/* Pointer-only dismissal cue, stationary outside the reading surface. */
#guildDrawer.change-dialog { overflow: visible; }
#guildDrawer > .guild-drawer { overflow: hidden; }
#guildDrawer > .guild-dismiss-hint {
  position: absolute; top: 50%; right: calc(100% + 24px); transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: max-content; margin: 0; padding: 0; border: 0; background: none;
  color: rgb(255 255 255 / 62%); font-size: 11px; font-weight: 400; line-height: 1.4;
  letter-spacing: .02em; pointer-events: none; visibility: hidden;
}
#guildDrawer > .guild-dismiss-hint span { opacity: .45; }
#guildDrawer > .guild-dismiss-hint kbd { padding: 0; border: 0; color: inherit; font: inherit; }
#guildDrawer[open]:not(.is-closing) > .guild-dismiss-hint { visibility: visible; }
@media (max-width: 800px) { #guildDrawer > .guild-dismiss-hint { display: none; } }

/* A quiet, persistent cue shared by ranking and analysis drawers. */
.detail-dismiss-hint { display: none; }
.detail-mobile-footer { display: none; }
.guild-drawer .analysis-detail-footer { display: none; }
@media (max-width: 780px) {
  .change-dialog.is-drawer:not(.share-card) .detail-mobile-footer {
    display: flex; justify-content: center; flex: 0 0 auto;
    padding: 4px 16px max(4px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line); background: var(--panel-solid);
  }
  .detail-mobile-footer > button {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    width: min(100%, 320px); min-height: 44px; border-radius: 10px;
    color: var(--accent); background: var(--soft); border: 0; box-shadow: none;
    font-size: 14px;
  }
  .detail-mobile-footer > button svg { width: 20px; height: 20px; }
  /* The footer owns the safe area; do not reserve it again above the buttons. */
  #changeDialog.is-drawer:not(.share-card) .change-dialog-body {
    padding-bottom: 0;
  }
  #changeDialog.is-drawer:not(.share-card) .archive-action-bar.is-sticky-bottom {
    padding: 6px 16px;
    margin-bottom: 0;
    box-shadow: none;
  }
  #changeDialog.is-drawer:not(.share-card) .player-archive-section {
    overflow: visible;
  }
  #changeDialog.is-drawer:not(.share-card) .archive-action-bar.is-sticky-bottom .premium-btn {
    min-height: 44px;
    padding-block: 8px;
  }
}
.detail-dismiss-hint, #guildDrawer > .guild-dismiss-hint {
  user-select: none; -webkit-user-select: none; cursor: default;
}
@keyframes dismiss-cue-breathe { 0%, 100% { opacity: .72; } 50% { opacity: 1; } }
@media (min-width: 801px) {
  #changeDialog.is-drawer:not(.is-expanded):not(.is-pinned):not(.share-card) { overflow: visible; }
  #changeDialog.is-drawer[open]:not(.is-expanded):not(.is-pinned):not(.is-closing):not(.share-card) > .detail-dismiss-hint,
  #guildDrawer[open]:not(.is-closing) > .guild-dismiss-hint {
    position: absolute; top: 50%; right: calc(100% + 24px); transform: translateY(-50%);
    display: flex; align-items: center; gap: 7px; width: max-content;
    margin: 0; padding: 0; color: rgb(255 255 255 / 62%);
    font-size: 11px; font-weight: 400; line-height: 1.4;
    pointer-events: none; animation: dismiss-cue-breathe 2.5s ease-in-out infinite;
  }
  .detail-dismiss-hint span { opacity: .45; }
  .detail-dismiss-hint kbd { font: inherit; color: inherit; padding: 0; border: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .detail-dismiss-hint, #guildDrawer > .guild-dismiss-hint { animation: none !important; }
}
:root[data-motion="quiet"] .detail-dismiss-hint,
:root[data-motion="quiet"] #guildDrawer > .guild-dismiss-hint { animation: none !important; }

/* One statistics toolbar: content selection above the shared filters. */
.statistics-filter-shell { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-solid); box-shadow: var(--shadow); overflow: hidden; }
.statistics-filter-shell > .stats-controls { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
@media (max-width: 800px) {
}

.mode-tabs { grid-template-columns: repeat(5,minmax(0,1fr)); }
body.analysis-mode .app-shell > .filter-shell, body.analysis-mode .ranking-panel, body.analysis-mode .pager, body.analysis-mode .page-timeline { display:none!important; }
.analysis-tabs { display:flex;gap:6px;margin:8px 0 12px;padding:5px;border:1px solid var(--line);border-radius:10px;background:var(--panel-solid); }
.analysis-tabs button { flex:1;box-shadow:none;border:0;background:transparent;color:var(--muted); }
.analysis-tabs button[aria-pressed="true"] { background:var(--accent);color:var(--panel-solid); }
#analysisHost { min-width:0; }

.analysis-tabs { position: sticky; top: 8px; z-index: 21; margin-bottom: 0; border-radius: 12px 12px 0 0; border-bottom: 0; }

#analysisHost .statistics-filter-shell { border-radius: 0 0 12px 12px; }
.server-field-heading { display:flex;align-items:center;justify-content:space-between;gap:8px; }
.server-field-heading button { min-height:0;padding:0;border:0;background:none;box-shadow:none;font-size:11px;color:var(--accent); }
@media(max-width:800px) { .statistics-filter-shell { top: var(--analysis-tabs-height,0px); } }

#analysisLoadingCover { position:fixed;bottom:0;z-index:20;background:var(--bg);display:flex;align-items:flex-start;justify-content:center;gap:12px;padding-top:72px;color:var(--muted);font-size:13px; }
#analysisLoadingCover .spinner { width:18px;height:18px; }

/* Continuous opaque sticky surfaces: no content peeks through a top gap. */
.app-shell > .filter-shell { top: 0; background: var(--panel-solid); border-top-left-radius: 0; border-top-right-radius: 0; }
.analysis-tabs { top: 0; background: var(--panel-solid); border-radius: 0; box-shadow: none; }
body.analysis-section .app-shell > .filter-shell { top: var(--analysis-tabs-height,47px); }
.statistics-filter-shell { position: sticky; top: var(--analysis-tabs-height,47px); z-index: 18; background: var(--panel-solid); border-top-left-radius: 0; border-top-right-radius: 0; }
@media (max-width: 720px) {
  .statistics-filter-shell { top: calc(var(--mobile-toolbar-height, 0px) + var(--analysis-tabs-height, 47px)); }
}

.analysis-tabs { padding:8px;gap:8px;background:var(--toolbar-surface); }
.analysis-tabs button { flex:1 1 0;min-width:0;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:42px;padding:8px 18px;border:1px solid var(--line-strong);border-radius:8px;background:var(--panel-solid);color:var(--text-secondary);box-shadow:var(--shadow-sm);cursor:pointer;font-size:14px; }
.analysis-tabs button svg { width:17px;height:17px;flex:none; }
.analysis-tabs button:hover { background:var(--accent-soft);border-color:var(--accent);color:var(--accent); }
.analysis-tabs button[aria-pressed="true"] { background:var(--accent);border-color:var(--accent);color:var(--panel-solid);box-shadow:inset 0 1px 0 rgb(255 255 255 / 12%); }
.analysis-tabs button:focus-visible { outline:2px solid var(--accent);outline-offset:2px; }
@media(max-width:600px) { .analysis-tabs { gap:6px;padding:6px; } .analysis-tabs button { flex:1;min-width:0;gap:5px;padding:8px 4px;font-size:12px; } .analysis-tabs button svg { width:15px;height:15px; } }

/* Shared controls retain the original filter palette. */
.app-shell > .filter-shell #rankingFilters input,
.app-shell > .filter-shell #rankingFilters select,
.stats-controls input,
.stats-controls select {
  border-color: var(--line-strong);
  border-radius: 8px;
  background: var(--panel-solid);
  box-shadow: none;
  transition: border-color 120ms ease, background-color 120ms ease;
}
.app-shell > .filter-shell #rankingFilters input:focus,
.app-shell > .filter-shell #rankingFilters select:focus,
.stats-controls input:focus,
.stats-controls select:focus {
  border-color: var(--accent);
  outline: 2px solid var(--accent-soft);
  outline-offset: 1px;
  background: var(--panel-solid);
}
.filter-shell #saveChangeServer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-solid);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgb(16 45 38 / 5%);
  cursor: pointer;
}
.filter-shell #saveChangeServer:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.filter-shell #saveChangeServer:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.filter-shell #saveChangeServer:active { background: var(--accent-soft); box-shadow: none; }
@media (max-width: 780px) {
  .app-shell > .filter-shell { padding: 8px 12px 12px; }
  .app-shell > .filter-shell.is-mobile-collapsed { padding-bottom: 8px; }
  .filter-shell .mobile-filter-toggle { border-radius: 0; background: transparent; }
  .filter-shell .mobile-filter-toggle[aria-expanded="true"] { border-bottom-color: var(--line); }
  .filter-shell #rankingFilters { gap: 14px 12px; padding: 14px 0 0; }
  .filter-shell #rankingFilters > label,
  .filter-shell #rankingFilters > .filter-field { gap: 7px; font-weight: 500; }
  .filter-shell #rankingFilters input,
  .filter-shell #rankingFilters select { height: 42px; min-height: 42px; padding-inline: 11px; }
  .filter-shell #changeRangeQuick { gap: 7px 10px; }
  .filter-shell #rankingFilters #saveChangeServer { height: 42px; min-height: 42px; }
  .filter-shell #changeServerPreference { font-size: 11px; line-height: 1.5; }
}

/* Consistent filter typography in the ranking shell and analysis component. */
.filter-shell #rankingFilters,
.statistics-filter-shell {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.filter-shell #rankingFilters > label,
.filter-shell #rankingFilters > .filter-field,
.filter-shell #rankingFilters .guild-filter-field > label,
.stats-controls .control-field,
.stats-controls legend { font-size: 12px; font-weight: 600; color: var(--muted); }
.filter-shell #rankingFilters input,
.filter-shell #rankingFilters select,
.stats-controls select,
.stats-controls #dateSelect { font-family: inherit; font-size: 14px; font-weight: 600; color: var(--text); }
.filter-shell #rankingFilters input::-webkit-datetime-edit { font-weight: 600; }
.filter-shell #rankingFilters input::placeholder { font-size: 13px; font-weight: 400; color: var(--muted); }
@media (max-width: 800px) {
  .filter-shell .mobile-filter-copy { display: block; }
  .filter-shell .mobile-filter-copy > span { display: block; font-size: 11px; line-height: 1.4; color: var(--muted); font-weight: 400; }
  .filter-shell .mobile-filter-copy strong,
  .statistics-filter-toggle strong { font-size: 13px; font-weight: 700; line-height: 1.6; color: var(--text); }
  .filter-shell .mobile-filter-toggle,
  .statistics-filter-toggle { min-height: 56px; }
  .filter-shell #rankingFilters #filterResetField { top: -49px; }
  .filter-shell #rankingFilters input,
  .filter-shell #rankingFilters select,
  .stats-controls select,
  .stats-controls #dateSelect { font-size: 14px; height: 44px; min-height: 44px; }
}

/* Compact white filter surfaces, shared with the analysis controls. */
:root:not([data-theme="dark"]) .app-shell > .filter-shell {
  background: var(--panel-solid);
}
.statistics-filter-shell { background: var(--panel-solid); }
@media (max-width: 800px) {
  .app-shell > .filter-shell { padding: 6px 10px 10px; }
  .filter-shell .mobile-filter-toggle,
  .statistics-filter-toggle { min-height: 48px; padding-block: 5px; }
  .filter-shell #rankingFilters { gap: 10px; padding-top: 10px; }
  .filter-shell #rankingFilters > label,
  .filter-shell #rankingFilters > .filter-field { gap: 5px; }
  .filter-shell #rankingFilters input,
  .filter-shell #rankingFilters input[type="date"],
  .filter-shell #rankingFilters select,
  .filter-shell #rankingFilters #saveChangeServer,
  .stats-controls select,
  .stats-controls #dateSelect { height: 38px; min-height: 38px; }
  .filter-shell #rankingFilters .guild-filter-toggle { height: 38px; min-height: 38px; }
  .filter-shell #rankingFilters #filterResetField { top: -43px; }
  .statistics-filter-shell .stats-controls { gap: 10px; padding: 10px; }
  .stats-controls .tier-switch button { min-height: 32px; }
}

/* Desktop captions stay collapsed regardless of sticky state or viewport resizing. */
@media (min-width: 801px) {
  .filter-shell #rankingFilters { align-items: end; }
  .filter-shell #rankingFilters > label { font-size: 0; gap: 0; }
  .filter-shell #rankingFilters > .filter-field { gap: 0; }
  .filter-shell #rankingFilters .filter-caption,
  .filter-shell #rankingFilters .guild-filter-field > label { display: none; }
  .filter-shell #rankingFilters input,
  .filter-shell #rankingFilters select,
  .filter-shell #rankingFilters .guild-filter-toggle,
  .filter-shell #rankingFilters #filterResetBtn {
    height: 32px; min-height: 32px; font-size: 14px;
  }
}

@media (max-width: 800px) {
  .filter-shell.is-compact #rankingFilters .filter-caption,
  .filter-shell.is-compact #rankingFilters .guild-filter-field > label { display: block; }
  .filter-shell.is-compact #rankingFilters > label { font-size: 12px; gap: 5px; }
}

.mobile-quick-search { display: none; }
@media (max-width: 800px) {
  .mobile-quick-search { display: flex; align-items: center; gap: 8px; margin: 4px 0 6px; padding: 4px 4px 4px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel-solid); }
  .mobile-quick-search > svg { width: 18px; height: 18px; flex: none; color: var(--accent); }
  .filter-shell .mobile-quick-search > .search-field { display: block; flex: 1; min-width: 0; margin: 0; font-size: 0; }
  .filter-shell .mobile-quick-search #searchInput { width: 100%; height: 34px; min-height: 34px; padding: 0 4px; border: 0; background: transparent; box-shadow: none; font-size: 14px; font-weight: 400; }
  .mobile-quick-search > button { min-height: 34px; padding: 5px 12px; border: 0; border-radius: 5px; background: var(--accent); color: var(--panel-solid); font-size: 13px; box-shadow: none; }
  .filter-shell #rankingFilters .guild-filter-field { grid-column: 1 / -1; }
}

@media (max-width: 800px) {
  .filter-shell .mobile-quick-search > .search-field { order: 0; }
  .mobile-quick-search > button { order: 1; display: grid; place-items: center; width: 36px; padding: 6px; background: transparent; color: var(--accent); }
  .mobile-quick-search > button svg { width: 18px; height: 18px; }
  .mobile-quick-search > button:hover { background: var(--accent-soft); }
  .app-shell > .pager { padding: 4px; gap: 2px; border-radius: 12px; }
  .app-shell > .pager .pager-arrow { width: 38px; min-width: 38px; height: 38px; min-height: 38px; flex-basis: 38px; border-radius: 8px; }
  .app-shell > .pager .page-jump { min-width: 108px; gap: 3px; padding-inline: 3px; font-size: 12px; }
  .app-shell > .pager .page-jump input { width: 36px; height: 36px; min-height: 36px; font-size: 14px; }
}

/* Desktop search remains in the filter grid, with a distinct search affordance. */
@media (min-width: 801px) {
  .filter-shell #rankingFilters > .search-field { position: relative; color: var(--accent); }
  .filter-shell #rankingFilters > .search-field::after {
    content: ""; position: absolute; left: 11px; bottom: 10px;
    width: 16px; height: 16px; background: var(--accent); pointer-events: none;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m16 16 4 4'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  .app-shell > .filter-shell #rankingFilters #searchInput {
    padding-left: 34px; border-color: var(--accent); background: var(--panel-solid);
  }
  .filter-shell #rankingFilters #searchInput::placeholder { color: var(--muted); }
  .filter-shell.is-compact #rankingFilters > .search-field::after { bottom: 8px; }
}

/* Keep the floating filter edge light over the list. */
:root .app-shell > .filter-shell,
.statistics-filter-shell { box-shadow: 0 2px 6px rgb(16 45 38 / 6%); }

/* Tabs and selected filters already identify the view; keep only its summary. */
.stats-accessible-title { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.stats-shell #powerHeading { align-items: center; margin-top: 10px; margin-bottom: 10px; }
#powerHeading #resultSummary { margin: 0; }
#powerHeading .matrix-toggle { min-height: 32px; align-self: center; }
#guildSection > .results-heading { margin: 12px 0; }
#guildSection > .results-heading .intro { margin: 0; font-size: 12px; }

/* Hide the entire outgoing section while switching primary views. */
body.main-view-transition #analysisTabs { visibility: hidden; pointer-events: none; }
body.main-view-transition .page-timeline { display: none !important; }
#analysisLoadingCover { z-index: 30; }

/* Native iOS date controls must not impose their intrinsic width on the grid. */
.stats-controls #dateSelect { width: 100%; min-width: 0; max-width: 100%; -webkit-appearance: none; appearance: none; }
.stats-controls #dateSelect::-webkit-date-and-time-value { text-align: left; min-width: 0; }
@media (max-width: 480px) {
  .stats-controls .control-field:first-child { grid-column: 1 / -1; grid-row: 1; }
  .stats-controls .tier-field { grid-column: 1 / -1; grid-row: 2; }
  .stats-controls .control-field:nth-child(2),
  .stats-controls .control-field:nth-child(3) { grid-row: 3; }
}
/* Keep native focus from magnifying small text fields; retain pinch zoom. */
@media (max-width: 800px), (pointer: coarse) {
  .app-shell input, .app-shell select, .app-shell textarea,
  .filter-shell #rankingFilters input, .filter-shell #rankingFilters select,
  .filter-shell .mobile-quick-search #searchInput,
  .app-shell > .pager .page-jump input,
  .stats-controls input, .stats-controls select, .stats-controls #dateSelect {
    font-size: 16px;
  }
}

/* Keep desktop selects in the page compositor instead of an OS popup.
   Mobile and engines without base-select retain their native picker. */
@supports (appearance: base-select) {
  @media (min-width: 801px) and (pointer: fine) {
    select, select::picker(select) {
      appearance: base-select;
      background: var(--panel-solid);
      color: var(--text);
      transition: none;
      animation: none;
    }
    select:not([hidden]):not(.change-range-mobile-select) {
      display: inline-flex;
      align-items: center;
    }
    select::picker(select) {
      border: 1px solid var(--line-strong);
      border-radius: 8px;
      padding: 4px;
      max-height: min(320px, 60vh);
      overflow-y: auto;
      box-shadow: var(--shadow-float);
    }
    select::picker-icon { color: var(--muted); }
    select option {
      min-height: 32px;
      padding: 6px 10px;
      border-radius: 4px;
      font: inherit;
      background: var(--panel-solid);
      color: var(--text);
    }
    select option:hover, select option:focus-visible, select option:checked {
      background: var(--soft);
      color: var(--accent-strong);
    }
    select::picker(select)::backdrop { background: transparent; }
  }
}

/* Date shortcuts are buttons on desktop and a single select on phones. */
@media (min-width: 801px) {
  .filter-shell #changeRangeMobileSelect { display: none; }
  .filter-shell #changeRangeQuick { flex-wrap: wrap; gap: 8px 12px; }
  .filter-shell #changeServerPreference { white-space: nowrap; font-weight: 400; }
  .filter-shell #changeRangeQuick .change-range-buttons {
    flex-wrap: wrap;
    gap: 6px;
  }
  .filter-shell #changeRangeQuick button {
    flex-shrink: 0;
    white-space: nowrap;
    height: 32px;
    min-height: 32px;
  }
}

/* A stable keyboard-sized picker on touch layouts. */
body:has(#mobileGuildPicker[open]) { overflow: hidden; }
#mobileGuildPicker {
  position: fixed; inset: 0 auto auto 0; margin: 0; padding: 16px;
  width: 100%; max-width: none; max-height: none; box-sizing: border-box;
  border: 0; border-radius: 0; background: var(--panel-solid); color: var(--text);
  overflow: hidden;
}
#mobileGuildPicker[open] { display: flex; flex-direction: column; gap: 12px; }
#mobileGuildPicker header { display: flex; justify-content: space-between; align-items: center; flex: none; }
#mobileGuildPicker header button { min-height: 40px; padding: 6px 14px; }
#mobileGuildPicker > input { width: 100%; min-height: 44px; font-size: 16px; flex: none; }
#mobileGuildPicker .guild-filter-option-list {
  position: static; inset: auto; width: 100%; max-width: none; max-height: none;
  min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain;
  border: 0; box-shadow: none; margin: 0; padding: 0;
}
#mobileGuildPicker .guild-filter-option { min-height: 44px; font-size: 14px; }

/* Brand artwork has its own background; do not inherit the former red seal. */
:root .topbar .title-cluster .brand-mark { display: block; padding: 0; border: 0; border-radius: 10px; background: transparent; box-shadow: none; transform: none; object-fit: contain; }

/* Outlined wordmark renders identically without depending on installed fonts. */
.brand-heading { display: flex; align-items: center; }
@media (max-width: 800px) {
  .filter-shell .mobile-filter-toggle { padding-right: 90px; border-radius: 8px; }
  .filter-shell .mobile-filter-toggle[aria-expanded="true"] {
    background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--line-strong);
    border-bottom-color: transparent;
  }
  .filter-shell .mobile-filter-toggle[aria-expanded="true"] .mobile-filter-copy > span {
    color: var(--accent);
  }
  .filter-shell .mobile-filter-toggle .mobile-filter-chevron { display: none; }
  .filter-shell .mobile-filter-toggle::after {
    content: '展开筛选'; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    display: grid; place-items: center; min-width: 76px; min-height: 44px;
    border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--muted);
  }
  .filter-shell .mobile-filter-toggle[aria-expanded="true"]::after {
    content: '收起筛选'; color: var(--accent);
  }
  .filter-shell #rankingFilters #filterResetField {
    position: static; inset: auto; grid-column: 1 / -1; grid-row: auto;
    width: auto; justify-self: end; order: 20;
  }
  .filter-shell #rankingFilters #filterResetBtn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    width: auto; height: 44px; min-height: 44px; padding: 0 10px;
    color: var(--muted); background: transparent; border: 0; box-shadow: none;
  }
  .filter-shell #filterResetBtn::after { content: '清除筛选'; font-size: 12px; }
}
@media (max-width: 800px) {
  .topbar .title-cluster .snapshot-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0 4px;
  }
  .topbar .snapshot-line #snapshotMeta { grid-column: 1; grid-row: 1; max-width: none; margin: 0; }
  .topbar .snapshot-line #qualityWarningBtn { grid-column: 2; grid-row: 1; flex-shrink: 0; }
  .topbar .snapshot-line #freshnessNotice { grid-column: 1 / -1; grid-row: 2; }
}
.topbar .brand-heading h1 { margin: 0; line-height: 1; }
.statistics-thumb-dock { display: none; }
.statistics-thumb-sheet:not([open]) { display: none; }
@media (max-width: 720px) {
  .statistics-filter-shell.has-thumb-filters { display: none; }
  .stats-shell.has-thumb-filters { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .statistics-thumb-dock:not([hidden]) {
    display: block; position: fixed; z-index: 35; left: 8px; right: 8px; bottom: 0;
    border: 1px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0;
    background: color-mix(in srgb,var(--accent) 2%,var(--panel-solid));
    box-shadow: 0 -4px 18px #173c3010; padding-bottom: env(safe-area-inset-bottom);
  }
  .statistics-thumb-dock > button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 6px 16px; border: 0; border-radius: 20px 20px 0 0; background: var(--accent-soft); color: var(--accent); box-shadow: none; text-align: left; }
  .statistics-thumb-dock svg { width: 20px; height: 20px; flex: none; }
  .statistics-thumb-dock button > span:nth-child(2) { flex: 1; min-width: 0; }
  .statistics-thumb-dock strong { display: block; font-size: 13px; }
  .statistics-thumb-dock small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
  .statistics-thumb-sheet { position: fixed; inset: auto 0 0; margin: 0; width: 100%; max-width: none; max-height: 77dvh; padding: 6px 14px calc(10px + env(safe-area-inset-bottom)); border: 1px solid var(--line); border-radius: 20px 20px 0 0; background: var(--surface-raised, var(--panel-solid)); color: var(--text); overflow-y: auto; overscroll-behavior: contain; }
  .statistics-thumb-sheet::backdrop { background: #10251d66; }
  .statistics-thumb-sheet > header { display: flex; position: relative; align-items: center; justify-content: space-between; height: 32px; min-height: 32px; margin-bottom: 6px; gap: 12px; touch-action: none; }
  .statistics-thumb-sheet > header strong { font-size: 13px; font-weight: 600; color: var(--muted); }
  .statistics-thumb-sheet header button { position: relative; width: 44px; min-width: 44px; height: 36px; min-height: 36px; padding: 4px; border: 0; border-radius: 10px; background: transparent; box-shadow: none; color: var(--accent); font-size: 24px; touch-action: manipulation; }
  .statistics-thumb-sheet header button::before { content: ''; position: absolute; inset: -4px 0; }
  .statistics-thumb-sheet .stats-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 0; border: 0; border-radius: 0; margin: 0; box-shadow: none; }
  .statistics-thumb-sheet .stats-controls > * { min-width: 0; grid-column: auto; grid-row: auto; }
  .statistics-thumb-sheet .stats-controls .tier-field { grid-column: 1 / -1; }
  .statistics-thumb-sheet input, .statistics-thumb-sheet select { width: 100%; min-width: 0; font-size: 16px; }
  .statistics-thumb-sheet #dateSelect { font-size: 16px; }
  .statistics-thumb-sheet .tier-switch { display: flex; gap: 4px; }
  .statistics-thumb-sheet .tier-switch button { flex: 1; min-height: 44px; }
  .statistics-thumb-sheet .statistics-thumb-done { width: 100%; min-height: 44px; margin-top: 8px; border: 0; border-radius: 12px; background: var(--accent-fill); color: var(--on-accent); }
}
.statistics-summary-filter { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 6px; min-height: 36px; min-width: 0; padding: 0; border: 0; appearance: none; background: transparent; box-shadow: none; transition: none; text-align: left; color: var(--text-secondary); }
.statistics-filter-hint { color: var(--accent); font-size: 11px; white-space: nowrap; }
.statistics-thumb-dock small { display: flex; gap: 4px; }
.statistics-dock-scope { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.statistics-dock-tier { flex: none; white-space: nowrap; }
.brand-wordmark { display: block; width: 112px; height: 41px; }
:root .topbar .title-cluster .brand-mark { width: 36px; height: 36px; flex-basis: 36px; border-radius: 0; }
:root[data-theme="dark"] .brand-wordmark { content: url("/_assets/4ebdbcd21a244e54ad03999b7c0385b511370d6102c7cd41a07248b04ec19b49/xingxingcha-wordmark-dark.svg"); }
@media (max-width: 600px) {
  .brand-wordmark { width: 104px; height: 38px; }
}

/* Desktop: return the page navigation on upward scroll without moving the list. */
@media (min-width: 801px) {
  body { --desktop-toolbar-offset: 0px; }
  body.desktop-toolbar-visible { --desktop-toolbar-offset: var(--desktop-toolbar-height, 84px); }
  .sticky-toolbar {
    position: sticky;
    top: calc(-1 * var(--desktop-toolbar-height, 84px));
    z-index: 22;
    background: var(--bg);
  }
  body.desktop-toolbar-visible .sticky-toolbar { top: 0; }
  .app-shell > .filter-shell { top: var(--desktop-toolbar-offset); }
  .analysis-tabs { top: var(--desktop-toolbar-offset); }
  body.analysis-section .app-shell > .filter-shell,
  .statistics-filter-shell {
    top: calc(var(--desktop-toolbar-offset) + var(--analysis-tabs-height, 47px));
  }
}

/* Estimated intervals need room for both bounds, including in exported cards. */
.analysis-heading-actions { flex-wrap: wrap; }
.has-hidden-estimates .mobile-tier-row { grid-template-columns: 58px minmax(0,1fr) 132px; }
.has-hidden-estimates .mobile-tier-value strong { font-size: 12px; white-space: nowrap; }
.has-hidden-estimates .mobile-tier-value small { display: block; font-size: 10px; white-space: normal; }
.has-hidden-estimates .mobile-average strong { font-size: 20px; }
.has-hidden-estimates .power-number { font-size: 14px; }

/* Lightweight analysis toolbar: summary/share, then unboxed switches. */
.stats-shell #powerHeading,
#guildSection > .results-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: "summary options share";
  align-items: center; gap: 0 18px; margin: 8px 0 10px;
  padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
#powerHeading > div:first-child,
#guildSection > .results-heading > div:first-child { grid-area: summary; min-width: 0; }
#powerHeading > .analysis-heading-actions,
#guildSection > .results-heading > .analysis-heading-actions {
  grid-area: options; display: flex; align-items: center; flex-wrap: nowrap;
  justify-content: flex-start; gap: 18px; margin: 0; width: auto;
}
#powerHeading > .analysis-share,
#guildSection > .results-heading > .analysis-share { grid-area: share; justify-self: end; }
#powerHeading .matrix-toggle,
#guildSection > .results-heading .matrix-toggle {
  display: inline-flex; flex-direction: row; justify-content: flex-start;
  min-height: 44px; margin: 0; padding: 0; gap: 7px;
  border: 0; border-radius: 0; background: transparent; color: var(--muted); font-size: 12px;
}
#powerHeading .matrix-toggle.is-active,
#guildSection > .results-heading .matrix-toggle.is-active { background: transparent; color: var(--accent); }
#powerHeading > .mobile-power-toolbar { grid-area: sort; }
@media (max-width: 1000px) and (min-width: 721px) {
  .stats-shell #powerHeading { grid-template-areas: "summary options share" "sort sort sort"; }
}
@media (max-width: 720px) {
  .analysis-tabs { padding: 6px; gap: 6px; background: var(--bg); border: 0; border-radius: 0; margin-top: 8px; }
  .analysis-tabs button { min-height: 40px; padding: 7px 4px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--panel-solid); box-shadow: none; font-size: 12px; font-weight: 500; }
  .analysis-tabs button[aria-pressed="true"] { box-shadow: none; }
  .stats-shell #powerHeading,
  #guildSection > .results-heading {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "summary share" "options options" "sort sort";
    gap: 0 8px; padding: 0; margin: 6px 0 10px;
  }
  #powerHeading #resultSummary { font-size: 12px; line-height: 1.5; white-space: nowrap; }
  #powerHeading .statistics-summary-line { gap: 2px; }
  #powerHeading .metric-help-button { min-height: 40px; height: 40px; width: 24px; padding: 0; flex: none; }
  .results-heading > .analysis-share .analysis-share-toggle { min-height: 40px; padding: 0 2px; font-size: 12px; }
  #powerHeading > .mobile-power-toolbar { margin: 0; gap: 8px; border-top: 1px solid var(--line); padding-top: 5px; }
  #powerHeading > .mobile-power-toolbar label { flex: 0 1 auto; min-width: 0; gap: 8px; }
  #powerHeading > .mobile-power-toolbar select { flex: none; width: auto; max-width: 150px; min-height: 40px; padding: 0 22px 0 4px; border: 0; background-color: transparent; box-shadow: none; }
  #powerHeading > .mobile-power-toolbar button { min-height: 44px; padding: 0 2px; border: 0; background: transparent; box-shadow: none; }
  .stats-shell #qualityNotice { padding: 7px 10px; margin: 8px 0; font-size: 12px; border: 0; border-radius: 5px; }
  .mobile-power-card { box-shadow: none; }
}

/* Shared by analysis pages and the guild comparison picker. */
.analysis-share { position: relative; flex-shrink: 0; }
.analysis-share .analysis-share-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; box-shadow: none; font-size: 12px; color: var(--muted); }
.analysis-share .analysis-share-toggle:hover, .analysis-share .analysis-share-toggle[aria-expanded="true"] { color: var(--accent); background: var(--accent-soft); }
.analysis-share svg { width: 17px; height: 17px; flex: none; }
.analysis-share-choices { position: absolute; right: 0; top: calc(100% + 7px); z-index: 35; width: 252px; max-width: calc(100vw - 36px); padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-solid); box-shadow: var(--shadow-float); }
.analysis-share-caption { padding: 5px 10px 8px; font-size: 11px; color: var(--muted); }
.analysis-share-choices.opens-up { top: auto; bottom: calc(100% + 7px); }
.analysis-share-choices button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 10px; min-height: 62px; text-align: left; border: 0; border-radius: 10px; background: transparent; box-shadow: none; }
.analysis-share-choices button:hover, .analysis-share-choices button:focus-visible { background: var(--accent-soft); }
.analysis-share-choices svg { color: var(--accent); width: 20px; height: 20px; }
.analysis-share-choices strong { display: block; color: var(--text); font-size: 13px; font-weight: 600; }
.analysis-share-choices small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.analysis-share-status:not(:empty) { position: absolute; right: 0; top: calc(100% + 7px); width: 240px; max-width: calc(100vw - 36px); z-index: 34; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-float); background: var(--panel-solid); font-size: 12px; color: var(--text); }
.analysis-share-status:empty { display: none; }
.analysis-share-fallback { flex-basis: 100%; }
.analysis-share-fallback img { display: block; max-width: 100%; height: auto; margin-top: 10px; }
.analysis-share-fallback textarea { width: 100%; height: 80px; font-size: 16px; }
@media (max-width: 720px) {
  .analysis-share .analysis-share-toggle { min-height: 44px; padding: 0 6px; }
}

.thumb-dock, .thumb-meta { display: none; }
html[data-boot] .thumb-dock { display: none !important; }
.thumb-sheet:not([open]) { display: none; }
.filter-shortcut { display: none; }
@media (max-width: 720px) {
  :root[data-theme="dark"] body.thumb-mobile .thumb-dock .pager { background: transparent; box-shadow: none; }
}
@media (max-width: 720px) {
  body.thumb-mobile { overflow-anchor: none; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .thumb-mobile .sticky-toolbar { position: sticky; top: 0; z-index: 22; padding: 0; background: var(--panel-solid); }
  .thumb-mobile .analysis-tabs { top: var(--mobile-toolbar-height, 0px); }
  .thumb-mobile.analysis-section .app-shell > .filter-shell { top: calc(var(--mobile-toolbar-height, 0px) + var(--analysis-tabs-height, 47px)); }
  .thumb-mobile .change-overview { top: calc(var(--mobile-toolbar-height, 0px) + 4px); }
  .thumb-mobile .toolbar-card { padding: 4px 6px; border-radius: 0 0 10px 10px; }
  .thumb-mobile .topbar { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 0 6px; margin: 0; }
  .thumb-mobile .title-cluster { grid-column: 1; grid-row: 1; min-width: 0; padding-block: 3px; }
  .thumb-mobile .toolbar-actions { grid-column: 2; grid-row: 1; margin: 0; justify-self: end; }
  .thumb-mobile .mode-tabs { grid-column: 1 / -1; grid-row: 2; width: 100%; margin: 0; min-height: 40px; padding: 0; border: 0; border-radius: 0; background: transparent; }
  .thumb-mobile .mode-tab { min-height: 40px; border-radius: 6px; padding: 4px; }
  .thumb-mobile.thumb-immersed .title-cluster, .thumb-mobile.thumb-immersed .toolbar-actions { display: none; }
  .thumb-mobile > .thumb-dock { display: flex; position: fixed; z-index: 35; left: 0; right: 0; bottom: 0; align-items: center; gap: 2px; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); min-height: 56px; background: var(--panel-solid); border-top: 1px solid var(--line); box-shadow: 0 -3px 15px #00000008; }
  .thumb-dock button, .thumb-sheet header button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; padding: 4px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--accent); box-shadow: none; font-size: 12px; white-space: nowrap; }
  .thumb-dock svg, .thumb-sheet header svg { width: 20px; height: 20px; flex: none; }
  .thumb-dock .thumb-search-open { flex: none; }
  .thumb-dock .thumb-filter { flex: 0 1 112px; min-width: 80px; border-right: 1px solid var(--line); line-height: 1.4; }
  .thumb-filter > span:last-child { min-width: 0; }
  .thumb-filter small { display: block; max-width: 88px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; color: var(--muted); }
  .thumb-filter.is-filtered { background: var(--accent-soft); }
  .thumb-dock .pager { position: static; transform: none; flex: 1; width: auto; min-width: 0; max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; gap: 0; background: transparent; }
  .thumb-dock .pager .pager-arrow { flex: 0 0 32px; min-width: 32px; width: 32px; height: 44px; padding: 5px; }
  .thumb-dock .pager .page-jump { min-width: 0; padding: 0; gap: 0; font-size: 11px; }
  .thumb-dock .pager .page-jump input { width: 30px; min-height: 36px; padding: 0; font-size: 16px; }
  .thumb-dock .pager .page-prefix, .thumb-dock .pager .rank-jump, .thumb-dock .pager .page-size-control { display: none; }
  .thumb-dock .thumb-search { display: flex; flex: 1; align-items: center; min-width: 0; background: var(--accent-soft); border-radius: 8px; }
  .thumb-search .search-field { flex: 1; min-width: 0; font-size: 0; margin: 0; }
  .thumb-search #searchInput { width: 100%; min-width: 0; height: 44px; min-height: 44px; font-size: 16px; padding: 0 8px; border: 0; background: transparent; box-shadow: none; }
  .thumb-search #searchInput::-webkit-search-cancel-button { display: none; }
  .thumb-search > button { flex: 0 0 40px; padding: 5px; }
  .thumb-dock.is-searching > .pager, .thumb-dock.is-searching > .thumb-search-open { display: none; }
  .thumb-dock.is-filter-only > .pager, .thumb-dock.is-filter-only > .thumb-search-open, .thumb-dock.is-filter-only > .thumb-search { display: none; }
  .thumb-dock.is-filter-only .thumb-filter { flex: 1; border: 0; }
  .thumb-sheet { position: fixed; inset: auto 0 0; margin: 0; width: 100%; max-width: none; max-height: 85dvh; padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); border: 1px solid var(--line); border-radius: 20px 20px 0 0; background: var(--surface-raised, var(--panel-solid)); color: var(--text); overflow-y: auto; overscroll-behavior: contain; }
  .thumb-sheet::backdrop { background: #10251d66; }
  .thumb-sheet > header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
  .thumb-sheet .filter-shell { display: block !important; position: static; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  .thumb-sheet .mobile-filter-toggle, .thumb-sheet .mobile-quick-search, .thumb-sheet #filterSummary { display: none !important; }
  .thumb-sheet #rankingFilters { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .thumb-sheet #rankingFilters > * { grid-column: auto; grid-row: auto; min-width: 0; }
  .thumb-sheet #rankingFilters > label, .thumb-sheet #rankingFilters > .filter-field { display: flex; flex-direction: column; align-items: stretch; gap: 4px; font-size: 12px; }
  .thumb-sheet #rankingFilters input, .thumb-sheet #rankingFilters select { min-width: 0; width: 100%; height: 42px; min-height: 42px; font-size: 16px; }
  .thumb-sheet #rankingFilters #changeRangeQuick, .thumb-sheet #rankingFilters #filterResetField { grid-column: 1 / -1; }
  .thumb-sheet #filterResetBtn { position: static; height: 44px; }
  .thumb-sheet .thumb-done { width: 100%; min-height: 44px; margin-top: 12px; border: 0; border-radius: 8px; background: var(--accent); color: white; }
  .thumb-mobile #backTopBtn { bottom: calc(68px + env(safe-area-inset-bottom)); }
  .thumb-mobile { --sticky-filter-height: 44px !important; }
}

@media (max-width: 720px) {
  .thumb-mobile .topbar { column-gap: 4px; }
  .thumb-mobile .title-cluster { display: flex; gap: 4px; padding-block: 0; min-height: 44px; }
  .thumb-mobile .title-cluster .brand-mark { width: 21px; height: 21px; flex: 0 0 21px; }
  .thumb-mobile .title-cluster .brand-wordmark { width: 92px; height: 34px; }
  .thumb-mobile .title-cluster .snapshot-line { display: none; }
  .thumb-mobile .thumb-meta { display: block; margin-left: auto; min-width: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
  .thumb-mobile .toolbar-actions { gap: 0; }
  .thumb-mobile .toolbar-actions .icon-btn { width: 34px; min-width: 34px; min-height: 44px; height: 44px; padding: 7px; border: 0; background: transparent; box-shadow: none; }
  .thumb-mobile .toolbar-actions .icon-btn svg { width: 18px; height: 18px; }
  .thumb-mobile .mode-tab { background: transparent; color: var(--muted); box-shadow: none; position: relative; }
  .thumb-mobile .mode-tab.is-active { color: var(--accent); background: color-mix(in srgb,var(--accent) 5%,transparent); box-shadow: none; }
  .thumb-mobile .mode-tab.is-active::after { content: ''; position: absolute; bottom: 0; left: 30%; right: 30%; height: 2px; border-radius: 2px; background: color-mix(in srgb,var(--accent) 75%,transparent); }
  .thumb-mobile.thumb-immersed .title-cluster { display: none; }
}

@media (max-width: 720px) {
  :root .thumb-mobile .topbar .title-cluster .brand-mark { width: 21px; height: 21px; flex-basis: 21px; }
  :root .thumb-mobile .topbar .mode-tabs { background: color-mix(in srgb,var(--accent) 5%,var(--panel-solid)); border-radius: 8px; padding: 3px; gap: 3px; }
  :root .thumb-mobile .topbar .mode-tab.is-active,
  :root .thumb-mobile .topbar .mode-tab.is-active:hover { background: color-mix(in srgb,var(--accent) 10%,var(--panel-solid)); color: var(--accent); box-shadow: none; }
  .thumb-mobile .thumb-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .thumb-dock .pager { justify-content: center; }
  .thumb-dock .pager .page-jump { flex: 0 1 auto; }
}

@media (max-width: 720px) {
  :root body.thumb-mobile .thumb-dock { gap: 0; padding-inline: 8px; }
  :root body.thumb-mobile .thumb-dock > .thumb-search-open { flex: 0 0 64px; margin-left: auto; padding: 0 4px; }
  :root body.thumb-mobile .thumb-dock > .pager { position: static; inset: auto; transform: none; min-height: 44px; height: 44px; flex: 1 1 0; margin: 0; padding: 0; gap: 2px; background: transparent; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; }
  :root body.thumb-mobile .thumb-dock .pager-arrow { display: grid; place-items: center; flex: 0 0 36px; width: 36px; min-width: 36px; min-height: 44px; height: 44px; margin: 0; padding: 6px; border: 0; border-radius: 6px; background: transparent; box-shadow: none; color: var(--accent); }
  :root body.thumb-mobile .thumb-dock .pager-arrow:disabled { opacity: .35; background: transparent; }
  :root body.thumb-mobile .thumb-dock .pager-arrow:active:not(:disabled) { background: var(--accent-soft); }
  :root body.thumb-mobile .thumb-dock .page-jump { gap: 2px; min-width: 0; }
  :root body.thumb-mobile .thumb-dock .page-jump input { width: 38px; background: transparent; border: 0; box-shadow: none; }
  :root body.thumb-mobile .thumb-dock > .thumb-filter { flex: 0 0 92px; min-width: 0; margin: 0; padding: 0 6px; border: 0; border-right: 1px solid var(--line); border-radius: 0; box-shadow: none; background: transparent; }
  :root body.thumb-mobile .thumb-dock > .thumb-filter.is-filtered { color: var(--accent); }
  :root body.thumb-mobile .thumb-dock > .thumb-filter.is-filtered small { color: var(--accent); font-weight: 600; }
  :root body.thumb-mobile .thumb-dock .thumb-search { margin-left: 6px; }
}

@media (max-width: 720px) {
  :root body.thumb-mobile .thumb-search > .thumb-search-close { order: 0; flex: 0 0 44px; min-width: 44px; margin-right: 4px; border-right: 1px solid var(--line); border-radius: 0; }
  :root body.thumb-mobile .thumb-search > .search-field { order: 1; display: block; }
  :root body.thumb-mobile .thumb-search > .thumb-clear { order: 2; flex: 0 0 44px; min-width: 44px; }
  :root body.thumb-mobile .thumb-dock.is-searching .thumb-search { margin-left: 10px; }
  :root body.thumb-mobile .thumb-search #searchInput { padding-inline: 6px; }
}

/* Softer query dock; all layout changes remain phone-only. */
@media (max-width: 720px) {
  body.thumb-mobile:not(.thumb-has-dock) { padding-bottom: 0; }
  :root body.thumb-mobile .thumb-dock { left: 8px; right: 8px; bottom: 0; border: 1px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -4px 18px #173c3010; background: color-mix(in srgb,var(--accent) 2%,var(--panel-solid)); }
  :root body.thumb-mobile .thumb-dock > .thumb-search-open { border-radius: 14px; }
  :root body.thumb-mobile .thumb-dock > .thumb-filter { border: 0; border-radius: 14px; background: var(--accent-soft); }
  :root body.thumb-mobile .thumb-dock .thumb-search { border-radius: 14px; }
  :root body.thumb-mobile .thumb-dock .pager-arrow { border-radius: 12px; }
  .thumb-mobile .toolbar-card { border-radius: 16px; }
  .thumb-mobile .ranking-panel { border-radius: 16px; }
}

@media (max-width: 360px) {
  :root body.thumb-mobile .thumb-dock { padding-inline: 4px; }
  :root body.thumb-mobile .thumb-dock > .thumb-filter { flex-basis: 80px; padding-inline: 2px; }
  :root body.thumb-mobile .thumb-dock > .thumb-search-open { flex-basis: 48px; gap: 2px; padding-inline: 0; }
  :root body.thumb-mobile .thumb-dock .page-jump input { flex: none; }
  :root body.thumb-mobile .thumb-dock .page-jump .page-total { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}
.quality-note { padding: 12px 14px; margin-top: 10px; border-radius: 14px; background: var(--accent-soft); }
.quality-note > strong { display: block; font-size: 14px; line-height: 1.6; color: var(--text); }
#qualityWarningText .quality-note p { margin: 7px 0 0; font-size: 13px; line-height: 1.8; color: var(--text); }
.quality-note details { margin-top: 10px; color: var(--muted); font-size: 12px; }
.quality-note summary { cursor: pointer; padding-block: 4px; }
.quality-popover { border-radius: 18px; }
.loading-note { display: flex; align-items: center; gap: 12px; padding: 18px 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel-solid); box-shadow: 0 6px 24px #173c3008; }
.loading-note strong { display: block; color: var(--text); font-size: 14px; font-weight: 600; }
.loading-note small { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); }

.quality-cause { padding-top: 10px; border-top: 1px dashed var(--line); }
.quality-cause b { display: block; margin-bottom: 3px; color: var(--muted); font-size: 12px; font-weight: 600; }
.quality-popover { max-height: min(76dvh, 640px); overflow-y: auto; overscroll-behavior: contain; }

/* Keep visitor notices brief; explanations remain available on demand. */
.quality-note { padding: 10px 12px; margin-top: 8px; }
#qualityWarningText .quality-note p { margin-top: 5px; line-height: 1.6; }
.quality-note details { margin-top: 5px; }
@media (max-width: 720px) {
  .thumb-sheet { padding-top: 8px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); max-height: 77dvh; }
  .thumb-sheet > header { margin-bottom: 2px; }
  .thumb-sheet #rankingFilters { gap: 6px; }
  .thumb-sheet #rankingFilters > label, .thumb-sheet #rankingFilters > .filter-field { gap: 2px; }
  .thumb-sheet #rankingFilters input, .thumb-sheet #rankingFilters select { height: 38px; min-height: 38px; }
  .thumb-sheet #rankingFilters .date-field > .filter-caption,
  .thumb-sheet #rankingFilters .date-field > .date-caption-actions {
    display: flex; align-items: center; min-height: 28px; flex-shrink: 0;
  }
  .thumb-sheet #rankingFilters .date-field::after { top: 41px; bottom: auto; }
  .thumb-sheet .thumb-done { margin-top: 6px; }
}

/* Keep phone sheets compact without crowding their touch controls. */
@media (max-width: 720px) {
  .thumb-sheet { padding-top: 6px; }
  .thumb-sheet > header {
    position: relative; height: 32px; min-height: 32px;
    margin: 0 0 6px; padding: 0; touch-action: none;
  }
  .thumb-sheet > header strong {
    font-size: 13px; font-weight: 600; color: var(--muted);
  }
  .thumb-sheet > header button {
    position: relative; width: 44px; min-width: 44px;
    height: 36px; min-height: 36px; padding: 6px;
    border-radius: 10px; touch-action: manipulation;
  }
  .thumb-sheet > header button::before {
    content: ''; position: absolute; inset: -4px 0;
  }
  .thumb-sheet > header svg { width: 18px; height: 18px; }
  .thumb-sheet #rankingFilters { padding-top: 0; }

  .thumb-sheet #rankingFilters #filterResetField.has-filter-shortcuts {
    display: flex; position: relative; inset: auto; width: 100%;
    grid-column: 1 / -1; grid-row: auto; align-items: center; gap: 6px;
    padding: 0; margin: 0; z-index: 2;
  }
  .thumb-sheet .filter-shortcut { display: block; position: static; }
  .thumb-sheet .filter-shortcut > summary {
    display: flex; align-items: center; justify-content: center;
    min-width: 54px; min-height: 44px; padding: 6px 10px;
    list-style: none; cursor: pointer; border-radius: 10px;
    font-size: 13px; color: var(--accent);
  }
  .thumb-sheet .filter-shortcut > summary::-webkit-details-marker { display: none; }
  .thumb-sheet .filter-shortcut[open] > summary { background: var(--accent-soft); }
  .thumb-sheet .filter-shortcut > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .thumb-sheet #rankingFilters #filterResetField #filterResetBtn {
    position: static; display: inline-flex; align-items: center; gap: 5px;
    width: auto; min-width: 88px; height: 44px; min-height: 44px;
    margin-left: auto; padding: 6px 10px; border-radius: 10px;
  }
  .thumb-sheet .filter-shortcut-popup {
    position: fixed; inset: auto; margin: 0; box-sizing: border-box;
    max-height: 300px; overflow: hidden;
    padding: 6px; border: 1px solid var(--line-strong); border-radius: 14px;
    background: var(--panel-solid); box-shadow: var(--shadow-float);
    font-size: 13px;
  }
  .thumb-sheet .filter-shortcut-popup:popover-open { display: flex; flex-direction: column; }
  .thumb-sheet .filter-shortcut-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .thumb-sheet .filter-shortcut-hint { flex: none; padding: 8px 4px 3px; border-top: 1px solid var(--line); text-align: center; color: var(--accent); font-size: 12px; }
  .thumb-sheet .filter-shortcut-popup p { margin: 8px; color: var(--muted); }
  .thumb-sheet .filter-shortcut-status:empty { display: none; }
  .thumb-sheet .filter-shortcut-entry { display: flex; gap: 4px; }
  .thumb-sheet #rankingFilters .filter-shortcut-popup button {
    min-height: 44px; height: auto; padding: 8px;
    border: 0; border-radius: 8px; box-shadow: none; background: transparent;
    font-size: 13px; line-height: 1.4;
  }
  .thumb-sheet #rankingFilters .filter-shortcut-popup .filter-shortcut-apply {
    display: block; flex: 1; min-width: 0; width: auto;
    text-align: left; color: var(--text); overflow-wrap: anywhere;
  }
  .thumb-sheet #rankingFilters .filter-shortcut-popup .filter-shortcut-save { display: block; width: 100%; text-align: left; color: var(--accent); }
  .thumb-sheet #rankingFilters .filter-shortcut-popup .filter-shortcut-remove { flex: 0 0 44px; color: var(--muted); font-size: 20px; }
  .thumb-sheet .filter-shortcut-popup button:active { background: var(--accent-soft); }

  .thumb-mobile .change-overview { padding: 4px; box-shadow: var(--shadow-sm); }
  .thumb-mobile .change-stat { min-height: 44px; padding: 4px; }
  .thumb-mobile .change-stat::before { display: none; }
  .thumb-mobile .change-stat-grid.has-observations .change-stat {
    display: flex; align-items: center; justify-content: center; gap: 5px;
  }
  .thumb-mobile .change-stat-grid.has-observations .change-stat span { font-size: 12px; }
  .thumb-mobile .change-stat-grid.has-observations .change-stat strong { font-size: 16px; }
}
@media (max-width: 360px) {
  .thumb-mobile .change-stat-grid.has-observations .change-stat { gap: 3px; padding-inline: 2px; }
  .thumb-mobile .change-stat-grid.has-observations .change-stat span { font-size: 11px; }
  .thumb-mobile .change-stat-grid.has-observations .change-stat strong { font-size: 14px; }
}

/* Ranking filter sheet: one scrollable body and a dedicated action footer. */
@media (max-width: 720px) {
  :root .thumb-sheet {
    padding: 0; max-height: min(85dvh, var(--thumb-sheet-available, 85dvh));
    border-radius: 26px 26px 0 0; overflow: hidden;
  }
  :root .thumb-sheet[open] { display: flex; flex-direction: column; }
  :root .thumb-sheet > header {
    position: relative; flex: none; gap: 8px; height: auto; min-height: 62px;
    padding: 18px 12px 0 16px; margin: 0 0 10px;
  }
  :root .thumb-sheet > header::before {
    content: ''; position: absolute; top: 8px; left: calc(50% - 18px);
    width: 36px; height: 4px; border-radius: 4px; background: var(--line);
  }
  :root .thumb-sheet > header strong { flex: 1; min-width: 0; color: var(--text); font-size: 17px; white-space: nowrap; }
  /* The heading receives initial focus without looking like an input. */
  :root .thumb-sheet #thumbSheetTitle:focus { outline: none; }
  :root .thumb-sheet > header button { flex: none; width: 36px; min-width: 36px; height: 44px; min-height: 44px; padding: 8px; }
  :root .thumb-sheet > header button::before { inset: 0 -4px; }
  :root .thumb-sheet > header .page-size-control { display: flex; flex: none; margin: 0; padding: 0; }
  :root .thumb-sheet > header .page-size-control > span { display: none; }
  :root .thumb-sheet > header .page-size-control select {
    width: 96px; min-width: 96px; height: 44px; min-height: 44px; padding: 0 7px;
    border: 1px solid var(--line); border-radius: 11px; background: transparent;
    color: var(--text-secondary); font-size: 13px; font-weight: 400; box-shadow: none;
  }
  .thumb-sheet-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  :root .thumb-sheet .filter-shell {
    position: static; margin: 0; padding: 0 16px; border: 0; border-radius: 0;
    background: transparent; box-shadow: none;
  }
  :root .thumb-sheet #quickFilterChips:not([hidden]) { margin: 0; padding: 0 0 10px; }
  :root .thumb-sheet #quickFilterChips button,
  :root .thumb-sheet #quickFilterChips .filter-chip-date {
    max-width: 100%; min-height: 36px; padding: 5px 9px; background: var(--accent-soft);
    color: var(--accent-strong); white-space: normal; overflow-wrap: anywhere; text-align: left;
  }
  :root .thumb-sheet #rankingFilters { gap: 10px 8px; padding: 0; }
  :root .thumb-sheet #rankingFilters > label,
  :root .thumb-sheet #rankingFilters > .filter-field { gap: 4px; font-size: 12px; line-height: 16px; }
  :root .thumb-sheet #rankingFilters input,
  :root .thumb-sheet #rankingFilters select {
    min-width: 0; height: 44px; min-height: 44px; padding: 0 10px;
    border-color: var(--line); border-radius: 11px; box-shadow: none; font-size: 16px; font-weight: 400;
  }
  :root .thumb-sheet #rankingFilters input::placeholder { font-size: 14px; }
  :root .thumb-sheet #rankingFilters .primary-date-field {
    display: grid; grid-template-columns: minmax(0, 1fr) 52px; grid-column: 1 / -1; gap: 4px 8px;
  }
  :root .thumb-sheet #rankingFilters .date-caption-actions { display: contents; }
  :root .thumb-sheet #dateCaption { grid-column: 1 / -1; grid-row: 1; display: block; }
  :root .thumb-sheet #dateInput { grid-column: 1; grid-row: 2; padding-right: 32px; }
  :root .thumb-sheet #rankingFilters #latestDateBtn {
    display: flex; align-items: center; justify-content: center; grid-column: 2; grid-row: 2;
    width: 52px; min-width: 52px; height: 44px; min-height: 44px; padding: 0;
    border: 1px solid var(--line-strong); border-radius: 11px; background: var(--accent-soft);
    color: var(--accent-strong); font-size: 12px; box-shadow: none;
  }
  :root .thumb-sheet #rankingFilters .date-field::after { top: 34px; right: 12px; bottom: auto; }
  :root .thumb-sheet #rankingFilters .primary-date-field::after { right: 72px; }
  :root .thumb-sheet .date-status { position: static; grid-column: 1 / -1; font-size: 11px; line-height: 16px; }
  :root .thumb-sheet .date-status:empty { display: none; }
  :root .thumb-sheet #rankingFilters .guild-filter-field { grid-column: 1 / -1; }
  :root .thumb-sheet #rankingFilters #guildSearchInput { padding-right: 38px; }
  :root .thumb-sheet #rankingFilters .guild-filter-toggle { height: 44px; min-height: 44px; }
  :root .thumb-sheet #rankingFilters .query-submit-field { grid-column: 1 / -1; justify-self: stretch; width: 100%; margin: 0; padding: 0; }
  :root .thumb-sheet #rankingFilters #filterResetField.has-filter-shortcuts { justify-content: flex-start; min-height: 44px; gap: 4px; }
  :root .thumb-sheet .filter-shortcut > summary { padding: 0 8px; font-size: 13px; }
  :root .thumb-sheet .thumb-sheet-actions {
    display: flex; flex: none; align-items: center; gap: 12px; margin: 0;
    padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
  }
  :root .thumb-sheet-actions #filterResetBtn {
    flex: 0 0 52px; width: 52px; min-width: 52px; height: 48px; min-height: 48px;
    margin: 0; padding: 0 4px; border: 0; border-radius: 10px; background: transparent;
    color: var(--muted); box-shadow: none; font-size: 14px; font-weight: 400;
  }
  :root .thumb-sheet-actions .filter-reset-phone { display: none; }
  :root .thumb-sheet-actions .filter-reset-desktop { display: inline; }
  :root .thumb-sheet .thumb-sheet-actions .thumb-done {
    flex: 1; min-width: 0; width: auto; min-height: 48px; margin: 0; padding: 0 8px;
    border: 0; border-radius: 12px; background: var(--accent-fill); color: var(--on-accent);
    font-size: 15px; font-weight: 600; box-shadow: none;
  }
  :root .thumb-sheet .thumb-sheet-actions .thumb-done:hover { background: var(--accent-fill-hover); }
}

/* Keep closed popovers hidden even before JS, and without :where() support. */
/* Do not rely on the browser's native dialog stylesheet during startup. */
dialog:not([open]) { display: none !important; }
.thumb-sheet.is-sheet-dragging, .statistics-thumb-sheet.is-sheet-dragging { animation: none !important; transition: none !important; }
#quickFilterChips { display: none; }
.record-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
#savedRecordsDialog { padding: 8px 14px 12px; }
#savedRecordsDialog header { top: -8px; padding: 0; min-height: 36px; }
#savedRecordsDialog h2 { font-size: 16px; line-height: 24px; }
#savedRecordsDialog header .menu-close { width: 36px; min-width: 36px; height: 36px; min-height: 36px; }
#savedRecordsDialog .saved-caption { margin: 2px 0 10px; font-size: 12px; line-height: 18px; color: var(--muted); }
#savedRecordsDialog [data-saved-records] { margin-bottom: 8px; }
#savedRecordsDialog [data-import-status]:empty { display: none; }
#savedRecordsDialog .record-actions { padding-top: 0; gap: 6px; }
#savedRecordsDialog .record-actions button { min-height: 36px; padding: 4px 12px; font-size: 13px; }
.record-tools .record-feedback { flex-basis: 100%; }
.saved-record-row { flex-wrap: wrap; }
.saved-record-row .saved-record-open-button { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px; border: 0; background: transparent; text-align: left; white-space: normal; box-shadow: none; }
.saved-record-open-button strong { color: var(--text); font-size: 16px; }
.saved-record-open-button > span:not(.saved-record-open) { grid-row: 2; color: var(--muted); font-size: 12px; }
.saved-record-row > [role="status"]:empty { display: none; }
.saved-record-row > [role="status"] { grid-column: 1 / -1; color: var(--muted); }
.saved-record-row > [role="status"], .favorite-convert { flex-basis: 100%; margin: 0 12px 8px; }
.favorite-convert { font-size: 12px; text-align: left; border: 0; background: transparent; color: var(--accent); }
@media (max-width: 720px) {
  #quickFilterChips:not([hidden]) { display:flex; position:static; flex-wrap:wrap; gap:6px; padding:8px 0; margin:0; }
  #quickFilterChips button, #quickFilterChips .filter-chip-date { display:inline-flex; align-items:center; gap:6px; margin:0; min-height:32px; padding:4px 9px; border:1px solid var(--line); border-radius:16px; background:var(--panel-solid); color:var(--accent); font-size:12px; line-height:20px; box-shadow:none; }
  .thumb-dock .thumb-filter { min-width:112px; padding-inline:6px; gap:4px; }
  .thumb-dock .thumb-filter > span:first-child { display:none; }
  .thumb-dock .thumb-filter small { max-width:100px; font-size:10px; }
  .thumb-filter-label { font-size:inherit; font-weight:inherit; }
  .thumb-filter small { max-width:112px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .statistics-thumb-sheet #quickFilterChips { margin-inline:16px; }

}
.player-card .player-metrics .delta-up, .daily-change-row .delta-up { color:#0f766e; }
.player-card .player-metrics .delta-down, .daily-change-row .delta-down { color:var(--bad); }
:root[data-theme="dark"] .player-card .player-metrics .delta-up, :root[data-theme="dark"] .daily-change-row .delta-up { color:#79bbaa; }
:root[data-theme="dark"] .player-card .player-metrics .delta-down, :root[data-theme="dark"] .daily-change-row .delta-down { color:#db9399; }
@media (max-width:720px) {
  :root .thumb-mobile .topbar .toolbar-actions .icon-btn { width:44px; min-width:44px; }
}
.player-name.has-position-jump { display: flex; align-items: center; gap: 6px; min-width: 0; }
.has-position-jump .player-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-position-jump { flex: none; margin: 0; min-height: 24px; height: 24px; padding: 0 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-cool); color: var(--accent); font-size: 11px; line-height: 20px; box-shadow: none; }
html[data-boot] [popover] { display: none !important; }
html[data-popover-polyfill] [popover]:not(.\:popover-open) { display: none; }
html[data-popover-polyfill] [popover].\:popover-open { position: fixed; }
/* Polyfilled popovers do not enter the browser top layer. */
html[data-popover-polyfill] .more-tools.\:popover-open { display: block; z-index: 100; }

@media (max-width: 720px) {
  /* Literal theme tokens remain opaque when color-mix() is unsupported. */
  :root body.thumb-mobile .thumb-dock,
  .statistics-thumb-dock:not([hidden]) { background: var(--surface-warm); }
  :root .thumb-mobile .topbar .mode-tabs { background: var(--surface-cool); }
  :root .thumb-mobile .topbar .mode-tab.is-active,
  :root .thumb-mobile .topbar .mode-tab.is-active:hover { background: var(--accent-soft); }
  .thumb-mobile .mode-tab.is-active::after { background: var(--accent); }
  :root body.thumb-mobile .thumb-dock .page-total[data-compact] { font-size: 0; }
  :root body.thumb-mobile .thumb-dock .page-total[data-compact]::after { font-size: 12px; }
  .thumb-sheet, .statistics-thumb-sheet {
    top: auto; left: 0; right: 0; bottom: 0;
    max-height: 77vh;
  }
  @supports (height: 1dvh) {
    .thumb-sheet, .statistics-thumb-sheet { max-height: 77dvh; }
  }
  @supports not (padding-bottom: env(safe-area-inset-bottom)) {
    body.thumb-mobile { padding-bottom: 72px; }
    :root body.thumb-mobile .thumb-dock { padding: 4px 8px; }
    .thumb-sheet, .statistics-thumb-sheet { padding: 6px 14px 10px; }
  }
}

/* Full archive trend: one heading row and a small text action. */
#archiveViewBasic > .player-trend-period { margin:12px 0 0; padding-top:10px; border-top:1px solid var(--line); }
#archiveViewBasic > .player-trend-period > span { color:var(--text); font-weight:600; font-size:14px; }
#archiveViewBasic .player-trend-chart .trend-chart { margin:0; padding:0; border:0; background:transparent; }
#archiveViewBasic .player-trend-chart figcaption { margin:0; padding:0; min-height:0; }
#archiveViewBasic .player-trend-chart figcaption > span:first-child { display:none; }
#archiveViewBasic .player-trend-chart .trend-chart { display:flex; flex-direction:column; }
#archiveViewBasic .player-trend-chart svg { order:0; width:100%; height:180px; min-height:0; }
#archiveViewBasic .player-trend-chart figcaption { order:1; font-size:11px; }
#archiveViewBasic .player-trend-chart .trend-gap-note { order:2; font-size:11px; margin:4px 0; color:var(--muted); }
#archiveViewBasic .archive-power-detail-link { display:flex; justify-content:flex-end; margin:0; }
#archiveViewBasic .archive-power-detail-link #viewTimelineBtn { display:inline-block; width:auto; min-height:36px; padding:4px 0 4px 8px; border:0; box-shadow:none; background:transparent; color:var(--accent); font-size:12px; font-weight:400; }

#archiveViewBasic .player-trend-chart figcaption { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:2px 8px; }
#archiveViewBasic .player-trend-chart #viewTimelineBtn { flex:none; width:auto; min-height:36px; padding:4px 0; border:0; box-shadow:none; background:transparent; color:var(--accent); font-size:11px; font-weight:400; }
#archiveViewBasic .player-trend-chart .trend-legend { font-size:11px; gap:4px; }
#archiveViewBasic .archive-gap-clear { margin:2px 0 8px; font-size:11px; }

#archiveViewBasic > .player-trend-period { border-top:0; padding-top:0; margin-top:0; }
#archiveViewBasic .player-trend-chart figcaption { flex-direction:row; width:100%; }
#archiveViewBasic .player-trend-chart figcaption .trend-legend { width:auto; flex:0 1 auto; }

.date-caption-actions { display:flex; align-items:center; justify-content:space-between; gap:8px; }

/* Touch scrolling must not leave simulated mouse-hover stripes on cards. */
:root[data-ranking-input="touch"] .ranking-list .ranking-card:hover:not(.is-rank-target),
:root[data-ranking-input="touch"] .daily-change-row:hover {
  background:transparent !important; border-color:var(--line) !important; box-shadow:none !important;
}
:root[data-ranking-input="touch"] .ranking-list .ranking-card.ranking-card[role="button"]:focus,
:root[data-ranking-input="touch"] .daily-change-row:focus,
:root[data-ranking-input="touch"] .ranking-list .ranking-item.is-expanded > .ranking-card {
  background:var(--surface-cool) !important; border-color:var(--line) !important;
  outline:none !important; box-shadow:none !important;
}
#rankingFilters #latestDateBtn, #statisticsLatestDate { width:auto; height:28px; min-height:28px; padding:2px 8px; font-size:12px; border:0; box-shadow:none; background:var(--accent-soft); color:var(--accent); }

.guild-rename-hint { padding:6px 10px; border:1px solid var(--line); border-radius:10px; background:var(--soft); font-size:12px; margin-bottom:8px; }
.guild-rename-hint p { margin:5px 0; line-height:1.6; }
.guild-rename-hint > strong { display:block; font-size:12px; line-height:18px; }
.guild-rename-hint .detail-link { display:block; white-space:normal; text-align:left; min-height:32px; padding:4px 0; font-size:12px; line-height:20px; }
:root:not([data-evidence="on"]) .guild-rename-hint details { display:none; }
.guild-rename-hint summary { cursor:pointer; color:var(--muted); margin-top:6px; }

/* Desktop latest-date action shares the date row instead of creating a caption row. */
@media(min-width:801px) {
  .filter-shell #rankingFilters .primary-date-field { display:flex; flex-direction:row; align-items:center; gap:0; border:1px solid var(--line); border-radius:8px; background:var(--panel-solid); }
  #rankingFilters .primary-date-field .date-caption-actions { display:flex; flex:0 0 58px; width:58px; order:2; }
  #rankingFilters .primary-date-field #dateCaption { display:none; }
  .filter-shell #rankingFilters .primary-date-field #dateInput { flex:1 1 120px; width:120px; min-width:100px; padding-inline:6px; border:0; border-radius:8px 0 0 8px; box-shadow:none; }
  #rankingFilters .primary-date-field #latestDateBtn { white-space:nowrap; width:58px; min-width:58px; height:28px; min-height:28px; padding:2px 4px; font-size:11px; border-left:1px solid var(--line); border-radius:0 7px 7px 0; background:transparent; }
  #rankingFilters .primary-date-field::after { display:none; }
  #rankingFilters .primary-date-field .date-status:empty { display:none; }
}

#rankingFilters #latestDateBtn[aria-pressed="true"] { color:var(--accent); background:var(--accent-soft); }

.date-calendar-trigger { display:none; }
@media(min-width:801px) {
 .filter-shell #rankingFilters .primary-date-field #dateInput { display:none; }
 .filter-shell #rankingFilters .primary-date-field .date-calendar-trigger { display:block; flex:1; min-width:0; padding:4px 8px; height:32px; min-height:32px; border:0; border-radius:8px 0 0 8px; box-shadow:none; background:transparent; text-align:left; white-space:nowrap; font-size:13px; }
}
.date-calendar { position:fixed; inset:auto; margin:0; width:280px; max-width:calc(100vw - 16px); max-height:calc(100dvh - 16px); overflow:auto; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--panel-solid); color:var(--text); box-shadow:0 12px 36px #143c3326; }
.date-calendar::backdrop { background:transparent; }
.date-calendar header { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; font-size:13px; }
.date-calendar button { min-height:32px; border:0; border-radius:6px; padding:0 8px; font-size:12px; background:transparent; color:var(--text); box-shadow:none; }
.date-calendar button:disabled { opacity:.3; cursor:default; }
.date-calendar header button[data-month] { display:flex; align-items:center; justify-content:center; flex:0 0 36px; width:36px; height:36px; padding:0; font-size:26px; line-height:1; font-weight:500; }
.date-calendar header button[data-month]:not(:disabled):hover { background:var(--accent-soft); color:var(--accent); }
.date-calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:2px; }
.date-calendar-grid span { text-align:center; padding:5px 0; font-size:11px; color:var(--muted); }
.date-calendar-grid button[aria-pressed="true"] { background:var(--accent); color:var(--panel-solid); }
.date-calendar footer { display:flex; justify-content:space-between; align-items:center; margin-top:10px; padding-top:9px; border-top:1px solid var(--line); }
.date-calendar footer small { font-size:11px; color:var(--muted); }
.date-calendar footer button { background:var(--accent-soft); color:var(--accent); }

@media(min-width:801px) { .filter-shell #rankingFilters .primary-date-field .date-calendar-trigger { display:flex; align-items:center; justify-content:space-between; gap:8px; } .date-calendar-trigger svg { flex:none; color:var(--muted); } }

@media(min-width:801px) {
 .filter-shell #rankingFilters .primary-date-field { width:100%; }
 .filter-shell #rankingFilters .primary-date-field .date-calendar-trigger { font-size:14px; }
 .filter-shell #rankingFilters .primary-date-field { margin-right:0; }
}

@media(min-width:1101px) { .filter-shell #rankingFilters:not(.is-archive-mode):not(.is-change-mode):not(.is-guild-compare-mode) { grid-template-columns:minmax(0,1.06fr) minmax(0,.9fr) minmax(0,.9fr) minmax(0,1.1fr) minmax(0,1.8fr) 40px; } }

.old-date-notice { display:flex; align-items:center; gap:8px; padding:2px 10px; border-top:1px solid var(--line); background:var(--surface-warm); color:var(--muted); font-size:12px; line-height:20px; }
.old-date-notice strong { color:var(--text); font-weight:600; }
.old-date-notice button { min-height:32px; padding:4px 8px; border:0; border-radius:6px; box-shadow:none; font-size:12px; background:var(--accent-soft); color:var(--accent); }
.old-date-notice .old-date-latest { display:none; }
.old-date-notice .old-date-dismiss { margin-left:auto; width:30px; padding:0; background:transparent; font-size:18px; color:var(--muted); }
@media(max-width:800px) {
 .old-date-notice { position:static; margin:6px 0 8px; padding:4px 10px; border:1px solid var(--line); border-radius:8px; }
 .old-date-notice > span { flex:1; }
 .old-date-notice .old-date-latest { display:block; white-space:nowrap; }
 .old-date-notice .old-date-dismiss { margin-left:0; }
}

/* Old WebViews must have a bounded drawer before its body can scroll. */
@supports not (height: 1dvh) {
  #changeDialog.is-drawer:not(.share-card):not(.is-pinned) {
    position:fixed; top:0; bottom:0; right:0; left:auto;
    height:100vh; max-height:100vh; margin:0; transform:none;
  }
  #changeDialog.is-drawer:not(.share-card) > form { display:flex; flex-direction:column; height:100%; min-height:0; overflow:hidden; }
  #changeDialog.is-drawer:not(.share-card) .change-dialog-body { flex:1 1 0%; min-height:0; overflow-y:auto; -webkit-overflow-scrolling:touch; }
  #changeDialog.is-drawer:not(.share-card) .dialog-head { flex-shrink:0; }
  #changeDialog .detail-change-strip > span { margin-right:12px; }
  @media(max-width:780px) {
    #changeDialog.is-drawer:not(.share-card):not(.is-pinned) { left:0; width:100%; max-width:100%; }
  }
}
/* Without :has(), the guild link's stretched hit area otherwise escapes its card. */
@supports not selector(:has(*)) {
  #changeDialog .player-fact { position:relative; }
}

.topbar .latest-update-entry { display:inline-flex; align-items:center; min-height:32px; padding:3px 2px; border:0; border-radius:4px; box-shadow:none; background:transparent; color:var(--muted); font:inherit; white-space:nowrap; }
.topbar button.latest-update-entry.is-history { color:var(--accent); cursor:pointer; }
.topbar button.latest-update-entry:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }

.empty.empty-date::before { display:none; }
.empty-date-icon { display:block; margin:0 auto 12px; color:var(--muted); }
.empty-date > strong { display:block; font-size:16px; color:var(--text); }
.empty-date > p { margin:8px auto 16px; max-width:460px; color:var(--muted); line-height:1.7; }

/* Detail navigation and content use the existing theme tokens in both themes. */
.roster-options [data-guild-roster-latest] { align-self: end; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-solid); color: var(--accent); box-shadow: none; font: inherit; font-size: 13px; }
.player-trend-panel { padding: 10px 12px; border: 1px solid var(--detail-line); border-radius: 10px; background: var(--detail-surface); margin-bottom: 16px; }
.player-trend-panel .player-trend-period { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 4px; padding: 0; min-height: 44px; }
#changeDialog .player-trend-panel .player-trend-period > span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 12px; min-width: 0; }
.player-trend-panel .player-trend-period strong { font-size: 14px; color: var(--text); }
#changeDialog .player-trend-panel [data-player-trend-change] { display: inline-flex; align-items: baseline; gap: 4px; margin: 0; font-size: 12px; color: var(--power-num); white-space: nowrap; font-variant-numeric: tabular-nums; }
#changeDialog .player-trend-panel .trend-change-label { color: var(--muted); font-size: 11px; font-weight: 400; }
#changeDialog .player-trend-panel [data-player-trend-change] b { font-size: 12px; font-weight: 600; }
.player-trend-panel .player-trend-period > div { flex-shrink: 0; }
.player-trend-panel .player-trend-period button { min-height: 44px; padding: 6px 9px; }
.player-trend-panel .trend-chart { margin: 0; padding: 0; border: 0; background: transparent; }
.player-trend-panel .trend-chart > svg { display: block; width: 100%; height: 132px; min-height: 0; overflow: visible; }
.player-trend-panel .trend-gap-note, .player-trend-panel .trend-policy-note { display: none; }
.player-trend-footer { position: relative; display: flex; align-items: start; justify-content: space-between; gap: 12px; font-size: 11px; }
.player-trend-footer .archive-gap-clear { margin: 0; min-height: 44px; display: flex; align-items: center; color: var(--muted); }
.player-trend-footer .archive-record-gaps { flex: 1; margin: 0; border: 0; background: transparent; border-radius: 0; min-width: 0; }
.player-trend-footer .archive-record-gaps > summary { min-height: 44px; padding: 8px 0; justify-content: start; font-size: 11px; color: var(--muted); }
.player-trend-footer .archive-gap-body { padding: 0 0 8px; }
.player-trend-footer > button { flex-shrink: 0; min-height: 44px; padding: 8px 0; border: 0; border-radius: 4px; background: transparent; box-shadow: none; color: var(--accent); font-size: 11px; }
.player-trend-footer > button:focus-visible, .player-trend-footer summary:focus-visible, .player-trend-panel .player-trend-period button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.detail-change-badges.is-inline { display: inline-flex; flex-wrap: wrap; gap: 4px; margin: 0 0 0 8px; vertical-align: baseline; }
#changeDialog:not(.share-card) .guild-change-overview { cursor: pointer; }
#changeDialog:not(.share-card) .guild-change-overview:hover { border-color: var(--accent); }
#changeDialog:not(.share-card) .guild-change-overview:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.server-detail-row, .mobile-power-card[data-server-detail] { cursor: pointer; }
.server-detail-row:focus-within { background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: -2px; }
.mobile-power-card[data-server-detail]:hover, .mobile-power-card[data-server-detail]:focus-within { border-color: var(--accent); }
@media (max-width: 360px) {
  .player-trend-panel .player-trend-period button { padding-inline: 6px; }
  #changeDialog .player-facts { grid-template-columns: minmax(0,.9fr) repeat(2,minmax(0,1.1fr)); gap: 6px; }
  #changeDialog .player-fact.is-power > strong, #changeDialog .player-fact.is-rank > strong { font-size: 20px; white-space: nowrap; }
}
#changeDialog.is-guild-change .change-dialog-body { display: block; overflow: auto; }
#changeDialog.is-guild-change .change-dialog-body > * + * { margin-top: 14px; }
#changeDialog .member-change-section { display: block; }
#changeDialog .guild-roster, #changeDialog .member-change-list { max-height: none; overflow: visible; }
#changeDialog .member-change-head { margin-bottom: 8px; }
#changeDialog .guild-overview-current > strong { color: var(--power-num); }

.roster-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 4px 12px; background: transparent; }
.roster-controls label, .archive-record-controls label { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 12px; }
.roster-controls .roster-search { display: block; }
.roster-search-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.roster-controls > button { min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-solid); color: var(--accent); font-size: 13px; box-shadow: none; }
.roster-controls > button[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-soft); }
.roster-options { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-top: 4px; }
.roster-options[hidden] { display: none; }
.guild-roster .roster-capture-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; padding: 8px 12px 6px; font-size: 11px; }
.guild-roster [data-roster-count] { padding: 6px 12px; font-size: 11px; }
.roster-controls input, .roster-controls select, .archive-record-controls input, .archive-record-controls select { width: 100%; min-width: 0; min-height: 40px; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-solid); color: var(--text); font: inherit; font-size: 13px; }
.detail-list-pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 0; }
.guild-roster .detail-list-pager { padding-inline: 14px; }
.detail-list-pager button { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-solid); color: var(--accent); box-shadow: none; font-size: 13px; }
.detail-list-pager span { color: var(--muted); font-size: 12px; }
.detail-list-pager button:disabled { opacity: .45; cursor: default; }
.player-archive-section .player-trend-period > span { display: inline; }
#changeDialog .player-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#changeDialog .player-facts.is-archive { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
#changeDialog .player-facts.has-power-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#changeDialog .player-facts.is-archive.has-power-summary { grid-template-columns: minmax(0, 1fr); }
.player-power-summary { padding: 16px; margin-bottom: 16px; border: 1px solid var(--detail-line); border-radius: 10px; background: var(--detail-surface); min-width: 0; }
.player-power-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.player-power-state { color: var(--accent-warm); white-space: nowrap; font-weight: 600; }
.player-power-value { display: block; margin: 10px 0 9px; color: var(--accent); font-size: 28px; line-height: 1.2; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.player-power-evidence { color: var(--muted); font-size: 12px; line-height: 1.5; }
.player-power-evidence > summary { cursor: pointer; width: fit-content; }
.player-power-evidence > p { margin: 9px 0 0; padding-top: 9px; border-top: 1px solid var(--detail-line); }
@media (max-width: 420px) { .player-power-value { font-size: 25px; } .player-power-summary { padding: 14px; } }
#changeDialog .player-fact.is-rank > strong, #changeDialog .player-fact.is-power > strong { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
#changeDialog .player-fact-change { color: var(--muted); font-size: 11px; line-height: 1.5; }
#changeDialog .player-fact.is-guild .detail-link { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.archive-preview-summary { padding: 0 0 12px; }
.archive-preview-meta.has-record-link,
#changeDialog[data-kind="player"].is-expanded:not(.share-card) .archive-preview-meta.has-record-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; }
.archive-preview-meta.has-record-link > p { margin: 0; min-width: 0; }
.archive-preview-meta.has-record-link > p:not(:first-child) { grid-column: 1 / -1; }
#changeDialog .archive-preview-record-link { width: auto; min-height: 28px; padding: 4px 0; border: 0; border-radius: 3px; box-shadow: none; background: transparent; color: var(--accent); font: inherit; font-size: 11px; font-weight: 400; line-height: 1.5; white-space: nowrap; }
#changeDialog .archive-preview-record-link:hover { text-decoration: underline; }
#changeDialog .archive-preview-record-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.archive-preview-history { margin-top: 12px; }
.archive-life.is-journey { border: 1px solid var(--detail-line); border-radius: 10px; padding: 12px; background: var(--detail-surface); }
#changeDialog .archive-life.is-journey > h3 { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 8px; border: 0; padding: 0; margin: 0 0 8px; font-size: 14px; background: transparent; }
.archive-life.is-journey .archive-life-range { text-align: left; margin: 8px 0 4px; }
.archive-life.is-journey .archive-life-head, .archive-life.is-journey .archive-life-row { display: grid; grid-template-columns: minmax(0, 1fr) 104px minmax(0, 1fr); gap: 14px; align-items: center; }
.archive-life.is-journey .archive-life-head { padding: 6px 0 10px; border-color: var(--detail-line); font-size: 11px; }
.archive-life.is-journey .archive-life-head > :first-child { text-align: right; }
.archive-life.is-journey .archive-life-head > :last-child { text-align: left; }
.archive-life.is-journey .archive-life-track { background-image: linear-gradient(var(--detail-line), var(--detail-line)); background-position: center; background-size: 1px 100%; background-repeat: no-repeat; }
.archive-life.is-journey .archive-life-track::before { display: none; }
.archive-life.is-journey .archive-life-row { min-height: 0; padding: 14px 0; }
.archive-life.is-journey .archive-life-date { text-align: center; padding: 6px 0; background: var(--detail-surface); color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.7; white-space: nowrap; font-variant-numeric: tabular-nums; }
.archive-life.is-journey .archive-life-date::before { display: none; }
.archive-life.is-journey .journey-node { display: block; width: 6px; height: 6px; margin: 0 auto 6px; border-radius: 50%; background: var(--detail-line); }
.archive-life.is-journey .is-latest .journey-node { background: var(--accent); }
.archive-life.is-journey .journey-range-dates { display: inline-flex; align-items: flex-start; justify-content: center; gap: 3px; }
.archive-life.is-journey .journey-range time { display: inline-flex; flex-direction: column; align-items: center; }
.archive-life.is-journey .journey-range-separator { display: inline; margin: 0; }
.archive-life.is-journey .journey-range-year { display: block; }
.archive-life.is-journey .journey-record-note { position: relative; }
.archive-life.is-journey .journey-record-note > summary { display: flex; align-items: center; justify-content: center; min-height: 38px; padding: 0; margin: 0; font: inherit; list-style: none; cursor: help; text-decoration: underline dotted var(--detail-line); text-underline-offset: 3px; }
.archive-life.is-journey .journey-record-note > summary::-webkit-details-marker { display: none; }
.archive-life.is-journey .journey-record-note > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.archive-life.is-journey .journey-record-help { position: absolute; z-index: 2; top: 100%; left: 50%; transform: translateX(-50%); width: 220px; max-width: calc(100vw - 48px); margin: 4px 0 0; padding: 10px 12px; box-sizing: border-box; border: 1px solid var(--detail-line); border-radius: 8px; background: var(--panel-solid); box-shadow: var(--shadow-sm); color: var(--text); font-size: 12px; line-height: 1.6; text-align: left; white-space: normal; }
.archive-life.is-journey .archive-life-row:not(.is-latest) .journey-record-help { top: auto; bottom: 100%; margin: 0 0 4px; }
.archive-life.is-journey .archive-life-name, .archive-life.is-journey .archive-life-guild { display: block; min-width: 0; margin: 0; font-size: 14px; line-height: 1.6; color: var(--text); overflow-wrap: anywhere; }
.archive-life.is-journey .archive-life-name { text-align: right; }
.archive-life.is-journey .archive-life-guild { text-align: left; }
.archive-life.is-journey .archive-life-name strong { display: block; font-size: 14px; font-weight: 400; color: var(--text); }
.archive-life.is-journey .journey-guild-value { display: block; min-width: 0; font-weight: 400; color: var(--text); }
.archive-life.is-journey .archive-life-name strong.is-changed, .archive-life.is-journey .journey-guild-value.is-changed { color: var(--accent); font-weight: 650; }
.archive-life.is-journey .journey-guild-value .detail-link { color: inherit; font-weight: inherit; }
.archive-life.is-journey .archive-life-guild .detail-link { display: inline-block; max-width: 100%; min-height: 32px; line-height: 1.6; }
.archive-life.is-journey .guild-link-chevron { width: 10px; height: 10px; margin-left: 2px; vertical-align: -1px; }
.journey-inferred { display: block; font-size: 10px; color: var(--accent-warm); }
@container (max-width: 340px) {
  .archive-life.is-journey .archive-life-head, .archive-life.is-journey .archive-life-row { grid-template-columns: minmax(0, 1fr) 80px minmax(0, 1fr); gap: 6px; }
}
.archive-rename-details { margin-top: 12px; border-top: 1px solid var(--line); }
.archive-rename-details > summary { min-height: 44px; padding: 12px 0; box-sizing: border-box; cursor: pointer; color: var(--accent); font-size: 12px; }
.archive-view { min-height: 0; }
.archive-view[hidden] { display: none !important; }
.archive-trend-section { border: 1px solid var(--detail-line); border-radius: 10px; background: var(--detail-surface); margin-bottom: 16px; }
.archive-trend-section > summary { display: flex; align-items: center; gap: 8px; min-height: 64px; padding: 10px 12px; box-sizing: border-box; cursor: pointer; list-style: none; }
.archive-trend-section > summary::-webkit-details-marker { display: none; }
.archive-trend-heading { flex: 1; min-width: 0; }
.archive-trend-heading > strong { display: block; color: var(--text); font-size: 14px; }
.archive-trend-overview { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.7; font-variant-numeric: tabular-nums; }
.archive-trend-overview b { color: var(--power-num); font-weight: 600; }
.archive-trend-date { white-space: nowrap; }
.archive-trend-state { flex-shrink: 0; color: var(--muted); font-size: 12px; }
.archive-trend-collapse, .archive-trend-section[open] .archive-trend-expand { display: none; }
.archive-trend-section[open] .archive-trend-collapse { display: inline; }
.archive-trend-chevron { flex-shrink: 0; color: var(--muted); transition: transform var(--motion-fast); }
.archive-trend-section[open] .archive-trend-chevron { transform: rotate(180deg); }
.archive-trend-body { padding: 0 12px 12px; }
.archive-trend-body .player-trend-period { margin-top: 0; }
.archive-trend-body .trend-chart { margin: 0; padding: 0; border: 0; background: transparent; }
.archive-record-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.archive-record-heading > h3 { margin: 0; font-size: 15px; }
.archive-record-heading > button { min-height: 44px; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--accent); box-shadow: none; font-size: 13px; }
.archive-record-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; align-items: end; gap: 10px; }
.archive-record-controls > button { min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--accent); background: var(--accent-soft); box-shadow: none; font-size: 13px; }
.archive-record-controls .record-change-filter { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; min-height: 40px; }
.record-change-filter input { width: 18px; min-height: 18px; height: 18px; accent-color: var(--accent); }
.archive-record-summary { color: var(--muted); font-size: 12px; line-height: 1.7; margin-block: 6px 12px; }
.archive-timeline-row { scroll-margin-block: 70px 12px; }
.archive-timeline-row.is-located { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.record-inference { display: block; margin-top: 4px; color: var(--accent-warm); font-weight: 400; font-size: 11px; }
#detailLifeHistory, #detailRenameHistory { scroll-margin-top: 70px; }
.guild-compare-side .compare-detail-open { position: relative; inset: auto; z-index: auto; width: 100%; height: 44px; min-height: 44px; margin-top: 10px; padding: 8px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; color: var(--accent); background: transparent; box-shadow: none; font-size: 12px; text-align: left; white-space: nowrap; }
.guild-compare-side .compare-detail-open:hover { color: var(--text); }
.guild-compare-side .compare-detail-open.has-detail-status .compare-detail-label { visibility: hidden; }
.guild-compare-side .compare-detail-open .detail-link-status { position: absolute; inset: 0; display: flex; align-items: center; margin: 0; color: var(--accent); font-size: 12px; white-space: nowrap; overflow: hidden; }
.guild-compare-picker.has-compare-share { grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr) auto; }
.guild-compare-share { display: contents; }
.guild-compare-share > .analysis-share { grid-column: 4; grid-row: 1; align-self: end; }
.guild-compare-share > .analysis-share-fallback { grid-column: 1 / -1; min-width: 0; }
@media (max-width: 600px) { .guild-compare-picker.has-compare-share { grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr) auto; } }
.guild-compare-detail-context { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--detail-surface); }
.guild-compare-detail-context > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.guild-compare-detail-context nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.guild-compare-detail-context button { min-width: 0; min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-solid); color: var(--accent); box-shadow: none; font-size: 12px; overflow-wrap: anywhere; }
.guild-compare-detail-context nav button { text-align: left; }
.guild-compare-detail-context small { display: block; font-size: 10px; color: var(--muted); margin-bottom: 4px; }
.guild-compare-detail-context button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--text); opacity: 1; }
.daily-change-headline { display: grid; gap: 8px; margin-bottom: 12px; }
.daily-change-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.daily-change-badge { flex: 0 0 auto; padding: 3px 7px; border-radius: 6px; color: var(--accent); background: var(--accent-soft); font-size: 11px; line-height: 1.6; }
.daily-change-title > strong { min-width: 0; font-size: 19px; line-height: 1.6; overflow-wrap: anywhere; }
.daily-change-main > strong { font-size: 16px; font-weight: 700; color: var(--text); }
#changeDialog[data-kind="daily"] #changeDialogTitle { font-size: 27px; font-weight: 700; line-height: 1.35; color: var(--text); overflow-wrap: anywhere; }
@media (max-width: 780px) {
  #changeDialog[data-kind="daily"] #changeDialogTitle { font-size: 18px; line-height: 24px; }
  .daily-change-title > strong { font-size: 17px; line-height: 1.5; }
}
#changeDialog[data-kind="daily"] .change-summary > div { min-width: 0; min-height: 64px; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--detail-line); border-radius: 9px; background: var(--detail-surface); box-shadow: none; }
#changeDialog[data-kind="daily"] .change-summary > div > span { color: var(--detail-caption); font-size: 11px; }
#changeDialog[data-kind="daily"] .change-summary > div > strong { font-size: 19px; font-weight: 650; line-height: 1.4; }
.daily-change-headline p { margin: 0; font-size: 12px; color: var(--muted); }
.change-uncertainty { padding: 12px; border-left: 3px solid var(--accent-warm); background: var(--detail-surface); color: var(--text-secondary); font-size: 12px; line-height: 1.8; }
.daily-change-compare { display: block; }
.change-comparison-table table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13px; }
.change-comparison-table th, .change-comparison-table td { padding: 12px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.change-comparison-table thead th { color: var(--muted); font-size: 11px; font-weight: 500; background: var(--detail-surface); }
.change-comparison-table th:first-child { width: 42px; }
.change-evidence-disclosure { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; }
.change-evidence-disclosure > summary { min-height: 44px; padding: 12px; box-sizing: border-box; color: var(--accent); font-size: 13px; cursor: pointer; }
.change-evidence-disclosure .change-panel { border: 0; }
.server-detail-open { padding: 4px 0; min-height: 44px; border: 0; box-shadow: none; background: transparent; color: var(--accent); text-align: left; font: inherit; cursor: pointer; }
.mobile-power-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mobile-power-card footer .server-detail-open { flex-shrink: 0; font-size: 12px; }
.server-detail-tiers { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.server-detail-tiers button { flex: 1; min-width: 65px; min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--panel-solid); box-shadow: none; font-size: 13px; }
.server-detail-tiers button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.server-detail-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.analysis-detail-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.analysis-detail-actions .quiet-button { min-height: 44px; font-size: 12px; white-space: nowrap; }
.analysis-detail-heading { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 10px; align-items: center; min-width: 0; }
.analysis-detail-heading > strong, .analysis-detail-heading > h2 { grid-column: 2; grid-row: 1; min-width: 0; }
.analysis-detail-heading > span, .analysis-detail-heading > p { grid-column: 2; grid-row: 2; }
#serverDetailDialog .dialog-head .analysis-detail-back, #guildDrawer #closeGuildDrawer.analysis-detail-back { grid-column: 1; grid-row: 1 / 3; display: inline-grid; place-items: center; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; margin: 0; border: 0; border-radius: 6px; background: transparent; box-shadow: none; color: var(--text); }
.analysis-detail-back svg { width: 18px; height: 18px; }
#serverDetailDialog .dialog-head .analysis-detail-back:hover, #guildDrawer #closeGuildDrawer.analysis-detail-back:hover { background: var(--detail-hover); }
.analysis-detail-back:focus-visible, .analysis-detail-footer > button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#serverDetailTitle[tabindex="-1"]:focus, #guildDrawerTitle[tabindex="-1"]:focus { outline: none; box-shadow: none; }
#serverDetailDialog .dialog-head { flex-wrap: wrap; }
#serverDetailDialog .dialog-head > div:first-child { flex: 1 1 160px; min-width: 0; }
#serverDetailDialog .dialog-head > .analysis-detail-heading { grid-template-columns: 44px minmax(0, 1fr); }
#serverDetailDialog .dialog-head #serverDetailMeta { margin-top: 2px; }
#serverDetailDialog .analysis-detail-actions { position: relative; margin-left: auto; }
.server-detail-sharing.analysis-share { position: static; }
.server-detail-sharing .analysis-share-toggle { width: 44px; min-height: 44px; padding: 0; justify-content: center; }
#serverShareFallback { margin-top: 16px; }
.analysis-detail-pin { display: inline-flex; align-items: center; justify-content: center; width: 36px; min-height: 44px; padding: 6px; border: 0; background: transparent; box-shadow: none; color: var(--muted); }
.analysis-detail-pin svg { width: 18px; height: 18px; }
.analysis-detail-pin[hidden] { display: none; }
.analysis-detail-pin[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.analysis-detail-pin:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.server-detail-options { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -4px 0 12px; }
.server-detail-options .matrix-toggle { min-height: 44px; margin: 0; }
.server-detail-options small { color: var(--muted); font-size: 11px; white-space: nowrap; }
@media (max-width: 1279px) { .analysis-detail-pin { display: none; } }
.server-detail-metrics > div { display: grid; gap: 8px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--detail-surface); }
.server-detail-metrics span { font-size: 12px; color: var(--muted); }
.server-detail-metrics strong { font-size: 22px; font-variant-numeric: tabular-nums; color: var(--power-num); overflow-wrap: anywhere; }
.server-detail-scope { margin-top: 22px; font-size: 13px; line-height: 1.8; color: var(--muted); }
.server-detail-scope h3 { color: var(--text); font-size: 15px; }
#serverDetailDialog .dialog-head > div { min-width: 0; }
#serverDetailDialog .dialog-head > button { flex-shrink: 0; min-height: 44px; font-size: 12px; }
#serverDetailDialog .dialog-head span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.archive-trend-section > summary:focus-visible, .archive-record-heading > button:focus-visible, .roster-controls :focus-visible, .detail-list-pager button:focus-visible, .archive-record-controls :focus-visible, .guild-compare-detail-context button:focus-visible, .compare-detail-open:focus-visible, .server-detail-open:focus-visible, .server-detail-tiers button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#detailBottomActions { display: none; }

#changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-change-overview { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; padding: 10px 12px; }
#changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-change-overview > div { border: 0; padding: 0; }
#changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-current { order: 0; grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; align-items: baseline; }
#changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-current > span { grid-column: 1 / -1; white-space: normal; font-size: 11px; line-height: 1.5; }
#changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-current > strong { margin: 2px 0; font-size: 21px; line-height: 1.35; white-space: normal; }
#changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-current > small { text-align: right; font-size: 11px; white-space: normal; line-height: 1.5; }
#changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-delta { order: 1; grid-column: 1; align-self: center; margin: 0; }
#changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-delta > span,
#changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-delta > small { display: none; }
#changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-delta > strong { margin: 0; font-size: 12px; font-weight: 500; white-space: normal; line-height: 1.6; }
#changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-more { order: 2; grid-column: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; width: auto; min-height: 44px; padding: 4px 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 12px; color: var(--muted); }
#changeDialog #guildOverviewHistoryDate { display: none; }
#changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-previous { display: none; order: 3; grid-column: 1 / -1; }
#changeDialog.is-drawer.is-guild-change:not(.share-card) .is-history-expanded > .guild-overview-previous { display: block; border-top: 1px solid var(--line); padding-top: 8px; }
#changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-previous > span,
#changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-previous > small { white-space: normal; font-size: 11px; line-height: 1.6; }
#changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-previous > strong { font-size: 18px; line-height: 1.5; }

@media (max-width: 360px) {
  .archive-record-controls { grid-template-columns: minmax(0, 1fr) auto; }
  .archive-record-controls > label:first-child { grid-column: 1 / -1; }
}

@media (max-width: 780px) {
  #changeDialog.is-drawer:not(.share-card) .player-fact { padding: 10px 8px; }
  #changeDialog .player-fact.is-rank > strong, #changeDialog .player-fact.is-power > strong { font-size: 19px; }
  #changeDialog .player-fact-change { font-size: 10px; }
  #changeDialog.is-drawer:not(.share-card) .player-fact.is-guild { padding-right: 20px; }
  #changeDialog .player-fact .guild-link-chevron { right: 5px; }
  #changeDialog.is-drawer:not(.share-card) .dialog-head #changeDialogMeta { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.5; }
  #changeDialog.is-drawer:not(.share-card) .change-dialog-body { padding-bottom: 16px; }
  #changeDialog.is-drawer:not(.share-card) .archive-action-bar { display: none; }
  #changeDialog.is-drawer:not(.share-card) .archive-power-detail-link #viewTimelineBtn { min-height: 44px; }
  #changeDialog.is-drawer:not(.share-card) .detail-mobile-footer,
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .detail-mobile-footer { display: flex; gap: 10px; }
  #changeDialog #detailBottomBack, #serverDetailBottomBack, #guildDetailBottomBack { flex: 1; width: auto; max-width: none; min-width: 0; }
  .detail-mobile-footer > button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .detail-mobile-footer > button svg { flex-shrink: 0; }
  #detailBottomActions:not(:empty) { display: flex; flex: 1; min-width: 0; }
  #detailBottomActions button { flex: 1; min-height: 44px; }
  .roster-controls input, .roster-controls select, .archive-record-controls input:not([type="checkbox"]), .archive-record-controls select, .archive-record-controls > button, .guild-people-tabs button, .player-trend-period button { min-height: 44px; }
  .roster-controls > button { min-height: 44px; }
  .roster-controls input { font-size: 16px; }
  .archive-life.is-journey .archive-life-head, .archive-life.is-journey .archive-life-row { grid-template-columns: minmax(0, 1fr) 80px minmax(0, 1fr); gap: 6px; }
  .archive-life.is-journey .journey-record-note > summary { min-height: 44px; }
  .archive-life.is-journey .archive-life-guild .detail-link { min-height: 44px; }
  #changeDialog.is-drawer.is-guild-change:not(.share-card) .guild-overview-current > small { grid-column: 1 / -1; text-align: left; }
  #serverDetailDialog.change-dialog.is-drawer { inset: 0; width: 100%; border-radius: 0; }
  #serverDetailDialog .dialog-head, #guildDrawer .guild-drawer:not(.guild-inline) > header { flex-wrap: nowrap; gap: 4px; padding: max(8px, env(safe-area-inset-top)) 12px 8px; }
  .analysis-detail-heading { column-gap: 4px; }
  #serverDetailDialog .dialog-head .analysis-detail-back, #guildDrawer #closeGuildDrawer.analysis-detail-back { align-self: start; border-radius: 50%; -webkit-tap-highlight-color: transparent; }
  #serverDetailDialog .analysis-detail-back svg, #guildDrawer #closeGuildDrawer.analysis-detail-back svg { width: 22px; height: 22px; stroke-width: 2; }
  #serverDetailDialog .analysis-detail-back:focus-visible, #guildDrawer #closeGuildDrawer.analysis-detail-back:focus-visible { outline-offset: -5px; }
  #serverDetailDialog .dialog-head > .analysis-detail-heading > strong, #guildDrawer .analysis-detail-heading > h2 { font-size: 18px; line-height: 24px; }
  #serverDetailDialog .dialog-head #serverDetailMeta, #guildDrawer .analysis-detail-heading > p { font-size: 10px; line-height: 1.5; margin: 0; }
  #guildDrawer .guild-drawer > footer:not(.analysis-detail-footer) { padding-bottom: 12px; }
  .server-detail-tiers { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .server-detail-tiers button { min-width: 0; padding-inline: 2px; font-size: 12px; }
}

/* Match destination names to the existing positive power-change color. */
.change-dashboard { --change-positive-text: #0f766e; }
:root[data-theme="dark"] .change-dashboard { --change-positive-text: #79bbaa; }
.change-dashboard .daily-change-main .daily-change-current,
.change-dashboard .daily-change-row .delta-up {
  color: var(--change-positive-text);
}
.change-dashboard .daily-change-main .daily-change-current {
  font-size: inherit;
  font-weight: inherit;
}

/* Keep the power anchor while distributing space across the right-hand columns. */
@media (min-width: 801px) {
  .change-dashboard .daily-change-row {
    grid-template-columns: 86px minmax(0, 1fr) calc(112px + 2%) calc(80px + 2%) calc(64px + 1%) minmax(180px, 27%);
  }
}

/* The existing row opens the full evidence; this corner mark adds no grid width. */
.change-dashboard .status-badge.has-suspected { position: relative; overflow: visible; }
.change-dashboard .change-suspected-mark {
  position: absolute; right: -3px; top: -5px; display: grid; place-items: center;
  width: 15px; height: 15px; box-sizing: border-box; border: 1px solid #c59752;
  border-radius: 4px; background: #fffaf1; color: #87580f; font-size: 10px; line-height: 1;
  font-weight: 500; pointer-events: none;
}
:root[data-theme="dark"] .change-dashboard .change-suspected-mark {
  background: #392e20; color: #e8c37d; border-color: #a5844b;
}

/* Keep a short change list from clipping the open image-sharing controls. */
.ranking-list.has-open-change-share,
.ranking-list.has-open-change-share .change-dashboard.has-page-share { overflow: visible; }

/* Keep query feedback and actions within the filter row. */
.empty.change-scope-entry { display:block; padding:32px 24px 20px; }
.empty.change-scope-entry[hidden] { display:none; }
.change-scope-copy { max-width:520px; margin:auto; }
.change-scope-copy h2 { margin:0 0 18px; color:var(--text-secondary); font-family:inherit; font-size:16px; font-weight:700; line-height:1.5; }
.change-scope-primary { display:inline-flex; justify-content:center; align-items:center; min-height:44px; padding:8px 20px; }
.change-scope-quick { margin:16px auto 0; max-width:460px; }
.change-scope-quick > div { display:flex; justify-content:center; flex-wrap:wrap; gap:12px; }
.change-scope-quick button { min-height:44px; padding:8px 16px; background:transparent; color:var(--muted); border-color:var(--line); box-shadow:none; }
.change-scope-picker { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; max-width:520px; margin:16px auto 0; }
.change-scope-picker[hidden],.change-scope-quick[hidden] { display:none; }
.change-scope-picker button { min-height:44px; min-width:0; padding:8px 16px; }
.change-scope-footer { margin:12px auto 0; }
.change-scope-footer button { min-height:44px; padding:8px 20px; background:transparent; color:var(--muted); border-color:var(--line); box-shadow:none; }
@media(max-width:800px) {
  .empty.change-scope-entry { padding:28px 20px 20px; }
  .change-scope-quick > div { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  .change-scope-quick button { padding:8px; }
}
.archive-lookup > strong { display: block; color: var(--text-secondary); font-size: 16px; }
.archive-lookup > p { margin: 10px auto 18px; max-width: 420px; line-height: 1.8; }
.archive-lookup-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.archive-lookup-actions > button { min-height: 44px; padding: 8px 20px; }
.archive-lookup-actions > [data-browse-archives] { background: transparent; color: var(--muted); border-color: var(--line); }
.query-submit-field { display: flex; align-items: center; justify-content: end; gap: 8px; min-width: 0; align-self: center; }
.query-submit-field small { color: var(--accent); font-size: 12px; line-height: 1.5; white-space: nowrap; }
.query-action-buttons { display: flex; flex: none; align-items: center; gap: 12px; }
.filter-reset-phone { display: none; }
.filter-shell #rankingFilters .query-action-buttons #filterResetField { position: static; inset: auto; min-width: 48px; margin: 0; padding: 0; }
.filter-shell #rankingFilters .query-action-buttons #filterResetBtn { width: 48px; height: 32px; min-height: 32px; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: transparent; box-shadow: none; font-size: 12px; }
.filter-shell #rankingFilters .query-action-buttons #filterResetBtn::after { content: none; }
.filter-shell #rankingFilters .query-submit { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 32px; min-height: 32px; padding: 0 4px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent); color: var(--bg); box-shadow: none; cursor: pointer; font: inherit; font-size: 13px; white-space: nowrap; }
.query-submit:hover { background: var(--accent-strong); }
.query-submit:disabled { opacity: .65; cursor: wait; }
.filter-shell #rankingFilters .query-submit-field[data-dirty="true"] .query-submit:not(:disabled) { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft), 0 2px 4px #173c3020; font-weight: 600; }
@keyframes query-pending-breathe {
  0%, 100% { box-shadow: 0 0 0 1px var(--accent-soft), 0 1px 3px #173c3018; }
  50% { box-shadow: 0 0 0 4px var(--focus-ring), 0 2px 5px #173c3020; }
}
@media (min-width: 801px) and (prefers-reduced-motion: no-preference) {
  :root:not([data-motion="quiet"]) .filter-shell #rankingFilters .query-submit-field[data-dirty="true"] .query-submit:not(:disabled) { animation: query-pending-breathe 2.8s ease-in-out infinite; }
}
#searchInput::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; width: 28px; height: 28px; margin: 0 -6px 0 4px; cursor: pointer; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Cpath d='m10 10 8 8m0-8-8 8' fill='none' stroke='%237b8581' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center / 28px 28px no-repeat; }
.query-submit-field[data-phase="error"] small { display: none; }
.query-status { margin: 6px 0; padding: 0 4px; color: var(--bad); font-size: 12px; line-height: 1.6; }
.query-status[hidden], .query-submit-field[hidden], .query-submit-field [hidden] { display: none !important; }
.server-select-group { position: relative; display: flex; min-width: 0; width: 100%; }
.server-select-group > #serverSelect { flex: 1; min-width: 0; }
.change-default-toggle { display: none; }
.server-filter-field > label { display: block; }
.change-default-panel { position: absolute; z-index: 40; top: calc(100% + 7px); right: 0; width: 276px; max-width: calc(100vw - 36px); padding: 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel-solid); color: var(--text); box-shadow: var(--shadow-float); font-size: 12px; font-weight: 400; }
.change-default-panel[hidden] { display: none; }
.change-default-panel header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.change-default-panel header strong { font-size: 13px; }
.change-default-panel header button { width: 28px; min-height: 28px; padding: 0; border: 0; background: transparent; color: var(--muted); box-shadow: none; font-size: 20px; font-weight: 400; }
.change-default-panel p { margin: 8px 0 12px; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.7; }
.change-default-panel [data-change-default-saved] { color: var(--text-secondary); }
.change-default-panel > button { display: block; width: 100%; min-height: 36px; padding: 6px 8px; font-size: 12px; font-weight: 500; line-height: 1.5; white-space: normal; box-shadow: none; }
.change-default-panel .change-default-save { border: 1px solid var(--accent); background: var(--accent); color: var(--bg); }
.change-default-panel .change-default-clear { margin-top: 5px; border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 400; }
.change-default-status:empty { display: none; }
.analysis-mode .query-status, .analysis-mode .query-submit-field { display: none; }
.change-server-settings { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.change-server-settings[hidden] { display: none; }
.change-range-custom, .change-range-caption { display: none; }
.change-server-settings #changeServerPreference { white-space: normal; font-size: 12px; line-height: 1.6; }
.ranking-busy { flex-wrap: nowrap; align-items: center; gap: 8px; background: var(--panel-solid); }
.ranking-list.is-refreshing .change-overview { position: static; }
.ranking-busy .query-wait-heading { flex-wrap: wrap; gap: 2px 12px; }
.ranking-busy .query-wait-heading > strong { white-space: normal; }
.ranking-wait-actions { display: flex; flex: none; gap: 0; align-items: center; pointer-events: auto; border-left: 1px solid var(--line); }
.ranking-wait-actions[hidden] { display: none; }
.ranking-wait-actions button { width: 44px; min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--accent); box-shadow: none; font-size: 12px; font-weight: 500; }
.ranking-wait-actions [data-ranking-wait-action="stop"] { color: var(--muted); }
.ranking-wait-actions button:hover, .ranking-wait-actions button:active { background: var(--accent-soft); box-shadow: none; }
@media (min-width: 801px) {
  .filter-shell #rankingFilters .server-filter-field > label { display: none; }
  .filter-shell #rankingFilters.is-change-mode #changeServerSettings { grid-column: 4 / -1; grid-row: 2; }
  .filter-shell #rankingFilters.is-change-mode #saveChangeServer { height: 32px; min-height: 32px; }
  :root .app-shell > .filter-shell[data-filtered="true"] { border-color: var(--line-strong); background: var(--accent-soft); background: color-mix(in srgb,var(--accent) 8%,var(--panel-solid)); box-shadow: inset 3px 0 0 var(--accent), 0 1px 3px #173c3009; }
  .filter-shell #rankingFilters input.is-applied-filter,
  .filter-shell #rankingFilters select.is-applied-filter { background: var(--accent-soft); background: color-mix(in srgb,var(--accent) 4%,var(--panel-solid)); border-color: var(--line-strong); border-color: color-mix(in srgb,var(--accent) 30%,var(--line)); }
  .filter-shell #rankingFilters:not(.is-archive-mode):not(.is-change-mode):not(.is-guild-compare-mode) { grid-template-columns: minmax(165px,1fr) repeat(2,minmax(90px,.85fr)) minmax(110px,1fr) minmax(180px,1.6fr) auto; align-items: center; }
  .filter-shell #rankingFilters.is-archive-mode { grid-template-columns: repeat(2,minmax(100px,.8fr)) minmax(120px,1fr) minmax(180px,1.6fr) auto; grid-template-areas: "region server guild search query"; }
  #rankingFilters.is-archive-mode > .query-submit-field { grid-area: query; }
  .filter-shell #rankingFilters.is-change-mode { grid-template-columns: repeat(2,minmax(130px,1fr)) repeat(2,minmax(100px,.85fr)) minmax(120px,1fr) minmax(140px,1.2fr) auto; align-items: center; }
  #rankingFilters.is-change-mode .change-range-quick { grid-column: 1 / 4; grid-row: 2; }
  #rankingFilters.is-guild-compare-mode { grid-template-columns: minmax(140px,1fr) repeat(2,minmax(120px,1fr)) auto; }
}
/* The approved compact layout uses the middle desktop range only. */
@media (min-width: 801px) and (max-width: 1100px) {
  .filter-shell #rankingFilters.is-change-mode { grid-template-columns: repeat(11, minmax(0, 1fr)) 64px; gap: 6px; align-items: center; }
  .filter-shell #rankingFilters.is-change-mode > #baseDateField { grid-column: 1 / 4; grid-row: 1; }
  .filter-shell #rankingFilters.is-change-mode > .primary-date-field { grid-column: 4 / 7; grid-row: 1; }
  .filter-shell #rankingFilters.is-change-mode > #regionFilterField { grid-column: 7 / 10; grid-row: 1; }
  .filter-shell #rankingFilters.is-change-mode > #serverFilterField { grid-column: 10 / 13; grid-row: 1; }
  .filter-shell #rankingFilters.is-change-mode > #changeRangeQuick { grid-column: 1 / 3; grid-row: 2; display: block; min-height: 32px; padding: 0; }
  .filter-shell #rankingFilters.is-change-mode #changeRangeMobileSelect { display: inline-flex; align-items: center; justify-content: space-between; width: 100%; min-width: 0; }
  .filter-shell #rankingFilters.is-change-mode #changeRangeQuick > .filter-caption,
  .filter-shell #rankingFilters.is-change-mode #changeRangeQuick > .change-range-caption,
  .filter-shell #rankingFilters.is-change-mode #changeRangeQuick > .change-range-buttons { display: none; }
  .filter-shell #rankingFilters.is-change-mode > .guild-filter-field { grid-column: 3 / 5; grid-row: 2; }
  .filter-shell #rankingFilters.is-change-mode > .search-field { grid-column: 5 / 12; grid-row: 2; padding-right: 0; }
  .filter-shell #rankingFilters.is-change-mode > .query-submit-field { grid-column: 12; grid-row: 2; }
  .filter-shell #rankingFilters.is-change-mode > #changeServerSettings { display: none; }
  .filter-shell #rankingFilters.is-change-mode #serverSelect { border-radius: 8px 0 0 8px; border-right: 0; }
  .filter-shell #rankingFilters.is-change-mode .change-default-toggle { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 64px; min-height: 32px; height: 32px; padding: 0 4px; border: 1px solid var(--line-strong); border-radius: 0 8px 8px 0; background: var(--panel-solid); color: var(--muted); box-shadow: none; font-size: 11px; font-weight: 500; white-space: nowrap; }
  .filter-shell #rankingFilters.is-change-mode .change-default-toggle[data-default-state="current"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
  .filter-shell #rankingFilters.is-change-mode .change-default-toggle[data-default-state="other"] { background: var(--surface-warm); color: var(--text-secondary); }
  .filter-shell #rankingFilters.is-change-mode .change-default-toggle[aria-expanded="true"] { border-color: var(--accent); }
  .filter-shell #rankingFilters.is-archive-mode { grid-template-columns: minmax(100px, .75fr) minmax(100px, .75fr) minmax(130px, 1fr) minmax(180px, 1.8fr) auto; grid-template-areas: "region server guild search query"; gap: 6px; }
  .filter-shell #rankingFilters.is-archive-mode > #regionFilterField { grid-area: region; }
  .filter-shell #rankingFilters.is-archive-mode > #serverFilterField { grid-area: server; }
  .filter-shell #rankingFilters.is-archive-mode > .guild-filter-field { grid-area: guild; }
  .filter-shell #rankingFilters.is-archive-mode > .search-field { grid-area: search; padding-right: 0; }
  .filter-shell #rankingFilters.is-archive-mode > .query-submit-field { grid-area: query; }
  .filter-shell #rankingFilters.is-archive-mode .query-action-buttons { gap: 6px; }
  .filter-shell #rankingFilters.is-archive-mode .query-action-buttons #filterResetBtn { width: 58px; white-space: nowrap; }
  .change-dashboard.has-page-share > .change-overview { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 8px 10px; }
  .change-dashboard.has-page-share .change-range-summary { justify-items: start; align-content: center; min-height: 32px; padding-right: 72px; text-align: left; }
  .change-dashboard.has-page-share > .change-page-share { align-self: end; margin: 0 10px 2px 0; }
}
@media (min-width: 1101px) and (max-width: 1180px) {
  .filter-shell #changeRangeQuick button { padding-inline: 8px; }
}
@media (max-width: 1100px) and (min-width: 801px) {
  .filter-shell #rankingFilters:not(.is-archive-mode):not(.is-change-mode):not(.is-guild-compare-mode) { grid-template-columns: repeat(4,minmax(0,1fr)); grid-template-areas: none; }
  .filter-shell #rankingFilters:not(.is-archive-mode):not(.is-change-mode):not(.is-guild-compare-mode) > .search-field { grid-area: auto; grid-column: 1 / 4; grid-row: 2; padding-right: 0; }
  .filter-shell #rankingFilters:not(.is-archive-mode):not(.is-change-mode):not(.is-guild-compare-mode) > .query-submit-field { grid-area: auto; grid-column: 4; grid-row: 2; justify-self: end; }
}
@media (max-width: 800px) {
  #rankingFilters > .query-submit-field { grid-column: 1 / -1; }
  .filter-shell #rankingFilters .query-submit { height: 38px; min-height: 38px; }
  .filter-shell #rankingFilters .query-action-buttons #filterResetBtn { height: 38px; min-height: 38px; }
}
@media (max-width: 720px) {
  .thumb-mobile .ranking-busy { top: calc(var(--mobile-toolbar-height, 0px) + 8px); z-index: 21; }
  :root .thumb-sheet #rankingFilters.is-change-mode #baseDateField,
  :root .thumb-sheet #rankingFilters.is-change-mode .primary-date-field { grid-column: auto; display: flex; flex-direction: column; gap: 4px; }
  :root .thumb-sheet #rankingFilters.is-change-mode .date-field .filter-caption { display: block; height: 16px; min-height: 16px; line-height: 16px; flex: 0 0 16px; }
  :root .thumb-sheet #rankingFilters.is-change-mode #latestDateBtn { display: none; }
  :root .thumb-sheet #rankingFilters.is-change-mode #dateInput { border: 1px solid var(--line); border-radius: 11px; }
  :root .thumb-sheet #rankingFilters .primary-date-field { gap: 4px 0; }
  :root .thumb-sheet #rankingFilters #dateInput { border-right: 0; border-radius: 11px 0 0 11px; }
  :root .thumb-sheet #rankingFilters #latestDateBtn { border-color: var(--line); border-radius: 0 11px 11px 0; }
  :root .thumb-sheet #rankingFilters .date-field::after { display: none; }
  :root .thumb-sheet #rankingFilters input[type="date"] {
    padding-inline: 8px 28px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23526761' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='5' width='16' height='16' rx='2'/%3E%3Cpath d='M8 3v4m8-4v4M4 10h16'/%3E%3C/svg%3E");
    background-position: right 8px center; background-repeat: no-repeat; background-size: 16px 16px;
  }
  :root[data-theme="dark"] .thumb-sheet #rankingFilters input[type="date"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aaba3' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='5' width='16' height='16' rx='2'/%3E%3Cpath d='M8 3v4m8-4v4M4 10h16'/%3E%3C/svg%3E");
  }
  :root .thumb-sheet #rankingFilters.is-change-mode:not(.is-range-expanded) #baseDateField,
  :root .thumb-sheet #rankingFilters.is-change-mode:not(.is-range-expanded) .primary-date-field { display: none; }
  :root .thumb-sheet #rankingFilters.is-change-mode.is-range-expanded #baseDateField { grid-column: 1; grid-row: 2; }
  :root .thumb-sheet #rankingFilters.is-change-mode.is-range-expanded .primary-date-field { grid-column: 2; grid-row: 2; }
  :root .thumb-sheet #rankingFilters #changeRangeQuick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-row: 1; gap: 0; }
  :root .thumb-sheet #rankingFilters #changeRangeMobileSelect { display: none; }
  :root .thumb-sheet #changeRangeQuick .change-range-buttons { display: contents; }
  :root .thumb-sheet #changeRangeQuick .change-range-buttons button {
    grid-row: 1; width: 100%; min-width: 0; min-height: 44px; padding: 0 3px;
    border: 1px solid var(--line); border-right: 0; border-radius: 0;
    background: var(--accent-soft); color: var(--accent); box-shadow: none; font-size: 12px;
  }
  :root .thumb-sheet #changeRangeQuick .change-range-buttons [data-change-range="yesterday"] { grid-column: 1; border-radius: 8px 0 0 8px; }
  :root .thumb-sheet #changeRangeQuick [data-change-range="last-7"] { grid-column: 2; }
  :root .thumb-sheet #changeRangeQuick [data-change-range="month"] { grid-column: 3; }
  :root .thumb-sheet #changeRangeQuick #changeRangeCustom { display: block; grid-column: 4; border-right: 1px solid var(--line); border-radius: 0 8px 8px 0; }
  :root .thumb-sheet #changeRangeQuick .change-range-buttons [aria-pressed="true"],
  :root .thumb-sheet #changeRangeQuick #changeRangeCustom[aria-expanded="true"] { background: var(--panel-solid); font-weight: 700; box-shadow: inset 0 0 0 1px var(--accent); }
  :root .thumb-sheet #changeRangeQuick .change-range-caption { display: block; grid-column: 1 / -1; grid-row: 2; padding-top: 8px; color: var(--muted); font-size: 12px; font-weight: 400; }
  :root .thumb-sheet #changeRangeQuick [data-change-range="skip-anomaly"],
  :root .thumb-sheet #changeRangeQuick [data-change-range="week"],
  :root .thumb-sheet #changeRangeQuick [data-change-range="latest"] { display: none; }
  :root .thumb-sheet #rankingFilters.is-range-expanded #changeRangeQuick [data-change-range="skip-anomaly"],
  :root .thumb-sheet #rankingFilters.is-range-expanded #changeRangeQuick [data-change-range="week"],
  :root .thumb-sheet #rankingFilters.is-range-expanded #changeRangeQuick [data-change-range="latest"] { display: block; grid-row: 3; grid-column: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: 7px; }
  :root .thumb-sheet #rankingFilters #changeServerSettings { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
  :root .thumb-sheet #rankingFilters #changeServerSettings[hidden] { display: none; }
  :root .thumb-sheet #rankingFilters #saveChangeServer { min-height: 44px; height: auto; padding: 6px 10px; font-size: 13px; }
  :root .thumb-sheet #rankingFilters #changeServerPreference { font-size: 12px; }
  :root .thumb-sheet #rankingFilters .range-reset-button { display: none; }
  :root .thumb-sheet #filterResetBtn { min-width: 72px; width: 72px; flex-basis: 72px; }
  .thumb-sheet #rankingFilters > .search-field { grid-column: 1 / -1; padding-right: 0; }
  .thumb-sheet .query-submit-field { display: flex; flex-wrap: wrap; justify-content: start; }
  .thumb-sheet .query-action-buttons { width: 100%; border: 0; background: transparent; }
  .thumb-sheet .query-action-buttons #filterResetField { flex: 1; }
  .thumb-sheet .filter-shell #rankingFilters .query-action-buttons #filterResetBtn { width: auto; min-width: 88px; height: 44px; min-height: 44px; margin-left: auto; padding: 6px 10px; border-radius: 10px; }
  .thumb-sheet .filter-reset-desktop { display: none; }
  .thumb-sheet .filter-reset-phone { display: inline-flex; align-items: center; gap: 5px; }
  .thumb-sheet .filter-shell #rankingFilters .query-action-buttons #filterResetBtn { border: 0; color: var(--accent); }
  :root body.thumb-mobile .thumb-dock > .thumb-filter.is-filtered,
  :root body.thumb-mobile .thumb-dock > .thumb-filter.is-pending { background: var(--accent-soft); background: color-mix(in srgb,var(--accent) 13%,var(--panel-solid)); box-shadow: inset 0 0 0 1px var(--line-strong); }
  :root body.thumb-mobile .thumb-dock > .thumb-filter.is-pending,
  :root body.thumb-mobile .thumb-dock > .thumb-search-open.is-pending { position: relative; }
  :root body.thumb-mobile .thumb-dock > .thumb-search-open.is-filtered,
  :root body.thumb-mobile .thumb-dock > .thumb-search-open.is-pending { background: var(--accent-soft); }
  :root body.thumb-mobile .thumb-dock > .thumb-filter.is-pending::after,
  :root body.thumb-mobile .thumb-dock > .thumb-search-open.is-pending::after { content: ''; position: absolute; top: 6px; right: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
  .thumb-sheet #rankingFilters .query-submit { display: none; }
  .thumb-sheet .thumb-done { color: var(--bg); }
  .thumb-sheet .query-submit-field:not([data-phase="error"]) small { display: none; }
  .thumb-sheet .query-submit-field[data-phase="error"] small { display: block; color: var(--bad); white-space: normal; }
  :root body.thumb-mobile .thumb-search > .thumb-clear { order: 0; flex: 0 0 44px; min-width: 44px; color: var(--muted); }
  :root body.thumb-mobile .thumb-search > .search-field { order: 1; }
  :root body.thumb-mobile .thumb-search > .thumb-search-submit { position: relative; order: 2; flex: 0 0 64px; min-width: 64px; min-height: 44px; margin: 0; padding-inline: 4px; border: 0; border-radius: 0 14px 14px 0; background: transparent; color: var(--accent); box-shadow: none; font-size: 13px; font-weight: 600; touch-action: manipulation; }
  :root body.thumb-mobile .thumb-search > .thumb-search-submit::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 1px; background: var(--line-strong); }
  :root body.thumb-mobile .thumb-search > .thumb-search-submit:disabled { opacity: .65; }
  :root body.thumb-mobile .thumb-search > .thumb-search-submit.is-pending:not(:disabled) { background: var(--accent-soft); background: color-mix(in srgb,var(--accent) 12%,var(--panel-solid)); color: var(--accent-strong); box-shadow: inset 0 0 0 1px var(--accent); }
  :root body.thumb-mobile .thumb-search > .thumb-search-submit.is-pending:not(:disabled)::before { background: var(--accent); }
  :root body.thumb-mobile .thumb-search > .thumb-search-submit.is-pending:not(:disabled)::after { content: ''; position: absolute; top: 4px; right: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
  :root body.thumb-mobile .thumb-search > .thumb-search-submit:active:not(:disabled) { background: var(--accent-soft); color: var(--accent-strong); }
  :root body.thumb-mobile .thumb-search > .thumb-search-submit:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
}
@media (max-width: 360px) {
  :root body.thumb-mobile .thumb-dock.is-searching > .thumb-filter { flex-basis: 68px; padding-inline: 4px; }
}

.site-notice[hidden], .site-notice [hidden] { display: none !important; }
#snapshotAvailabilityNotice { display: none !important; }
.app-shell.has-site-notice > .sticky-toolbar { padding-bottom: 0; }
.app-shell.has-site-notice .toolbar-card { border-bottom-left-radius: 0; border-bottom-right-radius: 0; box-shadow: none; }
.app-shell > .ranking-panel { margin-top: 8px; }
.site-notice { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; padding: 0 4px 0 14px; min-height: 36px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--card-radius) var(--card-radius); background: var(--accent-soft); color: var(--accent-strong); font-size: 13px; }
.site-notice-copy { flex: 1; min-width: 0; }
.site-notice-title { display: block; width: 100%; min-height: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: inherit; font-weight: 600; text-align: left; border: 0; padding: 0; background: transparent; color: inherit; cursor: pointer; }
.site-notice-title:disabled { cursor: default; opacity: 1; }
.site-notice-title, .site-notice-close { box-shadow: none !important; }
.site-notice-details { margin: 6px 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-secondary); line-height: 1.7; }
.site-notice-link { flex-shrink: 0; color: var(--accent); text-decoration: none; padding: 8px 0; font-size: 12px; }
.site-notice-link:hover { text-decoration: underline; }
.site-notice-close { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; min-height: 36px; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 21px; }
.site-notice-close:hover { color: var(--text); }
.site-notice :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 800px) { .site-notice-close { flex-basis: 44px; width: 44px; height: 44px; min-height: 44px; } }
@media (max-width: 420px) { .site-notice { gap: 8px; padding-left: 10px; font-size: 12px; } }


.immersive-brand { display: none; }

:root body[data-immersive] {
  --immersive-top-strip: 41px;
  --immersive-bottom-gap: 18px;
  --immersive-motion: 180ms ease-out;
}
:root body[data-immersive] .app-shell {
  padding-top: 48px;
  overflow-anchor: none;
}
body[data-immersive] :is(#backTopBtn, #pageTimeline, .site-notice) { display: none !important; }
body[data-immersive] .immersive-brand {
  position: fixed;
  inset: 0 0 auto;
  z-index: 27;
  display: flex;
  align-items: center;
  gap: 5px;
  height: var(--immersive-top-strip);
  padding-inline-start: calc(var(--immersive-shell-left, 12px) + 12px);
  border-bottom: 1px solid var(--line);
  background: var(--panel-solid);
}
.immersive-brand img { display: block; object-fit: contain; }
.immersive-brand .brand-wordmark { width: 83px; height: 31px; }
:root body[data-immersive] .app-shell > :is(.sticky-toolbar, .filter-shell) {
  position: fixed;
  inset: 0 auto auto var(--immersive-shell-left, 12px);
  width: var(--immersive-shell-width, calc(100% - 24px));
  visibility: hidden;
  pointer-events: none;
}
body[data-immersive] .app-shell > .analysis-tabs { display: none; }
body.immersive-returning .app-shell > :is(.sticky-toolbar, .filter-shell) {
  animation: immersive-return-controls 120ms ease-out both;
}
@keyframes immersive-return-controls {
  from { opacity: 0; translate: 0 -4px; }
  to { opacity: 1; translate: 0 0; }
}

:root body[data-immersive] .app-shell > .pager,
:root body[data-immersive] > .thumb-dock {
  margin-bottom: 0;
  transition: opacity var(--immersive-motion), margin-bottom var(--immersive-motion), visibility 0s;
}
:root body[data-immersive-bottom] .app-shell > .pager,
:root body[data-immersive-bottom] > .thumb-dock {
  margin-bottom: var(--immersive-bottom-gap);
}
:root body[data-immersive]:not([data-immersive-bottom]) .app-shell > .pager,
:root body[data-immersive]:not([data-immersive-bottom]) > .thumb-dock {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition-delay: 0s, 0s, 180ms;
}
.immersive-handle {
  position: fixed;
  left: var(--immersive-axis, 50%);
  transform: translateX(-50%);
  z-index: 48;
  display: grid;
  place-items: center;
  width: 64px;
  height: 16px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  box-shadow: none;
}
.immersive-handle::before {
  content: "";
  width: 26px;
  height: 4px;
  border-radius: 3px;
  background: currentColor;
  opacity: .54;
}
.immersive-handle:hover,
.immersive-handle:active { transform: translateX(-50%); box-shadow: none; background: transparent; }
.immersive-handle:hover::before, .immersive-handle[aria-expanded="true"]::before { opacity: .95; }
.immersive-handle:focus-visible { outline-offset: -2px; }
#immersiveTop {
  top: 0;
  left: 0;
  width: 100%;
  height: var(--immersive-top-strip);
  border-radius: 0;
  transform: none;
}
#immersiveTop::before {
  position: absolute;
  top: 50%;
  left: var(--immersive-axis, 50%);
  transform: translate(-50%, -50%);
}
#immersiveBottom { bottom: 0; bottom: env(safe-area-inset-bottom, 0px); }
#immersiveHint {
  position: absolute;
  top: 50%;
  left: calc(var(--immersive-axis, 50%) + 22px);
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms linear;
}
#immersiveTop[data-exit-hint] #immersiveHint,
#immersiveTop:focus-visible #immersiveHint { opacity: 1; }
@media (hover: hover) {
  #immersiveTop:hover #immersiveHint { opacity: 1; }
}
@media (max-width: 720px) {
  :root body[data-immersive] { --immersive-bottom-gap: 42px; }
  body.thumb-mobile[data-immersive-bottom] {
    padding-bottom: calc(64px + var(--immersive-bottom-gap) + env(safe-area-inset-bottom));
  }
  #immersiveBottom { height: 41px; }
}
