.app-secondary-page[hidden] { display: none !important; }
.app-secondary-page:not([hidden]) { display: block; }
body.app-secondary-view #fixedHeader,
body.app-secondary-view .music-section,
body.app-secondary-view .playlist-view,
body.app-secondary-view #playlistFullscreen { display: none !important; }
body.app-secondary-view .player-bar { z-index: 9999; }

.profile-settings-shell,
.downloads-shell {
  width: min(100% - 32px, 920px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(28px, 6vh, 64px) 0 150px;
}

#profileSettingsView { color: #f7f7f7; }
#profileSettingsView .profile-card {
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(20px, 5vw, 42px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(31,31,31,.98), rgba(15,15,15,.98));
  box-shadow: 0 24px 70px rgba(0,0,0,.34);
}
#profileSettingsView .header-section { margin-bottom: 30px; }
#profileSettingsView .back-btn,
.downloads-back {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 24px;
  padding: 0;
  border: 0;
  color: #bcbcbc;
  background: transparent;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
#profileSettingsView .back-btn:hover,
.downloads-back:hover { color: #1ed760; }
#profileSettingsView .page-title {
  margin: 0 0 7px;
  color: #fff;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  font-weight: 750;
  background: none;
  -webkit-text-fill-color: currentColor;
}
#profileSettingsView .page-subtitle,
#profileSettingsView .form-text { color: #a5a5a5; }
#profileSettingsView .page-subtitle { margin: 0; }
#profileSettingsView .form-section { margin: 22px 0; }
#profileSettingsView .form-label { display: block; margin-bottom: 8px; color: #eee; font-weight: 650; }
#profileSettingsView .form-control {
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid #3c3c3c;
  border-radius: 11px;
  color: #fff;
  background: #181818;
}
#profileSettingsView .form-control:focus { border-color: #1ed760; box-shadow: 0 0 0 3px rgba(30,215,96,.16); }
#profileSettingsView .form-control:read-only { color: #aaa; background: #141414; }
#profileSettingsView .form-text { margin-top: 7px; font-size: .84rem; }
#profileSettingsView .action-section { margin: 26px 0 0; }
#profileSettingsView .danger-zone {
  margin-top: 32px;
  padding: 20px;
  border: 1px solid rgba(255,100,100,.28);
  border-radius: 15px;
  background: rgba(255,80,80,.055);
}
#profileSettingsView .danger-title { margin: 0 0 15px; color: #ff7777; font-size: 1.05rem; }
#profileSettingsView .danger-actions,
#profileSettingsView .profile-guest-actions { display: flex; flex-wrap: wrap; gap: 10px; }
#profileSettingsView .profile-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid #454545;
  border-radius: 11px;
  color: #f3f3f3;
  background: #242424;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
#profileSettingsView .profile-action-link:hover { color: #fff; background: #303030; }
#profileSettingsView .profile-action-link.primary { width: 100%; color: #071108; border-color: #1ed760; background: #1ed760; }
#profileSettingsView .profile-action-link.primary:hover { color: #071108; background: #47e77f; }
#profileSettingsView .profile-action-link.warning { color: #ffd36c; border-color: rgba(255,211,108,.4); }
#profileSettingsView .profile-action-link.danger { color: #ff8989; border-color: rgba(255,100,100,.4); }
#profileSettingsView .profile-guest-prompt { padding: 18px; border: 1px solid rgba(255,255,255,.09); border-radius: 14px; background: rgba(255,255,255,.035); }
#profileSettingsView .profile-guest-prompt p { color: #c3c3c3; }
.custom-alert { position: fixed; z-index: 12000; top: 18px; left: 50%; transform: translateX(-50%); padding: 12px 18px; border-radius: 10px; color: #071108; background: #1ed760; font-weight: 650; box-shadow: 0 8px 28px rgba(0,0,0,.4); }
.custom-alert.alert-error { color: #fff; background: #d94a4a; }

.downloads-shell { width: min(100% - 32px, 1120px); }
.downloads-header { position: relative; overflow: hidden; max-width: none; margin: 0 auto 38px; padding: clamp(28px, 6vw, 56px); border: 1px solid rgba(255,255,255,.09); border-radius: 28px; background: radial-gradient(ellipse at 85% 0%, rgba(30,215,96,.2), transparent 43%), linear-gradient(130deg,#202522,#111 65%); text-align: center; }
.downloads-back { display: flex; width: fit-content; margin: 0 0 34px; }
.downloads-eyebrow { color: #1ed760; font-size: .78rem; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; }
.downloads-header h1 { margin: 12px 0; color: #fff; font-size: clamp(2rem, 6vw, 3.6rem); line-height: 1.08; font-weight: 800; }
.downloads-header > p { max-width: 600px; margin: 0 auto; color: #bbb; font-size: 1rem; line-height: 1.6; }
.downloads-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 2px 15px; }
.downloads-section-heading h2 { margin: 0; color: #fff; font-size: 1.15rem; }
.downloads-section-heading span { color: #898989; font-size: .82rem; }
.download-platform-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.download-platform-card { display: grid; grid-template-columns: 48px minmax(0,1fr); align-items: center; gap: 14px; padding: 22px; border: 1px solid rgba(255,255,255,.09); border-radius: 20px; background: linear-gradient(145deg,#1c1c1c,#111); transition: border-color .18s, transform .18s, background .18s; }
.download-platform-card:hover { transform: translateY(-2px); border-color: rgba(30,215,96,.34); background: linear-gradient(145deg,#202420,#111); }
.download-platform-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 14px; color: #1ed760; background: rgba(30,215,96,.1); font-size: 1.3rem; }
.download-platform-card h2 { margin: 0 0 4px; color: #fff; font-size: 1.08rem; font-weight: 700; }
.download-platform-card p { margin: 0; color: #999; font-size: .82rem; line-height: 1.45; }
.download-platform-link,
.linux-download-links,
.download-platform-note { grid-column: 1 / -1; }
.download-platform-link { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 43px; padding: 10px 14px; border: 1px solid rgba(30,215,96,.45); border-radius: 11px; color: #06110a; background: #1ed760; font-weight: 700; text-decoration: none; }
.download-platform-link:hover { color: #06110a; background: #46e77f; }
.download-platform-note { color: #818181; font-size: .76rem; line-height: 1.45; }
.linux-download-links { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.download-platform-link.secondary { color: #efefef; border-color: #444; background: #262626; }
.download-platform-link.secondary:hover { color: #fff; background: #353535; }
.download-platform-link.unavailable,
.download-platform-link[aria-disabled="true"] { pointer-events: none; color: #888; border-color: #363636; background: #202020; }

@media (max-width: 680px) {
  .profile-settings-shell, .downloads-shell { width: min(100% - 24px, 560px); padding-top: 18px; }
  #profileSettingsView .profile-card { padding: 22px 18px; border-radius: 18px; }
  .download-platform-grid { grid-template-columns: 1fr; gap: 11px; }
  .download-platform-card { padding: 16px; }
  .downloads-header { margin-bottom: 24px; text-align: left; }
  .downloads-header > p { margin-left: 0; }
  .downloads-back { margin-bottom: 26px; }
  .downloads-section-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
}

@media (max-width: 380px) {
  .linux-download-links { grid-template-columns: 1fr; }
  #profileSettingsView .danger-actions { flex-direction: column; }
}
