/* The host layout uses --header-h to place the controls and model below it. */
.dashboard-mode {
  --header-h: 74px;
}
.dashboard-mode .topbar {
  height: var(--header-h);
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}
.dashboard-mode .page-name {
  display: block;
  min-width: 0;
  text-align: center;
}
.dashboard-mode .page-name h1 {
  margin: 0 0 4px;
  color: #ecfbff;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 1.2px;
  line-height: 1.25;
  white-space: nowrap;
  text-shadow: 0 0 24px #25deef35;
}
.dashboard-mode .page-name > div > span {
  display: inline;
  font-size: 9px;
  line-height: 1.2;
}
@media (min-width: 1101px) and (max-width: 1399px) {
  .dashboard-mode .page-name h1 {
    font-size: 28px;
    letter-spacing: .8px;
  }
}
@media (max-width: 1100px) {
  .dashboard-mode {
    --header-h: 112px;
  }
  .dashboard-mode .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 32px 56px;
    gap: 8px 12px;
    padding: 8px 16px;
  }
  .dashboard-mode .topbar .brand {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
  }
  .dashboard-mode .topbar .header-right {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
  }
  .dashboard-mode .page-name {
    grid-column: 1 / -1;
    grid-row: 2;
    align-self: center;
    justify-self: stretch;
    width: 100%;
  }
  .dashboard-mode .page-name h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: .5px;
    white-space: normal;
    overflow-wrap: anywhere;
    text-wrap: balance;
  }
  .dashboard-mode .page-name > div > span {
    display: none;
  }
}
@media (max-width: 399px) {
  .dashboard-mode .topbar {
    column-gap: 8px;
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* All three ranking pages share a clear, consistent numeric column. */
.dashboard-mode .op-card-rank .op-rank-row {
  grid-template-columns: 18px minmax(0, 1fr) 55px;
  min-height: 20px;
  gap: 7px;
}
.dashboard-mode .op-card-rank .op-rank-row > em {
  color: #c3f8ff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .1px;
  text-shadow: 0 0 10px #25deef24;
}
@supports (-webkit-background-clip: text) or (background-clip: text) {
  .dashboard-mode .op-card-rank .op-rank-row > em {
    background: linear-gradient(110deg, #e5fdff 5%, #8bebff 60%, #8ebdff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
@media (max-width: 399px) {
  .dashboard-mode .op-card-rank .op-rank-row {
    grid-template-columns: 18px minmax(0, 1fr) 51px;
    gap: 6px;
  }
  .dashboard-mode .op-card-rank .op-rank-row > em {
    font-size: 15px;
  }
}

/* A reserved close column cannot be squeezed by the dialog's full title. */
.dashboard-mode .op-device-dialog-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  grid-template-rows: 22px 14px;
  align-content: center;
  align-items: center;
  gap: 4px 12px;
  min-height: 72px;
  height: 72px;
  padding: 12px 16px;
}
.dashboard-mode .op-device-dialog-header h2 {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  margin: 0;
  color: #e7faff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .6px;
  white-space: nowrap;
}
.dashboard-mode .op-device-dialog-header small {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
  margin: 0;
  color: #9abbcd;
  font-size: 10px;
  line-height: 1.4;
  white-space: nowrap;
}
.dashboard-mode .op-device-close {
  grid-column: 2;
  grid-row: 1 / 3;
  justify-self: end;
  align-self: center;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid #62dceb66;
  border-radius: 7px;
  color: #c4f4ff;
  background: #25deef13;
  line-height: 1;
  cursor: pointer;
  transition: color .18s, background .18s, border-color .18s, box-shadow .18s;
}
.dashboard-mode .op-device-close svg {
  display: block;
  width: 18px;
  height: 18px;
  pointer-events: none;
}
.dashboard-mode .op-device-close:hover {
  color: #fff;
  background: #25deef29;
  border-color: #99f2ff;
  box-shadow: 0 0 14px #25deef25;
}
.dashboard-mode .op-device-close:focus-visible {
  outline: 2px solid #b6f7ff;
  outline-offset: 3px;
  border-color: #b6f7ff;
  background: #25deef24;
}
.dashboard-mode .op-device-full-list {
  max-height: calc(min(680px, 100dvh - 48px) - 72px);
}
@media (max-width: 399px) {
  .dashboard-mode .op-device-dialog-header {
    column-gap: 10px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .dashboard-mode .op-device-dialog-header h2 {
    font-size: 15px;
    letter-spacing: .3px;
  }
  .dashboard-mode .op-device-full-list > li {
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr) 70px;
  }
  .dashboard-mode .op-device-full-list :is(.op-dev-area, .op-dev-name) {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dashboard-mode .op-device-close {
    transition: none;
  }
}
