/* Account page: profile and password panels, viewing history list. Loaded after the main parts. */
.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
  margin: 26px 0 34px;
}
.account-grid .panel {
  padding: 26px;
  border-radius: 16px;
}
.account-grid h2 {
  margin: 0 0 16px;
  font-size: 22px;
}
.account-grid .stack {
  display: grid;
  gap: 14px;
}
.account-grid label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}
.history-list {
  display: grid;
  gap: 12px;
}
.history-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.history-poster {
  display: block;
  width: 64px;
  height: 90px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(127, 127, 127, 0.18);
}
.history-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.history-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.history-title {
  overflow: hidden;
  font-size: 18px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-meta {
  font-size: 15px;
  color: var(--muted);
}
.history-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(127, 127, 127, 0.25);
}
.history-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
}
@media (max-width: 560px) {
  .history-item {
    grid-template-columns: 52px minmax(0, 1fr);
  }
  .history-item .btn {
    grid-column: 1 / -1;
  }
  .history-poster {
    width: 52px;
    height: 74px;
  }
}

/* Bell with unread badge in the top bar */
.bell {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 19px;
}
.bell-count {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 20px;
  padding: 0 5px;
  border-radius: 99px;
  background: #d6334f;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
}

/* Keep the top bar inside narrow screens now that it also holds the bell. */
@media (max-width: 520px) {
  .topbar .top-actions {
    gap: 6px;
  }
  .topbar .top-actions .btn.small {
    padding-inline: 10px;
  }
  .topbar .bell {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }
  .topbar .brand {
    font-size: 20px;
  }
  /* Logout moves to the account page on phones to save room. */
  .topbar [data-act="logout"] {
    display: none;
  }
}
.account-logout {
  margin-top: 14px;
}
@media (min-width: 521px) {
  .account-logout {
    display: none;
  }
}
