* { box-sizing: border-box; }

html,
body { height: 100%; overflow: hidden; }

body { margin: 0; background: var(--page); color: var(--ink); }
button { font: inherit; }

/* The shared header remains available for the account menu, but its navigation is hidden for this focused dashboard. */
.site-header { min-height: 54px; background: var(--page); }
.site-header .site-header-inner { min-height: 54px; justify-content: flex-end; padding-inline: 16px; }
.site-header .site-brand,
.site-header .site-nav { display: none; }
.site-header .site-account-trigger { width: 42px; height: 42px; }
.site-header .site-account-icon,
.site-header .site-account-avatar { width: 28px; height: 28px; }

.rank-page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  height: calc(100dvh - 54px);
  padding-block: 12px 14px;
}

.rank-appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.rank-kicker,
.rank-panel-kicker {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.rank-customizer h2 { margin: 0; line-height: 1.15; }

.rank-customize-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  font-size: .78rem;
  font-weight: 800;
}

.rank-customize-button:hover,
.rank-customize-button[aria-expanded="true"] { border-color: var(--accent-strong); background: var(--control-hover); }
.rank-customize-button svg { width: 17px; height: 17px; }

.rank-workspace { min-height: 0; }

.rank-panel,
.rank-customizer {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.rank-currencies-panel { min-height: 0; overflow: hidden; }
.rank-panel-heading,
.rank-customizer-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.rank-live { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .7rem; white-space: nowrap; }
.rank-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.rank-currency-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
}

.rank-currency-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.rank-currency-card[hidden] { display: none; }
.rank-currency-top,
.rank-currency-bottom { display: flex; align-items: center; gap: 7px; }
.rank-currency-top strong { overflow: hidden; font-family: var(--font-latin); font-size: .85rem; letter-spacing: .04em; text-overflow: ellipsis; }
.rank-asset-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--muted); }
.rank-asset-dot.is-positive { background: var(--accent); }
.rank-asset-dot.is-negative { background: var(--ink); }
.rank-gold-icon { display: inline-grid; width: 34px; height: 34px; place-items: center; flex: 0 0 auto; border: 1px solid var(--accent-strong); border-radius: 50%; background: var(--accent); color: var(--on-accent); font-family: var(--font-latin); font-size: .72rem; font-weight: 900; }
.rank-gold-icon-mini { width: 18px; height: 18px; font-size: .48rem; }
.rank-currency-meter { height: 7px; overflow: hidden; border-radius: 99px; background: var(--field); }
.rank-meter-fill { display: block; width: var(--rank-meter); height: 100%; border-radius: inherit; }
.rank-meter-fill.is-positive { background: var(--accent); }
.rank-meter-fill.is-negative { background: var(--ink); }
.rank-meter-fill.is-neutral { background: var(--muted); }
.rank-currency-bottom { justify-content: flex-end; color: var(--muted); font-size: .67rem; }
.rank-currency-bottom .rank-change { font-family: var(--font-latin); font-weight: 800; }
.is-positive { color: var(--accent-strong); }
.is-negative { color: var(--ink); }
.is-neutral { color: var(--muted); }

.rank-currency-grid[data-layout="bars"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rank-currency-grid[data-layout="bars"] .rank-currency-card { padding: 14px; }
.rank-currency-grid[data-layout="bars"] .rank-currency-meter { height: 12px; }
.rank-currency-grid[data-layout="compact"] { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.rank-currency-grid[data-layout="compact"] .rank-currency-card { gap: 4px; padding: 8px; }
.rank-currency-grid[data-layout="compact"] .rank-currency-bottom { font-size: .6rem; }

.rank-customizer { position: relative; padding: 14px 16px; }
.rank-customizer[hidden] { display: none; }
.rank-close { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; font-size: 1.15rem; line-height: 1; }
.rank-layout-options { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; color: var(--muted); font-size: .76rem; font-weight: 800; }
.rank-layout-options > div { display: flex; gap: 5px; }
.rank-layout-options button { padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--field); color: var(--ink); cursor: pointer; font-size: .72rem; font-weight: 800; }
.rank-layout-options button.is-active { border-color: var(--accent-strong); background: var(--accent); color: var(--on-accent); }
.rank-currency-options { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: .72rem; font-weight: 800; }
.rank-currency-options > span { margin-inline-end: 4px; }
.rank-currency-options label { display: inline-flex; align-items: center; gap: 4px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); color: var(--ink); cursor: pointer; font-family: var(--font-latin); font-size: .68rem; }
.rank-currency-options input { accent-color: var(--accent-strong); }
.rank-status { min-height: 14px; margin: 0; color: var(--muted); font-size: .67rem; text-align: center; }

@media (max-width: 800px) {
  .rank-page { padding-inline: 14px; }
  .rank-currency-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rank-currency-grid[data-layout="compact"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .rank-page { gap: 8px; padding-block: 8px 10px; }
  .rank-currencies-panel { min-height: 0; }
  .rank-customizer { max-height: 48dvh; overflow-y: auto; }
  .rank-layout-options { align-items: flex-start; flex-direction: column; gap: 6px; }
}
