/* Smooth: Settings (js/smooth-settings-ui.js rearranges #settings-window; js/settings.js still runs it).
   Same dark-navy panel as the Message Center: header, sidebar with the pages and links, the page on the right. */
#settings-window.ms{width:min(760px,calc(100vw - 24px));height:min(84vh,560px);max-width:none;max-height:none;padding:0;overflow:hidden;
  display:flex;flex-direction:column;border:1.5px solid #3b5a82;border-radius:18px;
  background:radial-gradient(120% 70% at 0% 0%,rgba(95,184,255,.10),transparent 60%),linear-gradient(180deg,#1b2d4a 0%,#131f36 60%,#0e182b 100%);
  box-shadow:0 18px 50px rgba(0,0,0,.65),inset 0 1px 0 rgba(255,255,255,.06);color:#fff;font:14px/1.35 "MG VAG","Trebuchet MS",Arial,sans-serif;
  animation:ms-pop .18s ease-out}
#settings-window.ms[hidden]{display:none}
@keyframes ms-pop{from{opacity:0;transform:translate(-50%,-48%)}to{opacity:1;transform:translate(-50%,-50%)}}

/* header */
#settings-window.ms .ms-head{flex:none;display:flex;align-items:center;gap:12px;padding:14px 64px 14px 18px;border-bottom:1px solid rgba(120,165,215,.22);background:linear-gradient(180deg,rgba(255,255,255,.04),transparent)}
#settings-window.ms .ms-logo{width:42px;height:42px;flex:none;filter:drop-shadow(0 3px 4px rgba(0,0,0,.45))}
#settings-window.ms .ms-titles{flex:1;min-width:0}
#settings-window.ms .ms-title{font:22px/1.1 "MG VAG Bold","MG VAG",Arial,sans-serif;color:#fff;text-shadow:0 2px 3px rgba(0,0,0,.5)}
#settings-window.ms .ms-sub{margin-top:3px;font-size:13px;color:#8fb0d8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#settings-window.ms .x-close{position:absolute;top:18px;right:18px;width:34px;height:34px;min-width:0;min-height:0;padding:0;display:grid;place-items:center;
  border:0;border-radius:50%;background:rgba(255,255,255,.08);color:#c8d6ec;font:400 22px/1 Arial,sans-serif;cursor:pointer;transition:background .15s,color .15s,transform .15s}
#settings-window.ms .x-close:hover{background:#e0475a;color:#fff;transform:rotate(90deg)}

/* body */
#settings-window.ms .ms-body{flex:1;min-height:0;display:flex}
#settings-window.ms .ms-side{flex:none;width:184px;display:flex;flex-direction:column;padding:12px 10px;box-sizing:border-box;border-right:1px solid rgba(120,165,215,.16);background:rgba(4,10,22,.28)}
#settings-window.ms .ms-tabs,#settings-window.ms .ms-links{display:flex;flex-direction:column;gap:4px}
#settings-window.ms .ms-sep{height:1px;margin:10px 6px;background:rgba(120,165,215,.18)}
#settings-window.ms .ms-grow{flex:1}

/* sidebar rows: pages, links and Log out share one shape */
#settings-window.ms .ms-tabs button,#settings-window.ms .ms-link,#settings-window.ms .ms-logout{position:relative;display:flex;align-items:center;gap:10px;width:100%;box-sizing:border-box;min-height:0;min-width:0;margin:0;
  padding:10px 10px 10px 12px;border:0;border-radius:10px;background:transparent;box-shadow:none;color:#9fb6d6;text-shadow:none;font:14px/1.1 "MG VAG Bold","MG VAG",Arial,sans-serif;font-style:normal;
  text-align:left;text-decoration:none;cursor:pointer;filter:none;transition:background .15s,color .15s}
#settings-window.ms .ms-tabs button:hover,#settings-window.ms .ms-link:hover{background:rgba(120,190,255,.08);color:#dbe8fa;filter:none}
#settings-window.ms .ms-tabs button[aria-selected=true]{background:rgba(95,184,255,.16);color:#fff}
#settings-window.ms .ms-tabs button[aria-selected=true]::before{content:"";position:absolute;left:0;top:9px;bottom:9px;width:3px;border-radius:3px;background:#5fb8ff}
#settings-window.ms .ms-tabs button:focus-visible,#settings-window.ms .ms-link:focus-visible,#settings-window.ms .ms-logout:focus-visible{outline:2px solid #5fb8ff;outline-offset:-2px}
#settings-window.ms .ms-ic{width:19px;height:19px;flex:none}
#settings-window.ms .ms-label{flex:1;min-width:0}
#settings-window.ms .ms-ext{width:13px;height:13px;flex:none;opacity:.55}
#settings-window.ms .ms-discord .ms-ic{width:20px;height:auto;padding:3px;box-sizing:border-box;border-radius:6px;background:#5865f2}
#settings-window.ms .ms-logout{color:#ff9aa6}
#settings-window.ms .ms-logout:hover{background:rgba(224,71,90,.16);color:#ffc0c8;filter:none}

/* page */
#settings-window.ms .ms-main{flex:1;min-width:0;overflow:auto;padding:14px 16px 16px 18px;scrollbar-width:thin;scrollbar-color:#3b5a82 transparent}
#settings-window.ms .ms-page[hidden]{display:none}
#settings-window.ms .ms-page{display:flex;flex-direction:column;gap:12px}
#settings-window.ms .ms-page-head h3{margin:0;color:#fff;font:19px/1.2 "MG VAG Bold","MG VAG",Arial,sans-serif;text-shadow:none}
#settings-window.ms .ms-page-head p{margin:3px 0 0;color:#8fa6c8;font-size:13px}
#settings-window.ms .ms-card{padding:14px 16px;border-radius:12px;border:1px solid rgba(140,180,230,.13);background:rgba(255,255,255,.035)}
#settings-window.ms .ms-card h4{margin:0 0 8px;color:#7fc8ff;font:11px/1.2 "MG VAG Bold",Arial,sans-serif;letter-spacing:.1em;text-transform:uppercase}
#settings-window.ms .ms-card-sub{margin:-4px 0 10px;color:#7891b6;font-size:12px}
#settings-window.ms .settings-hint{margin:2px 0 10px;color:#8fa6c8;font-size:12.5px}
#settings-window.ms #set-quality-hint{color:#ffd28a}
#settings-window.ms .settings-hint button{margin-left:6px;padding:4px 12px;border:0;border-radius:999px;background:linear-gradient(180deg,#ffd955,#f5a300);color:#3a2300;font:12px "MG VAG Bold",Arial,sans-serif;box-shadow:none;cursor:pointer}

/* fields: label on top, control under it */
#settings-window.ms .ms-card label{display:flex;flex-direction:column;gap:6px;margin:0 0 12px;color:#dbe6f7;font-size:14px}
#settings-window.ms .ms-card select{padding:8px 10px;border:1px solid rgba(127,180,255,.28);border-radius:8px;background:#0c1629;color:#fff;font:inherit;cursor:pointer}
#settings-window.ms .ms-card select:focus{outline:none;border-color:#5fb8ff;box-shadow:0 0 0 2px rgba(95,184,255,.3)}
#settings-window.ms .ms-card select:disabled{opacity:.6;cursor:default}
#settings-window.ms input[type=range]{width:100%;accent-color:#5fb8ff;cursor:pointer}
#settings-window.ms .ms-sliders label:last-child{margin-bottom:0}

/* switches: text on the left, switch on the right */
#settings-window.ms .ms-card label.check{flex-direction:row-reverse;justify-content:space-between;align-items:center;gap:14px;margin:0;padding:11px 0;border-top:1px solid rgba(140,180,230,.1)}
#settings-window.ms .ms-card h4+label.check,#settings-window.ms .ms-card-sub+label.check{border-top:0;padding-top:4px}
#settings-window.ms input[type=checkbox]{appearance:none;-webkit-appearance:none;flex:none;position:relative;width:40px;height:22px;margin:0;border-radius:11px;background:#33476a;
  box-shadow:inset 0 1px 2px rgba(0,0,0,.4);cursor:pointer;transition:background .18s}
#settings-window.ms input[type=checkbox]::before{content:"";position:absolute;left:3px;top:3px;width:16px;height:16px;border-radius:50%;background:#c8d6ec;box-shadow:0 1px 2px rgba(0,0,0,.4);transition:transform .18s,background .18s}
#settings-window.ms input[type=checkbox]:checked{background:#2f8cff}
#settings-window.ms input[type=checkbox]:checked::before{transform:translateX(18px);background:#fff}
#settings-window.ms input[type=checkbox]:focus-visible{outline:2px solid #5fb8ff;outline-offset:2px}
#settings-window.ms input[type=checkbox]:disabled{opacity:.5;cursor:default}
#settings-window.ms #set-auto-note{margin:0 0 8px;color:#ffd96a;font-size:12px}
#settings-window.ms .settings-map-hint,#settings-window.ms label.check+.settings-hint{margin:-6px 0 8px}

/* profile */
#settings-window.ms .ms-profile .settings-profile{padding:0;border:0;background:none}
#settings-window.ms .settings-profile .profile-card{border-bottom-color:rgba(140,180,230,.13)}
#settings-window.ms #account-username label,#settings-window.ms #account-contact label,#settings-window.ms #account-password label{color:#cfdcf0}
#settings-window.ms #account-contact,#settings-window.ms #account-password-box{border-top-color:rgba(140,180,230,.13)}
#settings-window.ms #account-contact input,#settings-window.ms #account-password input,#settings-window.ms #account-username-input{background:#0c1629;border:1px solid rgba(127,180,255,.28);border-radius:8px;color:#fff}
#settings-window.ms #account-contact input:focus,#settings-window.ms #account-password input:focus,#settings-window.ms #account-username-input:focus{border-color:#5fb8ff;box-shadow:0 0 0 2px rgba(95,184,255,.3)}
#settings-window.ms #account-password-box>summary{color:#7fc8ff}
#settings-window.ms #account-password-box>summary::after{border-color:#7fc8ff}
#settings-window.ms #profile-change,#settings-window.ms #account-username-save,#settings-window.ms #account-contact button,#settings-window.ms #account-password button,#settings-window.ms .profile-actions button{
  border:0;border-radius:999px;background:linear-gradient(180deg,#ffd955,#f5a300);color:#3a2300;text-shadow:none;box-shadow:0 2px 0 #b06f00;font-family:"MG VAG Bold","MG VAG",Arial,sans-serif}
#settings-window.ms #profile-change:hover,#settings-window.ms #account-username-save:hover,#settings-window.ms #account-contact button:hover,#settings-window.ms #account-password button:hover,#settings-window.ms .profile-actions button:hover{filter:brightness(1.08)}
#settings-window.ms .profile-actions button:nth-child(n+2){background:transparent;color:#c8d6ec;box-shadow:inset 0 0 0 1px rgba(169,187,214,.4)}

/* Privacy & Terms */
#settings-window.ms .ms-docs{display:grid;gap:10px}
#settings-window.ms .ms-doc{display:flex;align-items:center;gap:14px;padding:14px 16px;border-radius:12px;border:1px solid rgba(140,180,230,.13);background:rgba(255,255,255,.035);
  color:#fff;text-decoration:none;transition:background .15s,border-color .15s}
#settings-window.ms .ms-doc:hover{background:rgba(95,184,255,.1);border-color:rgba(95,184,255,.4)}
#settings-window.ms .ms-doc:focus-visible{outline:2px solid #5fb8ff;outline-offset:2px}
#settings-window.ms .ms-doc-ic{width:40px;height:40px;padding:9px;box-sizing:border-box;border-radius:12px;background:rgba(95,184,255,.14);color:#7fc8ff}
#settings-window.ms .ms-doc-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
#settings-window.ms .ms-doc-text b{font:16px/1.2 "MG VAG Bold","MG VAG",Arial,sans-serif;font-weight:normal}
#settings-window.ms .ms-doc-text small{color:#9fb3d0;font-size:12.5px}
#settings-window.ms .ms-doc .ms-ext{width:16px;height:16px;color:#7fc8ff;opacity:.8}
#settings-window.ms .ms-fan{margin:4px 2px 0;padding:10px 12px;border-radius:10px;background:rgba(255,215,90,.08);color:#d9c58c;font-size:12.5px}

/* the Change Profile picker: same panel */
#profile-picker{background:linear-gradient(180deg,#1b2d4a,#0e182b);border:1.5px solid #3b5a82;border-radius:18px;box-shadow:0 18px 50px rgba(0,0,0,.65)}
#profile-picker h2{color:#fff;font-size:20px;letter-spacing:0;text-transform:none;text-shadow:none}
#profile-picker .x-close{border:0;border-radius:50%;background:rgba(255,255,255,.08);color:#c8d6ec}
#profile-picker .x-close:hover{background:#e0475a;color:#fff}
#profile-picker #profile-choices button{border-radius:10px;border:2px solid rgba(140,180,230,.18);background:#0c1629}
#profile-picker #profile-choices button[aria-selected=true]{border-color:#ffc23d;box-shadow:0 0 0 2px rgba(255,194,61,.35)}

/* phones / small screens: PC size and layout, scaled by js/smooth-fit.js */
html.mg-small #settings-window.ms{width:760px!important;max-width:none!important;height:560px!important;max-height:none!important}

@media (prefers-reduced-motion:reduce){#settings-window.ms{animation:none}#settings-window.ms .x-close,#settings-window.ms input[type=checkbox],#settings-window.ms input[type=checkbox]::before{transition:none}}
#settings-window.ms #account-username-input{height:38px;box-sizing:border-box}
#settings-window.ms #account-username-save{align-self:end;height:38px;padding:0 16px;box-shadow:none}
#settings-window.ms .ms-profile form label{margin:0}
